Provie F_implemented and F_implemented_not, then use them for capability function support.
This now replaces F_suppoted_not for this particular usage, allowing f_supported_not to be used more naturally for other purposes such as representing codes used by the POSIX libc standard.
Cleanup the documentation comments, updating to the latest style.
Add some missing capability functions (I think there are a lot more to do, so another commit will eventually follow this one).
A number of the status codes were incorrect and/or undocumented.
Make sure F_parameter is handled more consistent (adding it where it is missing).
My increased experience with the POSIX libc standard has led me to believe that it is not safe to use (XX < 0) comparisons when comparing for -1.
This is because POSIX libc is often more loosely defined so if it says -1, that allows for all other negative values to be implementation-specific.
By checking for (XX < 0), this would expose this project to potential implementation specific bugs.
This likely needs to be fixed everywhere, but for now f_capability is where I am starting.
A new function f_capability_supported_ambient() is provided to handle the CAP_AMBIENT_SUPPORTED() macro function.
This is always potentially returned for any function whose parameter requires a validity checked.
Much of this functionality can be optionally disabled, but the client using the API need not be aware.
- F_supported_not\:
+ F_implemented_not\:
This is used to designate that the function or some part of the function is not supported.
This is primarily used by individuals altering the project but maintaing API compatibility.
- Any function must therefore support returning F_suppoted_not.
+ Any function must therefore support returning F_implemented_not.
There are some projects that can be enabled/disabled such as f_capability and f_threads.
- These may explicitly document returning F_supported_not.
-
- The F_suppoted_not may be used for other purposes as well.
- @todo Consider replacing this with F_function_unsupported as a special case to allow for F_suppoted_not to be usable for normal purposes.
- Using F_suppoted_not is currently ambiguous between the function being unsupported and some functionality provided by the function being unsupported.
+ These may explicitly document returning F_implemented_not.
Common Return Types for f_status_t:
There are some f_status_t return types that are not required to be returned but are used quite often that they might seem required.
#ifndef _di_f_capability_clear_
f_status_t f_capability_clear(f_capability_t *capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_clear_
#ifndef _di_f_capability_clear_flag_
f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t *capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_clear_flag_
#ifndef _di_f_capability_compare_
f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_compare_
+ #ifndef _di_f_capability_copy_external_
+ f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_copy_external_
+
+ #ifndef _di_f_capability_copy_internal_
+ f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_copy_internal_
+
#ifndef _di_f_capability_delete_
f_status_t f_capability_delete(f_capability_t *capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_delete_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_duplicate_
#ifndef _di_f_capability_flag_get_
f_status_t f_capability_flag_get(const f_capability_t capability, const f_capability_value_t code, const f_capability_flag_t flag, f_capability_flag_value_t *enabled) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_flag_get_
#ifndef _di_f_capability_flag_set_
f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t *capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_flag_set_
#ifndef _di_f_capability_from_name_
f_status_t f_capability_from_name(const f_string_t name, f_capability_value_t *code) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_from_name_
#ifndef _di_f_capability_from_text_
f_status_t f_capability_from_text(const f_string_t text, f_capability_t *capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_from_text_
+ #ifndef _di_f_capability_get_file_
+ f_status_t f_capability_get_file(const f_string_t path, f_capability_t *capability) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_get_file_
+
+ #ifndef _di_f_capability_get_file_descriptor_
+ f_status_t f_capability_get_file_descriptor(const int descriptor, f_capability_t *capability) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_get_file_descriptor_
+
#ifndef _di_f_capability_process_bound_drop_
f_status_t f_capability_process_bound_drop(f_capability_value_t code, int *bound) {
#ifndef _di_level_0_parameter_checking_
if (!bound) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_process_bound_drop_
if (!bound) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_process_bound_get_
if (!capability) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_initialize_
if (!capability) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_process_get_
if (!capability) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_process_get_by_id_
#ifndef _di_f_capability_process_set_
f_status_t f_capability_process_set(const f_capability_t capability) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_process_set_
+ #ifndef _di_f_capability_set_file_
+ f_status_t f_capability_set_file(const f_string_t path, const f_capability_t capability) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_set_file_
+
+ #ifndef _di_f_capability_set_file_descriptor_
+ f_status_t f_capability_set_file_descriptor(const int descriptor, const f_capability_t capability) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_set_file_descriptor_
+
+ #ifndef _di_f_capability_size_
+ f_status_t f_capability_size(const f_capability_t capability, ssize_t *size) {
+ return F_status_set_error(F_implemented_not);
+ }
+ #endif // _di_f_capability_size_
+
#ifndef _di_f_capability_supported_
bool f_capability_supported() {
return F_false;
}
#endif // _di_f_capability_supported_
+ #ifndef _di_f_capability_supported_ambient_
+ bool f_capability_supported_ambient() {
+ return F_false;
+ }
+ #endif // _di_f_capability_supported_ambient_
+
#ifndef _di_f_capability_supported_code_
bool f_capability_supported_code(const f_capability_value_t code) {
return F_false;
if (!name) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_to_name_
#ifndef _di_f_capability_to_text_
f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t *text) {
- return F_status_set_error(F_supported_not);
+ return F_status_set_error(F_implemented_not);
}
#endif // _di_f_capability_to_text_
#ifndef _di_f_capability_clear_
f_status_t f_capability_clear(f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
- if (cap_clear(*capability) < 0) {
+ if (cap_clear(*capability) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ERANGE) return F_status_set_error(F_range_not);
return F_status_set_error(F_failure);
}
#ifndef _di_f_capability_clear_flag_
f_status_t f_capability_clear_flag(const f_capability_flag_t flag, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
- if (cap_clear_flag(*capability, flag) < 0) {
+ if (cap_clear_flag(*capability, flag) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
return F_status_set_error(F_failure);
#ifndef _di_f_capability_compare_
f_status_t f_capability_compare(const f_capability_t capability1, const f_capability_t capability2, int *flags) {
-
if (*flags) {
*flags = 0;
}
const int result = cap_compare(capability1, capability2);
- if (result < 0) {
+ if (result == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
return F_status_set_error(F_failure);
}
#endif // _di_f_capability_compare_
+ #ifndef _di_f_capability_copy_external_
+ f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!external) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ const ssize_t result = cap_copy_ext(external, capability, max);
+
+ if (result == -1) {
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ERANGE) return F_status_set_error(F_range_not);
+
+ return F_status_set_error(F_failure);
+ }
+
+ if (size) *size = result;
+
+ return F_none;
+ }
+ #endif // _di_f_capability_copy_external_
+
+ #ifndef _di_f_capability_copy_internal_
+ f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!external) return F_status_set_error(F_parameter);
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ *capability = cap_copy_int(external);
+
+ if (*capability) {
+ return F_none;
+ }
+
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ERANGE) return F_status_set_error(F_range_not);
+
+ return F_status_set_error(F_failure);
+ }
+ #endif // _di_f_capability_copy_internal_
+
#ifndef _di_f_capability_delete_
f_status_t f_capability_delete(f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (cap_free(*capability) == -1) {
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
- if (cap_free(*capability) < 0) {
return F_status_set_error(F_failure);
}
if (!enabled) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (cap_get_flag(capability, code, flag, enabled) < 0) {
+ if (cap_get_flag(capability, code, flag, enabled) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
return F_status_set_error(F_failure);
#ifndef _di_f_capability_flag_set_
f_status_t f_capability_flag_set(const f_capability_flag_t flag, const f_capability_flag_value_t enabled, const f_int32s_t codes, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
- if (cap_set_flag(*capability, flag, codes.used, codes.array, enabled) < 0) {
+ if (cap_set_flag(*capability, flag, codes.used, codes.array, enabled) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
return F_status_set_error(F_failure);
#ifndef _di_f_capability_from_name_
f_status_t f_capability_from_name(const f_string_t name, f_capability_value_t *code) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!code) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
- if (cap_from_name(name, code) < 0) {
+ if (cap_from_name(name, code) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
if (errno == ENOMEM) return F_status_set_error(F_memory_not);
#ifndef _di_f_capability_from_text_
f_status_t f_capability_from_text(const f_string_t text, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
*capability = cap_from_text(text);
if (*capability) {
}
#endif // _di_f_capability_from_text_
+ #ifndef _di_f_capability_get_file_
+ f_status_t f_capability_get_file(const f_string_t path, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ *capability = cap_get_file(path);
+
+ if (*capability) {
+ return F_none;
+ }
+
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EBADFD) return F_status_set_error(F_descriptor_not);
+ if (errno == ENAMETOOLONG) return F_status_set_error(F_name_not);
+ if (errno == ENOENT) return F_status_set_error(F_file_found_not);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+ if (errno == EROFS) return F_status_set_error(F_supported_not);
+
+ return F_status_set_error(F_failure);
+ }
+ #endif // _di_f_capability_get_file_
+
+ #ifndef _di_f_capability_get_file_descriptor_
+ f_status_t f_capability_get_file_descriptor(const int descriptor, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ *capability = cap_get_fd(descriptor);
+
+ if (*capability) {
+ return F_none;
+ }
+
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EBADFD) return F_status_set_error(F_descriptor_not);
+ if (errno == ENAMETOOLONG) return F_status_set_error(F_name_not);
+ if (errno == ENOENT) return F_status_set_error(F_file_found_not);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+ if (errno == EROFS) return F_status_set_error(F_supported_not);
+
+ return F_status_set_error(F_failure);
+ }
+ #endif // _di_f_capability_get_file_descriptor_
+
#ifndef _di_f_capability_initialize_
f_status_t f_capability_initialize(f_capability_t *capability) {
#ifndef _di_level_0_parameter_checking_
#ifndef _di_f_capability_process_bound_drop_
f_status_t f_capability_process_bound_drop(f_capability_value_t code, int *bound) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!bound) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
*bound = cap_drop_bound(code);
- if (*bound < 0) {
- return F_known_not;
- }
+ if (*bound == -1) {
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
- if (*bound) {
- return F_none;
+ return F_status_set_error(F_failure);
}
- return F_supported_not;
+ return F_none;
}
#endif // _di_f_capability_process_bound_drop_
*bound = cap_get_bound(code);
- if (*bound < 0) {
- return F_known_not;
+ if (*bound == -1) {
+ return F_status_set_error(F_known_not);
}
- if (*bound) {
- return F_none;
- }
-
- return F_supported_not;
+ return F_none;
}
#endif // _di_f_capability_process_bound_get_
#ifndef _di_f_capability_process_get_
f_status_t f_capability_process_get(f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
*capability = cap_get_proc();
#ifndef _di_f_capability_process_get_by_id_
f_status_t f_capability_process_get_by_id(const pid_t id, f_capability_t *capability) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!capability) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
*capability = cap_get_pid(id);
return F_none;
}
- if (errno == EINVAL) return F_status_set_error(F_parameter);
- if (errno == ENOMEM) return F_status_set_error(F_memory_not);
-
return F_status_set_error(F_failure);
}
#endif // _di_f_capability_process_get_by_id_
#ifndef _di_f_capability_process_set_
f_status_t f_capability_process_set(const f_capability_t capability) {
- if (cap_set_proc(capability) < 0) {
+ if (cap_set_proc(capability) == -1) {
if (errno == EINVAL) return F_status_set_error(F_parameter);
if (errno == ENOMEM) return F_status_set_error(F_memory_not);
if (errno == EPERM) return F_status_set_error(F_prohibited);
}
#endif // _di_f_capability_process_set_
+ #ifndef _di_f_capability_set_file_
+ f_status_t f_capability_set_file(const f_string_t path, const f_capability_t capability) {
+
+ const int result = cap_set_file(path, capability);
+
+ if (result == -1) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EBADFD) return F_status_set_error(F_descriptor_not);
+ if (errno == ENAMETOOLONG) return F_status_set_error(F_name_not);
+ if (errno == ENOENT) return F_status_set_error(F_file_found_not);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+ if (errno == EROFS) return F_status_set_error(F_supported_not);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+ #endif // _di_f_capability_set_file_
+
+ #ifndef _di_f_capability_set_file_descriptor_
+ f_status_t f_capability_set_file_descriptor(const int descriptor, const f_capability_t capability) {
+
+ const int result = cap_set_fd(descriptor, capability);
+
+ if (result == -1) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EBADFD) return F_status_set_error(F_descriptor_not);
+ if (errno == ENAMETOOLONG) return F_status_set_error(F_name_not);
+ if (errno == ENOENT) return F_status_set_error(F_file_found_not);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+ if (errno == EROFS) return F_status_set_error(F_supported_not);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+ #endif // _di_f_capability_set_file_descriptor_
+
+ #ifndef _di_f_capability_size_
+ f_status_t f_capability_size(const f_capability_t capability, ssize_t *size) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!size) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ *size = cap_size(capability);
+
+ if (*size == -1) {
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+ #endif // _di_f_capability_size_
+
#ifndef _di_f_capability_supported_
bool f_capability_supported() {
return F_true;
}
#endif // _di_f_capability_supported_
+ #ifndef _di_f_capability_supported_ambient_
+ bool f_capability_supported_ambient() {
+ return CAP_AMBIENT_SUPPORTED();
+ }
+ #endif // _di_f_capability_supported_ambient_
+
#ifndef _di_f_capability_supported_code_
bool f_capability_supported_code(const f_capability_value_t code) {
return CAP_IS_SUPPORTED(code);
if (result) {
const f_array_length_t length = strlen(result);
- f_status_t status = F_none;
-
if (name->used + length + 1 > name->size) {
if (name->used + length + 1 > f_array_length_t_size) {
return F_status_set_error(F_string_too_large);
}
- f_macro_string_dynamic_t_resize(status, (*name), name->used + length + 1);
+ const f_status_t status = f_string_dynamic_resize(name->used + length + 1, name);
if (F_status_is_error(status)) {
cap_free(result);
cap_free(result);
- return status;
+ return F_none;
}
if (errno == EINVAL) return F_status_set_error(F_parameter);
char *result = cap_to_text(capability, &length);
if (result) {
- f_status_t status = F_none;
-
- if (text->used + length + 1> text->size) {
+ if (text->used + length + 1 > text->size) {
if (text->used + length + 1 > f_array_length_t_size) {
return F_status_set_error(F_string_too_large);
}
- f_macro_string_dynamic_t_resize(status, (*text), text->used + length + 1);
+ const f_status_t status = f_string_dynamic_resize(text->used + length + 1, text);
if (F_status_is_error(status)) {
cap_free(result);
cap_free(result);
- return status;
+ return F_none;
}
if (errno == EINVAL) return F_status_set_error(F_parameter);
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to duplicate.
- * F_memory_not (with error bit) if a out of memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_clear()
*/
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to duplicate.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_clear_flag()
*/
* @return
* F_equal_to on match.
* F_equal_to_not on miss.
- * F_failure (with error bit) on failure to duplicate.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_compare()
*/
#endif // _di_f_capability_compare_
/**
+ * Copy an internally represented capability into an externally represented capability.
+ *
+ * @param capability
+ * The (internal) capability the (external) capability is copied from.
+ * @param max
+ * The the maximum buffer length (in bytes) allowed in the (external) capability.
+ * Use f_capability_size() to determine the maximum size required to hold capability.
+ * @param external
+ * The (external) capability the (internal) capability is copied to.
+ * @param size
+ * (optional) The size (in bytes) copied into the (external) capability.
+ * Set to NULL to not use.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_range_not (with error bit) on out of range when processing (external) capability.
+ *
+ * F_failure (with error bit) on failure to get size.
+ *
+ * @see cap_copy_ext()
+ */
+#ifndef _di_f_capability_copy_external_
+ extern f_status_t f_capability_copy_external(const f_capability_t capability, const ssize_t max, void *external, ssize_t *size);
+#endif // _di_f_capability_copy_external_
+
+/**
+ * Copy an externally represented capability into an internally represented capability.
+ *
+ * @param external
+ * A pointer to user allocated memory representing the (external) capability.
+ * This must have been popilated by cap_copy_ext() or f_capability_copy_external().
+ * @param capability
+ * The (internal) capability the (external) capability is copied into.
+ * This must be freed via f_capability_delete() when finished with.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_range_not (with error bit) on out of range when processing (external) capability.
+ *
+ * F_failure (with error bit) on failure to get size.
+ *
+ * @see cap_copy_int()
+ */
+#ifndef _di_f_capability_copy_internal_
+ extern f_status_t f_capability_copy_internal(const void *external, f_capability_t *capability);
+#endif // _di_f_capability_copy_internal_
+
+/**
* Free the capability structure.
*
* @param capability
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to free memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory (which doesn't make sense here but man page includes this).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_free()
*/
/**
* Duplicate (copy) the capability structure.
*
- * Be sure to call f_capability_delete() when finished.
- *
* @param source
* The capability to duplicate.
* @param destination
* The capability to copy to.
+ * This must be freed via f_capability_delete() when finished with.
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to duplicate.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_dup()
*/
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to free memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_get_flag()
*/
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to free memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_set_flag()
*/
* Set to NULL to not use.
*
* @return
- * F_none on success and name is known.
- * F_known_not on success and name is unknown (and no code is provided).
+ * F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on any other failure.
*
* @see cap_from_name()
*/
* The human-readable NULL terminated string representing the capabilities (such as "cap_chown+ep").
* @param capability
* The determined capabilities.
- * This must be freed via f_capability_delete() when finished with it.
+ * This must be freed via f_capability_delete() when finished with.
*
* @return
* F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other failure.
*
* @see cap_from_text()
#endif // _di_f_capability_from_text_
/**
- * Initialize the capability structure.
+ * Get the capability of a file represented by a file path.
+ *
+ * @param path
+ * The file path.
+ * @param capability
+ * The retrieved capability.
+ * This must be freed via f_capability_delete() when finished with.
*
- * Be sure to call f_capability_delete() when finished.
+ * @return
+ * F_none on success.
+ *
+ * F_access_denied (with error bit) on access denied.
+ * F_descriptor_not (with error bit) if the file descriptor is invalid.
+ * F_directory_not (with error bit) if a directory containing the file does not exist.
+ * F_file_found_not (with error bit) if file was not found.
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
+ * F_name_not (with error bit) if the file name is too long.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ * F_supported_not (with error bit) if the filesystem does not support this operation.
+ *
+ * F_failure (with error bit) on any other failure.
+ *
+ * @see cap_get_file()
+ */
+#ifndef _di_f_capability_get_file_
+ extern f_status_t f_capability_get_file(const f_string_t path, f_capability_t *capability);
+#endif // _di_f_capability_get_file_
+
+/**
+ * Get the capability of a file represented by a file descriptor.
+ *
+ * @param descriptor
+ * The file descriptor.
+ * @param capability
+ * The retrieved capability.
+ * This must be freed via f_capability_delete() when finished with.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_access_denied (with error bit) on access denied.
+ * F_descriptor_not (with error bit) if the file descriptor is invalid.
+ * F_directory_not (with error bit) if a directory containing the file does not exist.
+ * F_file_found_not (with error bit) if file was not found.
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
+ * F_name_not (with error bit) if the file name is too long.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ * F_supported_not (with error bit) if the filesystem does not support this operation.
+ *
+ * F_failure (with error bit) on any other failure.
+ *
+ * @see cap_get_fd()
+ */
+#ifndef _di_f_capability_get_file_descriptor_
+ extern f_status_t f_capability_get_file_descriptor(const int descriptor, f_capability_t *capability);
+#endif // _di_f_capability_get_file_descriptor_
+
+/**
+ * Initialize the capability structure.
*
* @param capability
* The capability to initialize.
+ * This must be freed via f_capability_delete() when finished with.
*
* @return
* F_none on success.
- * F_failure (with error bit) on failure to initialize.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
+ * F_failure (with error bit) on failure to initialize.
*
* @see cap_init()
*/
*
* @return
* F_none on success.
- * F_supported_not if the given code is not supported by the current system.
- * F_known_not (with error bit) if the code is unknown.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ *
* F_failure (with error bit) on any other error.
*
* @see cap_drop_bound()
*
* @return
* F_none on success.
- * F_supported_not if the given code is not supported by the current system.
- * F_known_not (with error bit) if the code is unknown.
- * F_memory_not (with error bit) if a out of memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_known_not (with error bit) if the code is unknown to the current system.
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other error.
*
* @see cap_get_bound()
/**
* Get the capability for the current process.
*
- * Be sure to call f_capability_delete() when finished.
- *
* @param capability
* The determined capability.
+ * This must be freed via f_capability_delete() when finished with.
*
* @return
* F_none on success.
- * F_memory_not (with error bit) if a out of memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other error.
*
* @see cap_get_proc()
/**
* Get the capability for the process represented by the given PID.
*
- * Be sure to call f_capability_delete() when finished.
- *
* @param id
* The process ID (pid) to get capabilities of.
+ * If set to 0, then get the capabilities of the calling process (similar to f_capability_process_get()).
* @param capability
* The determined capability.
+ * This must be freed via f_capability_delete() when finished with.
*
* @return
* F_none on success.
- * F_memory_not (with error bit) if a out of memory.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_parameter (with error bit) if a parameter is invalid.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other error.
*
* @see cap_get_pid()
*
* @return
* F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
- * F_prohibited (with error bit) if system does not support a capability code specified.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ *
* F_failure (with error bit) on any other error.
*
* @see cap_set_proc()
#endif // _di_f_capability_process_set_
/**
+ * Set the capability of a file represented by a file path.
+ *
+ * @param path
+ * The file path.
+ * @param capability
+ * The capability to set.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_access_denied (with error bit) on access denied.
+ * F_descriptor_not (with error bit) if the file descriptor is invalid.
+ * F_directory_not (with error bit) if a directory containing the file does not exist.
+ * F_file_found_not (with error bit) if file was not found.
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
+ * F_name_not (with error bit) if the file name is too long.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ * F_supported_not (with error bit) if the filesystem does not support this operation.
+ *
+ * F_failure (with error bit) on any other failure.
+ *
+ * @see cap_set_file()
+ */
+#ifndef _di_f_capability_set_file_
+ extern f_status_t f_capability_set_file(const f_string_t path, const f_capability_t capability);
+#endif // _di_f_capability_set_file_
+
+/**
+ * Set the capability of a file represented by a file descriptor.
+ *
+ * @param descriptor
+ * The file descriptor.
+ * @param capability
+ * The capability to set.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_access_denied (with error bit) on access denied.
+ * F_descriptor_not (with error bit) if the file descriptor is invalid.
+ * F_directory_not (with error bit) if a directory containing the file does not exist.
+ * F_file_found_not (with error bit) if file was not found.
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
+ * F_name_not (with error bit) if the file name is too long.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if the filesystem does not permit this operation.
+ * F_supported_not (with error bit) if the filesystem does not support this operation.
+ *
+ * F_failure (with error bit) on any other failure.
+ *
+ * @see cap_set_fd()
+ */
+#ifndef _di_f_capability_set_file_descriptor_
+ extern f_status_t f_capability_set_file_descriptor(const int descriptor, const f_capability_t capability);
+#endif // _di_f_capability_set_file_descriptor_
+
+/**
+ * Get the total length (in bytes) the capability would take up when converted to external representation.
+ *
+ * @param capability
+ * The capability to get size of.
+ * @param size
+ * The size of the external representation of capability.
+ * Size may be set to -1 on error.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_range_not (with error bit) on out of range when processing size.
+ *
+ * F_failure (with error bit) on failure to get size.
+ *
+ * @see cap_size()
+ */
+#ifndef _di_f_capability_size_
+ extern f_status_t f_capability_size(const f_capability_t capability, ssize_t *size);
+#endif // _di_f_capability_size_
+
+/**
* Check if capabilities are supported.
*
* @return
#endif // _di_f_capability_supported_
/**
- * Check if capabilities are supported.
+ * Check if the capabilitiy code is supported, using special libcap function/macro.
*
* @param code
* The capability code.
#endif // _di_f_capability_supported_code_
/**
+ * Check if capabilities support ambient, using special libcap function/macro.
+ *
+ * @param code
+ * The capability code.
+ *
+ * @return
+ * TRUE if ambient is supported.
+ * FALSE otherwise.
+ *
+ * @see CAP_AMBIENT_SUPPORTED()
+ */
+#ifndef _di_f_capability_supported_ambient_
+ extern bool f_capability_supported_ambient();
+#endif // _di_f_capability_supported_ambient_
+
+/**
* Convert the capability code to a name (string).
*
* @param code
*
* @return
* F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other failure.
*
+ * Errors (with error bit) from f_string_dynamic_resize().
+ *
* @see cap_free()
* @see cap_to_name()
+ *
+ * @see f_string_dynamic_resize()
*/
#ifndef _di_f_capability_to_name_
extern f_status_t f_capability_to_name(const f_capability_value_t code, f_string_dynamic_t *name);
/**
* Convert the capability to a human-readable NULL terminated string.
*
+ * This will append the string to text.
+ *
* @param capability
* The capability code.
* @param text
*
* @return
* F_none on success.
+ *
+ * F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ * F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
- * F_supported_not (with error bit) if this function is not available (due to not having libcap support compiled in).
+ *
* F_failure (with error bit) on any other failure.
*
+ * Errors (with error bit) from f_string_dynamic_resize().
+ *
* @see cap_free()
* @see cap_to_text()
+ *
+ * @see f_string_dynamic_resize()
*/
#ifndef _di_f_capability_to_text_
extern f_status_t f_capability_to_text(const f_capability_t capability, f_string_dynamic_t *text);
F_group_not,
F_ignore,
F_ignore_not,
+ F_implemented,
+ F_implemented_not,
F_input,
F_input_not,
F_input_output,
F_directory_purge,
F_directory_read,
F_directory_stream,
+ F_directory_supported_not,
F_directory_synchronize,
- F_directory_unsupported,
F_directory_utf,
F_directory_utf_not,
F_directory_write,
* F_directory_descriptor (with error bit) on directory file descriptor error.
* F_directory_open (with error bit) on directory open error.
* F_directory_stream (with error bit) on directory stream error.
- * F_directory_unsupported (with error bit) on directory file descriptor not supported.
+ * F_directory_supported_not (with error bit) on directory file descriptor not supported.
* F_failure (with error bit) if failed to read directory information.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
return F_status_set_error(F_directory_stream);
}
else if (errno == ENOTSUP) {
- return F_status_set_error(F_directory_unsupported);
+ return F_status_set_error(F_directory_supported_not);
}
return F_status_set_error(F_directory_descriptor);
* F_directory_descriptor (with error bit) on directory file descriptor error.
* F_directory_open (with error bit) on directory open error.
* F_directory_stream (with error bit) on directory stream error.
- * F_directory_unsupported (with error bit) on directory file descriptor not supported.
+ * F_directory_supported_not (with error bit) on directory file descriptor not supported.
* F_failure (with error bit) if failed to read directory information.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
case F_ignore_not:
*string = FL_status_string_ignore_not;
break;
+ case F_implemented:
+ *string = FL_status_string_implemented;
+ break;
+ case F_implemented_not:
+ *string = FL_status_string_implemented_not;
+ break;
case F_input:
*string = FL_status_string_input;
break;
case F_directory_synchronize:
*string = FL_status_string_directory_synchronize;
break;
- case F_directory_unsupported:
- *string = FL_status_string_directory_unsupported;
+ case F_directory_supported_not:
+ *string = FL_status_string_directory_supported_not;
break;
case F_directory_utf:
*string = FL_status_string_directory_utf;
#define FL_status_string_group_not "F_group_not"
#define FL_status_string_ignore "F_ignore"
#define FL_status_string_ignore_not "F_ignore_not"
+ #define FL_status_string_implemented "F_implemented"
+ #define FL_status_string_implemented_not "F_implemented_not"
#define FL_status_string_input "F_input"
#define FL_status_string_input_not "F_input_not"
#define FL_status_string_input_output "F_input_output"
#define FL_status_string_group_not_length 11
#define FL_status_string_ignore_length 8
#define FL_status_string_ignore_not_length 12
+ #define FL_status_string_implemented_length 13
+ #define FL_status_string_implemented_not_length 17
#define FL_status_string_input_length 7
#define FL_status_string_input_not_length 11
#define FL_status_string_input_output_length 14
#endif // _di_F_status_filesystem_
#ifndef _di_F_status_directory_
- #define FL_status_string_directory "F_directory"
- #define FL_status_string_directory_close "F_directory_close"
- #define FL_status_string_directory_closed "F_directory_closed"
- #define FL_status_string_directory_descriptor "F_directory_descriptor"
- #define FL_status_string_directory_empty "F_directory_empty"
- #define FL_status_string_directory_empty_not "F_directory_empty_not"
- #define FL_status_string_directory_found "F_directory_found"
- #define FL_status_string_directory_found_not "F_directory_found_not"
- #define FL_status_string_directory_flush "F_directory_flush"
- #define FL_status_string_directory_link_max "F_directory_link_max"
- #define FL_status_string_directory_not "F_directory_not"
- #define FL_status_string_directory_open "F_directory_open"
- #define FL_status_string_directory_purge "F_directory_purge"
- #define FL_status_string_directory_read "F_directory_read"
- #define FL_status_string_directory_stream "F_directory_stream"
- #define FL_status_string_directory_synchronize "F_directory_synchronize"
- #define FL_status_string_directory_unsupported "F_directory_unsupported"
- #define FL_status_string_directory_utf "F_directory_utf"
- #define FL_status_string_directory_utf_not "F_directory_utf_not"
- #define FL_status_string_directory_write "F_directory_write"
-
- #define FL_status_string_directory_length 11
- #define FL_status_string_directory_close_length 17
- #define FL_status_string_directory_closed_length 18
- #define FL_status_string_directory_descriptor_length 22
- #define FL_status_string_directory_empty_length 17
- #define FL_status_string_directory_empty_not_length 21
- #define FL_status_string_directory_found_length 17
- #define FL_status_string_directory_found_not_length 21
- #define FL_status_string_directory_flush_length 17
- #define FL_status_string_directory_link_max_length 20
- #define FL_status_string_directory_not_length 15
- #define FL_status_string_directory_open_length 16
- #define FL_status_string_directory_purge_length 17
- #define FL_status_string_directory_read_length 16
- #define FL_status_string_directory_stream_length 18
- #define FL_status_string_directory_synchronize_length 23
- #define FL_status_string_directory_unsupported_length 23
- #define FL_status_string_directory_utf_length 15
- #define FL_status_string_directory_utf_not_length 19
- #define FL_status_string_directory_write_length 17
+ #define FL_status_string_directory "F_directory"
+ #define FL_status_string_directory_close "F_directory_close"
+ #define FL_status_string_directory_closed "F_directory_closed"
+ #define FL_status_string_directory_descriptor "F_directory_descriptor"
+ #define FL_status_string_directory_empty "F_directory_empty"
+ #define FL_status_string_directory_empty_not "F_directory_empty_not"
+ #define FL_status_string_directory_found "F_directory_found"
+ #define FL_status_string_directory_found_not "F_directory_found_not"
+ #define FL_status_string_directory_flush "F_directory_flush"
+ #define FL_status_string_directory_link_max "F_directory_link_max"
+ #define FL_status_string_directory_not "F_directory_not"
+ #define FL_status_string_directory_open "F_directory_open"
+ #define FL_status_string_directory_purge "F_directory_purge"
+ #define FL_status_string_directory_read "F_directory_read"
+ #define FL_status_string_directory_stream "F_directory_stream"
+ #define FL_status_string_directory_supported_not "F_directory_supported_not"
+ #define FL_status_string_directory_synchronize "F_directory_synchronize"
+ #define FL_status_string_directory_utf "F_directory_utf"
+ #define FL_status_string_directory_utf_not "F_directory_utf_not"
+ #define FL_status_string_directory_write "F_directory_write"
+
+ #define FL_status_string_directory_length 11
+ #define FL_status_string_directory_close_length 17
+ #define FL_status_string_directory_closed_length 18
+ #define FL_status_string_directory_descriptor_length 22
+ #define FL_status_string_directory_empty_length 17
+ #define FL_status_string_directory_empty_not_length 21
+ #define FL_status_string_directory_found_length 17
+ #define FL_status_string_directory_found_not_length 21
+ #define FL_status_string_directory_flush_length 17
+ #define FL_status_string_directory_link_max_length 20
+ #define FL_status_string_directory_not_length 15
+ #define FL_status_string_directory_open_length 16
+ #define FL_status_string_directory_purge_length 17
+ #define FL_status_string_directory_read_length 16
+ #define FL_status_string_directory_stream_length 18
+ #define FL_status_string_directory_supported_not_length 25
+ #define FL_status_string_directory_synchronize_length 23
+ #define FL_status_string_directory_utf_length 15
+ #define FL_status_string_directory_utf_not_length 19
+ #define FL_status_string_directory_write_length 17
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_implemented, length, FL_status_string_implemented_length) == F_equal_to) {
+ *code = F_implemented;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_implemented_not, length, FL_status_string_implemented_not_length) == F_equal_to) {
+ *code = F_implemented_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_input, length, FL_status_string_input_length) == F_equal_to) {
*code = F_input;
return F_none;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_directory_synchronize, length, FL_status_string_directory_synchronize_length) == F_equal_to) {
- *code = F_directory_synchronize;
+ if (fl_string_compare(string, FL_status_string_directory_supported_not, length, FL_status_string_directory_supported_not_length) == F_equal_to) {
+ *code = F_directory_supported_not;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_directory_unsupported, length, FL_status_string_directory_unsupported_length) == F_equal_to) {
- *code = F_directory_unsupported;
+ if (fl_string_compare(string, FL_status_string_directory_synchronize, length, FL_status_string_directory_synchronize_length) == F_equal_to) {
+ *code = F_directory_synchronize;
return F_none;
}