From: Kevin Day Date: Mon, 8 Jun 2020 04:34:49 +0000 (-0500) Subject: Update: documentation cleanups, fix observed problems, retun F_data_not without error bit X-Git-Tag: 0.5.0~179 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=55a50c59efe17722671a654425ad6ca2a129ec02;p=fll Update: documentation cleanups, fix observed problems, retun F_data_not without error bit Organize the return codes. Fix any probles in the commend documentation that I happened to notice. This is not complete, there will be follow up commits to address more cleanups. I noticed that there were some public directory functions incorrectly have 'private_' in their name. The conversion functions should no longer consider no data an error. Just report that there was nothing to do. --- diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index 8345128..963abe9 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -213,6 +213,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -250,7 +254,7 @@ extern "C" { } } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -269,6 +273,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -290,7 +298,7 @@ extern "C" { converted = digit; } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -309,6 +317,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -351,7 +363,7 @@ extern "C" { } } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -370,6 +382,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -394,7 +410,7 @@ extern "C" { converted = digit; } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -413,6 +429,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -455,7 +475,7 @@ extern "C" { } } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -474,6 +494,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -498,7 +522,7 @@ extern "C" { converted = digit; } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -517,6 +541,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -559,7 +587,7 @@ extern "C" { } } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -578,6 +606,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -602,7 +634,7 @@ extern "C" { converted = digit; } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -621,6 +653,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -663,7 +699,7 @@ extern "C" { } } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -682,6 +718,10 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ + if (string[0] == 0) { + return F_data_not; + } + uint8_t scale = 0; f_number_unsigned digit = 0; f_number_unsigned converted = 0; @@ -706,7 +746,7 @@ extern "C" { converted = digit; } } - else if (string[i] != '\0') { + else if (string[i] != 0) { return F_status_set_error(F_number); } } // for @@ -725,8 +765,8 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (string[0] == '\0') { - return F_status_set_error(F_data_not); + if (string[0] == 0) { + return F_data_not; } uint8_t width = 0; @@ -874,8 +914,8 @@ extern "C" { if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (string[0] == '\0') { - return F_status_set_error(F_data_not); + if (string[0] == 0) { + return F_data_not; } uint8_t width = 0; diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index f090f72..d77a390 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -261,10 +261,11 @@ extern "C" { * * @return * F_none if the binary string was converted to an signed long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-binary values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_binary_signed_ extern f_return_status f_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -287,9 +288,10 @@ extern "C" { * * @return * F_none if the binary string was converted to an unsigned long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-binary values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_binary_unsigned_ extern f_return_status f_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -314,10 +316,11 @@ extern "C" { * * @return * F_none if the decimal string was converted to an signed long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-decimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_decimal_signed_ extern f_return_status f_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -340,9 +343,10 @@ extern "C" { * * @return * F_none if the decimal string was converted to an unsigned long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-decimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_decimal_unsigned_ extern f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -367,10 +371,11 @@ extern "C" { * * @return * F_none if the duodecimal string was converted to an signed long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-duodecimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_duodecimal_signed_ extern f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -393,9 +398,10 @@ extern "C" { * * @return * F_none if the duodecimal string was converted to an unsigned long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-duodecimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_duodecimal_unsigned_ extern f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -420,10 +426,11 @@ extern "C" { * * @return * F_none if the hexidecimal string was converted to an signed long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-hexidecimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_hexidecimal_signed_ extern f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -446,9 +453,10 @@ extern "C" { * * @return * F_none if the hexidecimal string was converted to an unsigned long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-hexidecimal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_hexidecimal_unsigned_ extern f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -473,9 +481,10 @@ extern "C" { * * @return * F_none if the octal string was converted to an signed long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-octal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_octal_signed_ extern f_return_status f_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -498,9 +507,10 @@ extern "C" { * * @return * F_none if the octal string was converted to an unsigned long. + * F_data_not if string starts with a null (length is 0). * F_number (with error bit) if no conversion was made due to non-octal values being found. - * F_parameter (with error bit) if a parameter is invalid. * F_number_overflow (with error bit) on integer overflow. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_string_to_octal_unsigned_ extern f_return_status f_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -535,12 +545,12 @@ extern "C" { * * @return * F_none on success. - * F_data_not (with error bit) if string starts with a null (length is 0). - * F_parameter (with error bit) if a parameter is invalid. + * F_data_not if string starts with a null (length is 0). + * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. * F_number (with error bit) if parameter is not a number. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. - * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. + * F_parameter (with error bit) if a parameter is invalid. * * @see strtoll() */ @@ -578,13 +588,13 @@ extern "C" { * * @return * F_none on success. - * F_data_not (with error bit) if string starts with a null (length is 0). - * F_parameter (with error bit) if a parameter is invalid. + * F_data_not if string starts with a null (length is 0). + * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. * F_number (with error bit) if parameter is not a number. * F_number_negative (with error bit) on negative value. * F_number_positive (with error bit) on positive value (has a +, such as '+1', when only '1' is valid here). * F_number_overflow (with error bit) on integer overflow. - * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. + * F_parameter (with error bit) if a parameter is invalid. * * @see strtoull() */ diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index e90d673..5a10089 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -12,11 +12,11 @@ extern "C" { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == ELOOP) return F_status_set_error(F_loop); if (errno == EMLINK) return F_status_set_error(F_directory_link_max); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOSPC) return F_status_set_error(F_space_not); @@ -39,20 +39,20 @@ extern "C" { if (mkdirat(at_id, path, mode) < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == ELOOP) return F_status_set_error(F_loop); if (errno == EMLINK) return F_status_set_error(F_directory_link_max); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOSPC) return F_status_set_error(F_space_not); if (errno == ENOTDIR) return F_status_set_error(F_directory); if (errno == EPERM) return F_status_set_error(F_prohibited); if (errno == EROFS) return F_status_set_error(F_read_only); - if (errno == EBADF) return F_status_set_error(F_directory_descriptor); return F_status_set_error(F_failure); } @@ -68,14 +68,14 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == ENOENT) return F_file_found_not; if (errno == ENOMEM) return F_status_set_error(F_memory_out); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ENOTDIR) return F_false; - if (errno == ENOENT) return F_file_found_not; - if (errno == EACCES) return F_status_set_error(F_access_denied); - if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); return F_status_set_error(F_file_stat); } @@ -93,15 +93,15 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (fstatat(at_id, path, &file_stat, flag) < 0) { - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == ENOENT) return F_file_found_not; if (errno == ENOMEM) return F_status_set_error(F_memory_out); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ENOTDIR) return F_false; - if (errno == ENOENT) return F_file_found_not; - if (errno == EACCES) return F_status_set_error(F_access_denied); - if (errno == ELOOP) return F_status_set_error(F_loop); - if (errno == EBADF) return F_status_set_error(F_directory_descriptor); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); return F_status_set_error(F_file_stat); } @@ -119,13 +119,13 @@ extern "C" { memset(&file_stat, AT_SYMLINK_NOFOLLOW, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == ENOENT) return F_file_found_not; if (errno == ENOMEM) return F_status_set_error(F_memory_out); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ENOTDIR) return F_false; - if (errno == ENOENT) return F_file_found_not; - if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ELOOP) return F_status_set_error(F_loop); return F_status_set_error(F_file_stat); @@ -144,15 +144,15 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (fstatat(at_id, path, &file_stat, flag) < 0) { - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == ENOENT) return F_file_found_not; if (errno == ENOMEM) return F_status_set_error(F_memory_out); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ENOTDIR) return F_false; - if (errno == ENOENT) return F_file_found_not; - if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == ELOOP) return F_status_set_error(F_loop); - if (errno == EBADF) return F_status_set_error(F_directory_descriptor); return F_status_set_error(F_file_stat); } @@ -234,17 +234,17 @@ extern "C" { if (*id < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == EINTR) return F_status_set_error(F_interrupted); if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == ENFILE) return F_status_set_error(F_file_open_max); if (errno == ENOENT) return F_status_set_error(F_directory_found_not); - if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory); if (errno == EPERM) return F_status_set_error(F_prohibited); if (errno == EROFS) return F_status_set_error(F_read_only); @@ -272,20 +272,20 @@ extern "C" { if (*id < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EBADF) return F_status_set_error(F_directory_descriptor); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == EINTR) return F_status_set_error(F_interrupted); if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == ENFILE) return F_status_set_error(F_file_open_max); if (errno == ENOENT) return F_status_set_error(F_directory_found_not); - if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory); if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory); if (errno == ENOSPC) return F_status_set_error(F_space_not); if (errno == EPERM) return F_status_set_error(F_prohibited); if (errno == EROFS) return F_status_set_error(F_read_only); - if (errno == EBADF) return F_status_set_error(F_directory_descriptor); return F_status_set_error(F_failure); } @@ -319,20 +319,20 @@ extern "C" { if (result < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == EIO) return F_status_set_error(F_input_output); if (errno == EISDIR) return F_status_set_error(F_file_type_directory); if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max); if (errno == ENAMETOOLONG) return F_status_set_error(F_name); - if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOTDIR) return F_status_set_error(F_directory); if (errno == EPERM) return F_status_set_error(F_prohibited); if (errno == EROFS) return F_status_set_error(F_read_only); if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); - if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max); - if (errno == ENFILE) return F_status_set_error(F_file_open_max); - if (errno == EINVAL) return F_status_set_error(F_parameter); return F_status_set_error(F_failure); } @@ -366,20 +366,20 @@ extern "C" { if (result < 0) { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == EIO) return F_status_set_error(F_input_output); if (errno == EISDIR) return F_status_set_error(F_file_type_directory); if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max); if (errno == ENAMETOOLONG) return F_status_set_error(F_name); - if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); if (errno == EPERM) return F_status_set_error(F_prohibited); if (errno == EROFS) return F_status_set_error(F_read_only); - if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); - if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max); - if (errno == ENFILE) return F_status_set_error(F_file_open_max); - if (errno == EINVAL) return F_status_set_error(F_parameter); return F_status_set_error(F_failure); } diff --git a/level_0/f_directory/c/directory.h b/level_0/f_directory/c/directory.h index 1a4075a..28092e5 100644 --- a/level_0/f_directory/c/directory.h +++ b/level_0/f_directory/c/directory.h @@ -107,20 +107,20 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_file_found (with error bit) of a directory aleady exists at the path. * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for removing. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. - * F_directory_link_max (with error bit) max links limit reached or exceeded. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_failure (with error bit) for any other (mkdir()) error. * * @see mkdir() */ @@ -140,21 +140,21 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_file_found (with error bit) of a directory aleady exists at the path. * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for removing. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. - * F_directory_link_max (with error bit) max links limit reached or exceeded. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_failure (with error bit) for any other (mkdirat()) error. * * @see mkdirat() */ @@ -169,14 +169,14 @@ extern "C" { * The path file name. * * @return - * F_true if path was found and path is a directory (or a symlink to a directory). * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_true if path was found and path is a directory (or a symlink to a directory). * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see stat() @@ -196,16 +196,16 @@ extern "C" { * Any valid flag, such as f_directory_at_path_empty, f_directory_at_automount_no, or f_directory_at_symlink_follow_no. * * @return - * F_true if path was found and path is a directory (or a symlink to a directory). * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_true if path was found and path is a directory (or a symlink to a directory). * F_access_denied (with error bit) if access to the file was denied. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * * @see fstatat() */ @@ -220,14 +220,14 @@ extern "C" { * The path file name. * * @return - * F_true if path was found and path is a directory. * F_false if path was found and path is not a directory (this includes symlinks). * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_true if path was found and path is a directory. * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see stat() @@ -247,16 +247,16 @@ extern "C" { * Any valid flag, such as f_directory_at_path_empty, f_directory_at_automount_no, or f_directory_at_symlink_follow_no. * * @return - * F_true if path was found and path is a directory. * F_false if path was found and path is not a directory. * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_true if path was found and path is a directory. * F_access_denied (with error bit) if access to the file was denied. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * * @see fstatat() */ @@ -283,10 +283,10 @@ extern "C" { * * @return * F_none on success. - * F_data_not if directory is empty (@fixme: unlikely due to '.' and '..' probably always being returned.). + * F_data_not if directory is empty. * F_failure (with error bit) if failed to read directory information. - * F_parameter (with error bit) if a parameter is invalid. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * * @see alphasort() * @see scandir() @@ -312,13 +312,26 @@ extern "C" { * * @return * F_none on success. + * F_access_denied (with error bit) on access denied. + * F_buffer (with error bit) if the buffer is invalid. + * F_directory_found_not (with error bit) if directory was not found. * F_failure (with error bit) if failed to read directory information. + * F_file_open_max (with error bit) too many open files. + * F_file_type_directory_not (with error bit) file is not a directory. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * * @see open() */ #ifndef _di_f_directory_open_ - extern f_return_status private_f_directory_open(const f_string path, const bool dereference, int *id) f_gcc_attribute_visibility_internal; + extern f_return_status f_directory_open(const f_string path, const bool dereference, int *id) f_gcc_attribute_visibility_internal; #endif // _di_f_directory_open_ /** @@ -339,13 +352,27 @@ extern "C" { * * @return * F_none on success. + * F_access_denied (with error bit) on access denied. + * F_buffer (with error bit) if the buffer is invalid. + * F_directory_found_not (with error bit) if directory was not found. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_failure (with error bit) if failed to read directory information. + * F_file_open_max (with error bit) too many open files. + * F_file_type_directory_not (with error bit) file is not a directory. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * * @see openat() */ #ifndef _di_f_directory_open_at_ - extern f_return_status private_f_directory_open_at(const int at_id, const f_string path, const bool dereference, int *id) f_gcc_attribute_visibility_internal; + extern f_return_status f_directory_open_at(const int at_id, const f_string path, const bool dereference, int *id) f_gcc_attribute_visibility_internal; #endif // _di_f_directory_open_at_ /** @@ -363,22 +390,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. - * F_input_output (with error bit) if an I/O error occurred. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_descriptor_max (with error bit) if max file descriptors was reached. + * F_file_found_not (with error bit) if file not found. + * F_file_open_max (with error bit) too many open files. * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_input_output (with error bit) if an I/O error occurred. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if file not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for removing. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (unlink()) error. * F_number_overflow (with error bit) on integer overflow. - * F_file_descriptor_max (with error bit) if max file descriptors was reached. - * F_file_open_max (with error bit) too many open files. + * F_failure (with error bit) for any other (remove()) error. * * @see nftw() * @see remove() @@ -405,19 +432,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. - * F_input_output (with error bit) if an I/O error occurred. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found_not (with error bit) if file not found. * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_input_output (with error bit) if an I/O error occurred. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if file not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for removing. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (unlink()) error. + * F_failure (with error bit) for any other (remove()) error. * * @see nftw() * @see remove() diff --git a/level_0/f_environment/c/environment.h b/level_0/f_environment/c/environment.h index 621889f..eda396c 100644 --- a/level_0/f_environment/c/environment.h +++ b/level_0/f_environment/c/environment.h @@ -61,8 +61,8 @@ extern "C" { * @return * F_none on success. * F_exist_not if name does not exist. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * * @see getenv() */ @@ -86,11 +86,11 @@ extern "C" { * * @return * F_none on success. - * F_exist_not if name does not exist. * F_data_not if name.used is 0. + * F_exist_not if name does not exist. + * F_memory_reallocation (with error bit) on memory reallocation error. * 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_memory_reallocation (with error bit) on memory reallocation error. * * @see getenv() */ @@ -145,9 +145,9 @@ extern "C" { * @return * F_none on success. * F_data_not if name.used is 0. - * F_parameter (with error bit) if a parameter is invalid. * F_invalid (with error bit) if name is an invalid string. * F_memory_out (with error bit) on out of memory. + * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * * @see setenv() @@ -188,8 +188,8 @@ extern "C" { * F_none on success. * F_invalid (with error bit) if name is an invalid string. * F_memory_out (with error bit) on out of memory. - * F_failure (with error bit) on any other error. * F_parameter (with error bit) if a parameter is invalid. + * F_failure (with error bit) on any other error. * * @see unsetenv() */ diff --git a/level_0/f_environment/c/private-environment.h b/level_0/f_environment/c/private-environment.h index a031ed8..f142126 100644 --- a/level_0/f_environment/c/private-environment.h +++ b/level_0/f_environment/c/private-environment.h @@ -31,8 +31,8 @@ extern "C" { * @return * F_none on success. * F_exist_not if name does not exist. - * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * * @see f_environment_get() * @see f_environment_get_dynamic() diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index c31843f..8cead21 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -287,14 +287,14 @@ extern "C" { * @return * F_true if file exists. * F_false if file does not exist. - * F_parameter (with error bit) if a parameter is invalid. - * F_name (with error bit) if the filename is too long. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. - * F_directory (with error bit) on invalid directory. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. * F_false (with error bit) on unknown/unhandled errors. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the filename is too long. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * * @see access() */ @@ -315,17 +315,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. - * F_loop (with error bit) on loop error. + * F_access_mode (with error bit) if the current user does not have access to assign the file mode. + * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (mkdir()) error. + * F_failure (with error bit) for any other error. * * @see chmod() */ @@ -348,17 +348,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. - * F_loop (with error bit) on loop error. + * F_access_mode (with error bit) if the current user does not have access to assign the file mode. * F_file_found_not (with error bit) if file at path was not found. - * F_memory_out (with error bit) if out of memory. * F_directory (with error bit) on invalid directory. - * F_prohibited (with error bit) if filesystem does not allow for file changes. - * F_read_only (with error bit) if file is read-only. * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (mkdir()) error. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other error. * * @see fchmodat() */ @@ -381,19 +381,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. + * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. * F_buffer (with error bit) if the buffer is invalid. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. - * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (chown() or lchown()) error. + * F_failure (with error bit) for any other error. * * @see chown() * @see lchown() @@ -418,20 +418,20 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. + * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. * F_buffer (with error bit) if the buffer is invalid. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. - * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (chown() or lchown()) error. + * F_failure (with error bit) for any other error. * * @see fchownat() */ @@ -449,9 +449,6 @@ extern "C" { * * This does not copy unknown file types. * - * @todo provide a return status for when owner/role cannot be assigned. - * This will be returned when complete so that caller can decide if this is an error or not. - * * @param source * The path to the file to copy from. * @param destination @@ -469,26 +466,28 @@ extern "C" { * * @return * F_none on success. - * F_unsupported if copying a given type of file is unsupported. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. - * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. + * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_access_mode (with error bit) if the current user does not have access to assign the file mode. + * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. * F_file_write (with error bit) on file write error. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_unsupported if copying a given type of file is unsupported. + * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_clone_ extern f_return_status f_file_clone(const f_string source, const f_string destination, const bool role, const f_number_unsigned size_block, const bool exclusive); @@ -504,14 +503,14 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_file_close (with error bit) if fclose() failed for any other reason. * F_file_descriptor (with error bit) if file descriptor is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. + * F_file_synchronize (with error bit) on flush failure. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_parameter (with error bit) if a parameter is invalid. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_synchronize (with error bit) on flush failure. - * F_file_close (with error bit) if fclose() failed for any other reason. * * @see fclose() */ @@ -547,26 +546,25 @@ extern "C" { * * @return * F_none on success. - * F_unsupported if copying a given type of file is unsupported. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. - * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. * F_file_write (with error bit) on file write error. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_unsupported if copying a given type of file is unsupported. + * F_failure (with error bit) for any other error. */ #ifndef _di_f_file_copy_ extern f_return_status f_file_copy(const f_string source, const f_string destination, const f_mode mode, const f_number_unsigned size_block, const bool exclusive); @@ -587,23 +585,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. + * F_file_open_max (with error bit) when system-wide max open files is reached. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * * @see open() */ @@ -628,23 +625,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. + * F_file_open_max (with error bit) when system-wide max open files is reached. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * * @see openat() */ @@ -670,19 +666,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. + * F_failure (with error bit) for any other error. * * @see makedev() * @see mknod() @@ -711,20 +706,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_failure (with error bit) for any other error. * * @see makedev() * @see mknodat() @@ -743,19 +737,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or ififos are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. + * F_failure (with error bit) for any other error. * * @see mkfifo() */ @@ -775,20 +768,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or ififos are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_failure (with error bit) for any other error. * * @see mkfifoat() */ @@ -809,19 +801,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. + * F_failure (with error bit) for any other error. * * @see mknod() */ @@ -844,20 +835,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * F_unsupported (with error bit) for unsupported file types. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * * @see mknodat() */ @@ -875,14 +865,14 @@ extern "C" { * The path file name. * * @return - * F_true if path was found. * F_false if path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. - * F_directory (with error bit) on invalid directory. + * F_true if path was found. * F_access_denied (with error bit) if access to the file was denied. + * F_directory (with error bit) on invalid directory. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see stat() @@ -905,16 +895,16 @@ extern "C" { * Any valid flag, such as f_file_at_path_empty, f_file_at_automount_no, or f_file_at_symlink_follow_no. * * @return - * F_true if file exists. * F_false if file does not exist. - * F_parameter (with error bit) if a parameter is invalid. - * F_name (with error bit) if the filename is too long. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. - * F_directory (with error bit) on invalid directory. + * F_true if file exists. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. * F_false (with error bit) on unknown/unhandled errors. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the filename is too long. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() */ @@ -930,10 +920,10 @@ extern "C" { * * @return * F_none is returned on success. - * F_parameter (with error bit) if a parameter is invalid. * F_file_descriptor (with error bit) if file descriptor is invalid. - * F_input_output (with error bit) on I/O error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_input_output (with error bit) on I/O error. + * F_parameter (with error bit) if a parameter is invalid. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) if the file system or file type does not support flushing. * F_failure (with error bit) on any other failure. @@ -956,15 +946,15 @@ extern "C" { * The type of the file * * @return - * F_true if path was found and path is type. * F_false if path was found and path is not type. * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. - * F_directory (with error bit) on invalid directory. + * F_true if path was found and path is type. * F_access_denied (with error bit) if access to the file was denied. + * F_directory (with error bit) on invalid directory. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see stat() @@ -986,15 +976,15 @@ extern "C" { * Any valid flag, such as f_file_at_path_empty, f_file_at_automount_no, or f_file_at_symlink_follow_no. * * @return - * F_true if path was found and path is type. * F_false if path was found and path is not type. * F_file_found_not if the path was not found. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. - * F_directory (with error bit) on invalid directory. + * F_true if path was found and path is type. * F_access_denied (with error bit) if access to the file was denied. + * F_directory (with error bit) on invalid directory. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() @@ -1017,8 +1007,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to store in the buffer. * * @see basename() @@ -1041,8 +1031,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if string is too large to store in the buffer. * * @see dirname() @@ -1064,22 +1054,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_found (with error bit) if a file aleady exists at the path. * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_failure (with error bit) for any other (symlink()) error. + * F_failure (with error bit) for any other error. * * @see symlink() */ @@ -1102,23 +1092,23 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found (with error bit) if a file aleady exists at the path. + * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (symlinkat()) error. + * F_failure (with error bit) for any other error. * * @see symlinkat() */ @@ -1138,22 +1128,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found (with error bit) if a file aleady exists at the path. + * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_failure (with error bit) for any other (link()) error. + * F_failure (with error bit) for any other error. * * @see link() */ @@ -1179,23 +1169,23 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found (with error bit) if a file aleady exists at the path. + * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (linkat()) error. + * F_failure (with error bit) for any other error. * * @see linkat() */ @@ -1219,17 +1209,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found_not (with error bit) if the file at path was not found. * F_input_output (with error bit) on I/O error. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if the file at path was not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_failure (with error bit) for any other (readlink()) error. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if link target path is too large for string buffer size. + * F_failure (with error bit) for any other error. * * @see readlink() */ @@ -1255,18 +1245,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found_not (with error bit) if the file at path was not found. * F_input_output (with error bit) on I/O error. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if the file at path was not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (readlinkat()) error. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if link target path is too large for string buffer size. + * F_failure (with error bit) for any other error. * * @see readlinkat() */ @@ -1290,9 +1280,9 @@ extern "C" { * * @return * F_none on success. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). * F_file_found_not (with error bit) if the file was not found. * F_file_open (with error bit) if the file is already open. - * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). * F_parameter (with error bit) if a parameter is invalid. * * @see open() @@ -1319,9 +1309,9 @@ extern "C" { * * @return * F_none on success. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found_not (with error bit) if the file was not found. * F_file_open (with error bit) if the file is already open. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_parameter (with error bit) if a parameter is invalid. * * @see openat() @@ -1345,15 +1335,15 @@ extern "C" { * @return * F_none on success. * F_none_eof on success and EOF was reached. - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see read() */ @@ -1376,15 +1366,15 @@ extern "C" { * @return * F_none on success. * F_none_eof on success and EOF was reached. - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see read() */ @@ -1408,15 +1398,15 @@ extern "C" { * @return * F_none on success. * F_none_eof on success and EOF was reached. - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see read() */ @@ -1432,19 +1422,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. - * F_input_output (with error bit) if an I/O error occurred. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found_not (with error bit) if file not found. * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_input_output (with error bit) if an I/O error occurred. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if file not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (unlink()) error. + * F_failure (with error bit) for any other error. * * @see unlink() */ @@ -1464,19 +1454,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. * F_busy (with error bit) if file is busy. - * F_input_output (with error bit) if an I/O error occurred. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found_not (with error bit) if file not found. * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_input_output (with error bit) if an I/O error occurred. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if file not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (unlink()) error. + * F_failure (with error bit) for any other error. * * @see unlinkat() */ @@ -1485,7 +1475,7 @@ extern "C" { #endif // _di_f_file_remove_at_ /** - * Given an open file descriptor, seek + * Given an open file descriptor, seek to a given location. * * @param id * The file descriptor. @@ -1499,11 +1489,11 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_bound_out (with error bit) if SEEK_DATA or SEEK_HOLE is specified as whence and offset is beyond the end of file. - * F_number_overflow (with error bit) on overflow for offset. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_pipe (with error bit) if file descriptor represents a pipe, socket, or FIFO. + * F_number_overflow (with error bit) on overflow for offset. + * F_parameter (with error bit) if a parameter is invalid. * F_failure (with error bit) on any other error. * * @see lseek @@ -1525,13 +1515,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat() @@ -1555,13 +1545,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat_at() @@ -1580,13 +1570,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat_by_id() @@ -1608,13 +1598,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see stat() @@ -1637,13 +1627,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() @@ -1662,13 +1652,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see fstat() @@ -1692,15 +1682,15 @@ extern "C" { * @return * F_none on success. * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see write() */ @@ -1723,24 +1713,24 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_buffer (with error bit) if the buffer is invalid. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found (with error bit) if a file aleady exists at the path. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. * F_search (with error bit) if search permission is denied for one of the paths to the file. - * F_memory_out (with error bit) if out of memory. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_failure (with error bit) for any other error. * * @see utimensat() @@ -1765,24 +1755,24 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_buffer (with error bit) if the buffer is invalid. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found (with error bit) if a file aleady exists at the path (when calling utimensat()). + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_file_found (with error bit) if a file aleady exists at the path (when calling utimensat()). - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. * F_search (with error bit) if search permission is denied for one of the paths to the file. - * F_memory_out (with error bit) if out of memory. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_failure (with error bit) for any other error. * * @see utimensat() @@ -1808,15 +1798,15 @@ extern "C" { * @return * F_none on success. * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see write() */ @@ -1842,15 +1832,15 @@ extern "C" { * F_none on success. * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see write() */ @@ -1876,15 +1866,15 @@ extern "C" { * F_none on success. * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see write() */ diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index 482610b..01eda4b 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -16,7 +16,7 @@ extern "C" { if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOTDIR) return F_status_set_error(F_directory); - if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EPERM) return F_status_set_error(F_access_mode); if (errno == EROFS) return F_status_set_error(F_read_only); if (errno == EIO) return F_status_set_error(F_input_output); @@ -39,7 +39,7 @@ extern "C" { if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOTDIR) return F_status_set_error(F_directory); if (errno == EBADF) return F_status_set_error(F_directory_descriptor); - if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EPERM) return F_status_set_error(F_access_mode); if (errno == EROFS) return F_status_set_error(F_read_only); if (errno == EIO) return F_status_set_error(F_input_output); @@ -64,7 +64,7 @@ extern "C" { if (result == 0 && gid != -1) { result = chown(path, -1, gid); - if (errno == EPERM) return F_status_set_error(F_access_group); + if (result < 0 && errno == EPERM) return F_status_set_error(F_access_group); } } else { @@ -286,11 +286,11 @@ extern "C" { if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block); if (errno == EEXIST) return F_status_set_error(F_file_found); - if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == EINVAL) return F_status_set_error(F_parameter); if (errno == ELOOP) return F_status_set_error(F_loop); if (errno == EMLINK) return F_status_set_error(F_directory_link_max); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); if (errno == ENOENT) return F_status_set_error(F_file_found_not); if (errno == ENOMEM) return F_status_set_error(F_memory_out); if (errno == ENOSPC) return F_status_set_error(F_space_not); diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 023e83f..a2e4510 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -27,17 +27,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. - * F_loop (with error bit) on loop error. + * F_access_mode (with error bit) if the current user does not have access to assign the file mode. + * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (mkdir()) error. + * F_failure (with error bit) for any other error. * * @see f_file_change_mode() * @see f_file_copy() @@ -60,17 +60,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. - * F_loop (with error bit) on loop error. + * F_access_mode (with error bit) if the current user does not have access to assign the file mode. * F_file_found_not (with error bit) if file at path was not found. - * F_memory_out (with error bit) if out of memory. * F_directory (with error bit) on invalid directory. - * F_prohibited (with error bit) if filesystem does not allow for file changes. - * F_read_only (with error bit) if file is read-only. * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (mkdir()) error. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other error. * * @see f_file_change_mode_at() */ @@ -95,20 +95,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. + * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. * F_buffer (with error bit) if the buffer is invalid. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. - * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_failure (with error bit) for any other (chown() or lchown()) error. - * + * F_failure (with error bit) for any other error. * * @see f_file_change_owner() * @see f_file_copy() @@ -135,20 +134,20 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_name (with error bit) if the filename is too long. + * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. * F_buffer (with error bit) if the buffer is invalid. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) on invalid directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found_not (with error bit) if file at path was not found. + * F_input_output (with error bit) on I/O error. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) on invalid directory. - * F_access_owner (with error bit) if the current user does not have access to assign the specified owner. - * F_access_group (with error bit) if the current user does not have access to assign the specified group. + * F_name (with error bit) if the filename is too long. + * F_parameter (with error bit) if a parameter is invalid. * F_read_only (with error bit) if file is read-only. - * F_input_output (with error bit) on I/O error. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (chown() or lchown()) error. + * F_failure (with error bit) for any other error. * * @see f_file_change_owner_at() */ @@ -166,14 +165,14 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_file_close (with error bit) if fclose() failed for any other reason. * F_file_descriptor (with error bit) if file descriptor is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. * F_file_synchronize (with error bit) on flush failure. - * F_file_close (with error bit) if fclose() failed for any other reason. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_parameter (with error bit) if a parameter is invalid. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * * @see f_file_close() * @see f_file_copy() @@ -203,25 +202,25 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. - * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. * F_file_write (with error bit) on file write error. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_unsupported if copying a given type of file is unsupported. + * F_failure (with error bit) for any other error. * * @see f_file_copy() * @see f_file_clone() @@ -249,23 +248,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. + * F_file_open_max (with error bit) when system-wide max open files is reached. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * * @see f_file_copy() * @see f_file_create() @@ -295,23 +293,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. + * F_file_open_max (with error bit) when system-wide max open files is reached. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_file_open_max (with error bit) when system-wide max open files is reached. - * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_read_only (with error bit) if file is read-only. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * * @see f_file_create_at() */ @@ -331,20 +328,21 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. + * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_file_found_not (with error bit) if file at path was not found. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. - * F_directory_link_max (with error bit) max links limit reached or exceeded. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_failure (with error bit) for any other error. * * @see f_file_copy() * @see mkdir() @@ -367,20 +365,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. + * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_file_found_not (with error bit) if file at path was not found. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. * F_read_only (with error bit) if file is read-only. - * F_failure (with error bit) for any other (mkdir()) error. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. - * F_name (with error bit) on path name error. - * F_directory_link_max (with error bit) max links limit reached or exceeded. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_failure (with error bit) for any other error. * * @see mkdirat() */ @@ -398,17 +398,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or ififos are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. + * F_failure (with error bit) for any other error. * * @see mkfifo() */ @@ -428,18 +429,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or ififos are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_failure (with error bit) for any other error. * * @see mkfifoat() */ @@ -465,19 +467,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) for unsupported file types. + * F_failure (with error bit) for any other error. * * @see f_file_create_device() * @see f_file_create_node() @@ -506,20 +507,19 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_loop (with error bit) on loop error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found (with error bit) if a file was found while exclusive is TRUE. - * F_memory_out (with error bit) if out of memory. - * F_prohibited (with error bit) if filesystem does not allow for removing. - * F_failure (with error bit) for any other (mknod()) error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). - * F_file_found (with error bit) of a directory aleady exists at the path. + * F_loop (with error bit) on loop error. + * F_memory_out (with error bit) if out of memory. * F_name (with error bit) on path name error. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_parameter (with error bit) if a parameter is invalid. + * F_prohibited (with error bit) if filesystem does not allow for making changes. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_failure (with error bit) for any other error. * F_unsupported (with error bit) for unsupported file types. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * * @see f_file_create_device_at() * @see f_file_create_node_at() @@ -538,10 +538,10 @@ extern "C" { * * @return * F_none is returned on success. - * F_parameter (with error bit) if a parameter is invalid. * F_file_descriptor (with error bit) if file descriptor is invalid. - * F_input_output (with error bit) on I/O error. * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_input_output (with error bit) on I/O error. + * F_parameter (with error bit) if a parameter is invalid. * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_unsupported (with error bit) if the file system or file type does not support flushing. * F_failure (with error bit) on any other failure. @@ -566,22 +566,22 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_found (with error bit) if a file aleady exists at the path. * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_failure (with error bit) for any other (symlink()) error. + * F_failure (with error bit) for any other error. * * @see f_file_copy() * @see f_file_link() @@ -604,23 +604,23 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_access_denied (with error bit) on access denied. - * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. - * F_file_found (with error bit) if a file aleady exists at the path. - * F_name (with error bit) on path name error. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_buffer (with error bit) if the buffer is invalid. - * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. - * F_loop (with error bit) on loop error. - * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found (with error bit) if a file aleady exists at the path. + * F_file_found_not (with error bit) if a parent path in point does not exist or is a broken symlink. + * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. + * F_loop (with error bit) on loop error. * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) on path name error. + * F_number_overflow (with error bit) on overflow error. + * F_parameter (with error bit) if a parameter is invalid. * F_prohibited (with error bit) if filesystem does not allow for creating or linking. * F_read_only (with error bit) if filesystem is read-only. - * F_busy (with error bit) if filesystem is too busy to perforrm write. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (symlink()) error. + * F_failure (with error bit) for any other error. * * @see f_file_link_at() */ @@ -643,17 +643,17 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_file_found_not (with error bit) if the file at path was not found. * F_input_output (with error bit) on I/O error. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if the file at path was not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_failure (with error bit) for any other (readlink()) error. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if link target path is too large for string buffer size. + * F_failure (with error bit) for any other error. * * @see f_file_link_read() */ @@ -678,18 +678,18 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. - * F_string_too_large (with error bit) if link target path is too large for string buffer size. * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. + * F_file_found_not (with error bit) if the file at path was not found. * F_input_output (with error bit) on I/O error. * F_loop (with error bit) on loop error. - * F_name (with error bit) on path name error. - * F_file_found_not (with error bit) if the file at path was not found. * F_memory_out (with error bit) if out of memory. - * F_directory (with error bit) if a supposed directory in path is not actually a directory. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. - * F_failure (with error bit) for any other (readlinkat()) error. + * F_name (with error bit) on path name error. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if link target path is too large for string buffer size. + * F_failure (with error bit) for any other error. * * @see f_file_link_read_at() */ @@ -713,9 +713,9 @@ extern "C" { * * @return * F_none on success. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). * F_file_found_not (with error bit) if the file was not found. * F_file_open (with error bit) if the file is already open. - * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy() @@ -743,9 +743,9 @@ extern "C" { * * @return * F_none on success. + * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_file_found_not (with error bit) if the file was not found. * F_file_open (with error bit) if the file is already open. - * F_directory_descriptor (with error bit) for bad directory descriptor for at_id. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_open_at() @@ -769,13 +769,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy() @@ -803,13 +803,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat_at() @@ -832,13 +832,13 @@ extern "C" { * * @return * F_none on success. - * F_name (with error bit) if the name is somehow invalid. - * F_memory_out (with error bit) if out of memory. - * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. * F_directory (with error bit) on invalid directory. * F_file_found_not (with error bit) if the file was not found. - * F_access_denied (with error bit) if access to the file was denied. * F_loop (with error bit) if a loop occurred. + * F_memory_out (with error bit) if out of memory. + * F_name (with error bit) if the name is somehow invalid. + * F_number_overflow (with error bit) on overflow error. * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_size_by_id() @@ -866,15 +866,15 @@ extern "C" { * @return * F_none on success. * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * F_parameter (with error bit) if a parameter is invalid. * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_buffer (with error bit) if the buffer is invalid. - * F_interrupted (with error bit) if interrupt was received. - * F_input_output (with error bit) on I/O error. + * F_file (with error bit) if file descriptor is in an error state. * F_file_closed (with error bit) if file is not open. + * F_file_descriptor (with error bit) if the file descriptor is invalid. * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_input_output (with error bit) on I/O error. + * F_interrupted (with error bit) if interrupt was received. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_write() * @see f_file_write_range() diff --git a/level_0/f_path/c/path.h b/level_0/f_path/c/path.h index 345e77d..b6a70a3 100644 --- a/level_0/f_path/c/path.h +++ b/level_0/f_path/c/path.h @@ -76,10 +76,10 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. * F_memory_reallocation (with error bit) on reallocation error. * F_memory_allocation (with error bit) on allocation error. - * F_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_path_explode_ extern f_return_status f_path_explode(const f_string path, f_string_dynamics *paths); @@ -100,10 +100,10 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. * F_memory_reallocation (with error bit) on reallocation error. * F_memory_allocation (with error bit) on allocation error. - * F_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_path_explode_dynamic_ extern f_return_status f_path_explode_dynamic(const f_string_static path, f_string_dynamics *paths); @@ -126,10 +126,10 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. * F_memory_reallocation (with error bit) on reallocation error. * F_memory_allocation (with error bit) on allocation error. - * F_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_path_explode_reverse_ extern f_return_status f_path_explode_reverse(const f_string path, f_string_dynamics *paths); @@ -152,10 +152,10 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. * F_memory_reallocation (with error bit) on reallocation error. * F_memory_allocation (with error bit) on allocation error. - * F_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_path_explode_reverse_dynamic_ extern f_return_status f_path_explode_reverse_dynamic(const f_string_static path, f_string_dynamics *paths); diff --git a/level_0/f_path/c/path_fll.h b/level_0/f_path/c/path_fll.h index b9c20e8..7552517 100644 --- a/level_0/f_path/c/path_fll.h +++ b/level_0/f_path/c/path_fll.h @@ -8,7 +8,7 @@ * Provide locations to all fll-specific paths * It is planned to have this file auto-generated from a single /etc/fll file such that one file can be used for all supported languages. * - * FIXME: this is very outdated due to numerous structural changes while I was developing turtle kevux. + * @fixme this is very outdated due to numerous structural changes while I was developing turtle kevux. */ #ifndef _F_path_fll_h #define _F_path_fll_h diff --git a/level_0/f_pipe/c/pipe.h b/level_0/f_pipe/c/pipe.h index d83f4b3..e65a8d7 100644 --- a/level_0/f_pipe/c/pipe.h +++ b/level_0/f_pipe/c/pipe.h @@ -28,8 +28,8 @@ extern "C" { * Identify whether or not the standard input pipe source contains piped data. * * @return - * F_true if there is piped data. * F_false if there is no piped data. + * F_true if there is piped data. * F_file_stat (with error bit) on stat() error. * * @see fstat() @@ -44,8 +44,8 @@ extern "C" { * For most systems, standard warning does not exist and instead maps to standard output. * * @return - * F_true if there is piped data. * F_false if there is no piped data. + * F_true if there is piped data. * F_file_stat (with error bit) on stat() error. * * @see fstat() @@ -58,8 +58,8 @@ extern "C" { * Identify whether or not the standard error pipe source contains piped data. * * @return - * F_true if there is piped data. * F_false if there is no piped data. + * F_true if there is piped data. * F_file_stat (with error bit) on stat() error. * * @see fstat() @@ -74,8 +74,8 @@ extern "C" { * For most systems, standard debug does not exist and instead maps to standard output. * * @return - * F_true if there is piped data. * F_false if there is no piped data. + * F_true if there is piped data. * F_file_stat (with error bit) on stat() error. * * @see fstat() diff --git a/level_0/f_utf/c/private-utf.h b/level_0/f_utf/c/private-utf.h index de4f7a8..b696eb1 100644 --- a/level_0/f_utf/c/private-utf.h +++ b/level_0/f_utf/c/private-utf.h @@ -140,8 +140,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_valid() @@ -160,8 +160,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 whitespace. * F_false if not a UTF-8 whitespace. + * F_true if a UTF-8 whitespace. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_whitespace() @@ -228,8 +228,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -249,8 +249,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 non-printing or zero-width character. * F_false if not a UTF-8 non-printing or zero-width character. + * F_true if a UTF-8 non-printing or zero-width character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_zero_width() diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 390b867..20c50bb 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -578,8 +578,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_valid() @@ -598,8 +598,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 alphabet character. * F_false if not a UTF-8 alphabet character. + * F_true if a UTF-8 alphabet character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -618,8 +618,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 alpha-numeric character. * F_false if not a UTF-8 alpha-numeric character. + * F_true if a UTF-8 alpha-numeric character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -636,8 +636,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -656,8 +656,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 control picture character. * F_false if not a UTF-8 control picture character. + * F_true if a UTF-8 control picture character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_control_picture() @@ -678,8 +678,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is() @@ -697,8 +697,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 graph. * F_false if not a UTF-8 graph. + * F_true if a UTF-8 graph. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see isgraph() @@ -717,8 +717,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 numeric character. * F_false if not a UTF-8 numeric character. + * F_true if a UTF-8 numeric character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -742,8 +742,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is() @@ -764,8 +764,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 whitespace. * F_false if not a UTF-8 whitespace. + * F_true if a UTF-8 whitespace. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_whitespace() @@ -785,8 +785,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 word character. * F_false if not a UTF-8 word character. + * F_true if a UTF-8 word character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -807,8 +807,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 word or dash character. * F_false if not a UTF-8 word or dash character. + * F_true if a UTF-8 word or dash character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -829,8 +829,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 word or dash character. * F_false if not a UTF-8 word or dash character. + * F_true if a UTF-8 word or dash character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -849,8 +849,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 non-printing or zero-width character. * F_false if not a UTF-8 non-printing or zero-width character. + * F_true if a UTF-8 non-printing or zero-width character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_zero_width() @@ -870,8 +870,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 alpha character. * F_false if not a UTF-8 alpha character. + * F_true if a UTF-8 alpha character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -900,9 +900,9 @@ extern "C" { * @return * F_none if conversion was successful. * F_failure (with error bit) if width is not long enough to convert. - * F_utf (with error bit) if character is an invalid UTF-8 character. * F_parameter (with error bit) if a parameter is invalid. * F_memory_allocation (with error bit) on memory allocation error. + * F_utf (with error bit) if character is an invalid UTF-8 character. * F_failure (with error bit) if width is not long enough to convert. */ #ifndef _di_f_utf_character_to_char_ @@ -915,8 +915,8 @@ extern "C" { * @todo relocate this outside of f_utf into a more general path, perhaps f_memory (f_memory_is_big_endian). * * @return - * F_true if the system is big-endian. * F_false if the system is little-endian. + * F_true if the system is big-endian. */ #ifndef _di_f_utf_is_big_endian_ extern f_return_status f_utf_is_big_endian(); @@ -935,8 +935,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_parameter (with error bit) if a parameter is invalid. * @@ -960,8 +960,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 alphabet character. * F_false if not a UTF-8 alphabet character. + * F_true if a UTF-8 alphabet character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -984,8 +984,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 alpha-numeric character. * F_false if not a UTF-8 alpha-numeric character. + * F_true if a UTF-8 alpha-numeric character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1006,8 +1006,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1030,8 +1030,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 control picture character. * F_false if not a UTF-8 control picture character. + * F_true if a UTF-8 control picture character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see f_utf_character_is_control_picture() @@ -1067,8 +1067,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 character. * F_false if not a UTF-8 character. + * F_true if a UTF-8 character. * * @see f_utf_character_is() * @see f_utf_character_is_valid() @@ -1089,10 +1089,10 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 graph. * F_false if not a UTF-8 graph. - * F_maybe (with error bit) if this could be a graph but width is not long enough. + * F_true if a UTF-8 graph. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_maybe (with error bit) if this could be a graph but width is not long enough. * F_parameter (with error bit) if a parameter is invalid. * * @see isgraph() @@ -1116,8 +1116,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 numeric character. * F_false if not a UTF-8 numeric character. + * F_true if a UTF-8 numeric character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1144,8 +1144,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a valid UTF-8 character. * F_false if not a valid UTF-8 character. + * F_true if a valid UTF-8 character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * F_parameter (with error bit) if a parameter is invalid. * @@ -1168,10 +1168,10 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 whitespace. * F_false if not a UTF-8 whitespace. - * F_maybe (with error bit) if this could be a whitespace but width is not long enough. + * F_true if a UTF-8 whitespace. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_maybe (with error bit) if this could be a whitespace but width is not long enough. * F_parameter (with error bit) if a parameter is invalid. * * @see isspace() @@ -1197,8 +1197,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 word character. * F_false if not a UTF-8 word character. + * F_true if a UTF-8 word character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1223,8 +1223,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 word or dash character. * F_false if not a UTF-8 word or dash character. + * F_true if a UTF-8 word or dash character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1249,8 +1249,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 word or dash character. * F_false if not a UTF-8 word or dash character. + * F_true if a UTF-8 word or dash character. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() @@ -1273,10 +1273,10 @@ extern "C" { * Can be anything greater than 0. * * @return - * F_true if a UTF-8 whitespace. * F_false if not a UTF-8 whitespace. - * F_maybe (with error bit) if this could be a whitespace but width is not long enough. + * F_true if a UTF-8 whitespace. * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_maybe (with error bit) if this could be a whitespace but width is not long enough. * F_parameter (with error bit) if a parameter is invalid. * * @see isspace() @@ -1303,8 +1303,8 @@ extern "C" { * @return * F_none if conversion was successful. * F_failure (with error bit) if width is not long enough to convert. - * F_utf (with error bit) if character is an invalid UTF-8 character. * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. */ #ifndef _di_f_utf_char_to_character_ extern f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf); diff --git a/level_1/fl_color/c/color.h b/level_1/fl_color/c/color.h index d2d4145..b321c43 100644 --- a/level_1/fl_color/c/color.h +++ b/level_1/fl_color/c/color.h @@ -179,8 +179,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_save_ extern f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5); @@ -212,8 +212,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_output (with error bit) on output error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_print_ extern f_return_status fl_color_print(FILE *file, const f_string_static start_color, const f_string_static end_color, const int8_t *string, ...); @@ -244,8 +244,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_output (with error bit) on output error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_print2_ extern f_return_status fl_color_print2(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...); @@ -271,8 +271,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_output (with error bit) on output error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_print_line_ extern f_return_status fl_color_print_line(FILE *file, const f_string_static start_color, const f_string_static end_color, const int8_t *string, ...); @@ -303,8 +303,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_output (with error bit) on output error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_print2_line_ extern f_return_status fl_color_print2_line(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...); @@ -322,8 +322,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_output (with error bit) on output error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_print_code_ extern f_return_status fl_color_print_code(FILE *file, const f_string_static color); @@ -343,8 +343,8 @@ extern "C" { * * @return * F_none on success. - * F_parameter (with error bit) if a parameter is invalid. * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_load_context_ extern f_return_status fl_color_load_context(fl_color_context *context, const bool use_light_colors); diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index de61f9a..818d47d 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -161,8 +161,8 @@ extern "C" { if (argument == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f - if (argument[0] == '\0') { - return F_status_set_error(F_data_not); + if (argument[0] == 0) { + return F_data_not; } f_string_range range = f_string_range_initialize; @@ -179,8 +179,8 @@ extern "C" { if (argument == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f - if (argument[0] == '\0') { - return F_status_set_error(F_data_not); + if (argument[0] == 0) { + return F_data_not; } f_string_range range = f_string_range_initialize; diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index 643477e..de51898 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -79,12 +79,12 @@ extern "C" { * * @return * F_none on success. - * F_data_not (with error bit) if string starts wth a null (length is 0). - * F_parameter (with error bit) if a parameter is invalid. + * F_data_not if string starts wth a null (length is 0). * F_number (with error bit) if parameter is not a number. * F_number_overflow (with error bit) on integer overflow. * F_number_underflow (with error bit) on integer underflow. * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_conversion_string_to_number_signed() */ @@ -114,12 +114,12 @@ extern "C" { * * @return * F_none on success. - * F_data_not (with error bit) if string starts wth a null (length is 0). - * F_parameter (with error bit) if a parameter is invalid. + * F_data_not if string starts wth a null (length is 0). * F_number (with error bit) if parameter is not a number. * F_number_negative (with error bit) on negative value. * F_number_overflow (with error bit) on integer overflow. * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_conversion_string_to_number_unsigned() */ diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index fdb489d..8877690 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -99,7 +99,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -168,7 +168,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -233,7 +233,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -300,7 +300,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index 7df04b1..cd2d09c 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -60,7 +60,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -121,7 +121,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -177,7 +177,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. @@ -236,7 +236,7 @@ extern "C" { * F_name (with error bit) on path name error. * F_directory (with error bit) if a supposed directory in path is not actually a directory. * F_number_overflow (with error bit) on overflow error. - * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_interrupted (with error bit) when program received an interrupt signal, halting operation. * F_file_open_max (with error bit) when system-wide max open files is reached. * F_busy (with error bit) if filesystem is too busy to perforrm write. * F_file_read (with error bit) on file read error. diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index 1529b80..60ddf35 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -48,7 +48,7 @@ extern "C" { register f_string_length i = 0; if (buffer.used < 10) { - // "# fss-0000" is always 10 characters. + // "# fss-0000" is always at least 10 characters. return FL_fss_header_not; } @@ -84,27 +84,28 @@ extern "C" { if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - f_string_range length = f_string_range_initialize; + f_string_range range = f_string_range_initialize; - length.start = i - 4; - length.stop = i; + range.start = i - 4; + range.stop = i; - // 1: A possibly valid header type was found, now convert it into its proper format and save the header type - f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, length); + // 1: A possibly valid header type was found, now convert it into its proper format and save the header type. + f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + if (F_status_is_error(status)) return status; - // 2: At this point, we can still know the proper format for the file and still have a invalid header, handle accordingly - if (buffer.string[i] == f_fss_type_header_close) { - i++; - header->length = i; + if (status == F_none) { + // 2: At this point, we can still know the proper format for the file and still have a invalid header, handle accordingly. + if (buffer.string[i] == f_fss_type_header_close) { + header->length = i + 1; - return F_none; - } - else { - // if "# fss-0000" is there, regardless of whats next, we can guess this to be of fss-0000, even if its fss-00001 (this is a guess afterall) - i++; - header->length = i; + return F_none; + } + else { + // if "# fss-0000" is there, regardless of whats next, we can guess this to be of fss-0000, even if its fss-00001 (this is a guess afterall). + header->length = i + 1; - return F_status_is_warning(FL_fss_accepted_invalid); + return F_status_is_warning(FL_fss_accepted_invalid); + } } } } @@ -115,7 +116,7 @@ extern "C" { } } } - // people can miss spaces, so lets accept in an attempt to interpret the file anyway, but return values at this point are to be flagged as invalid + // people can miss spaces, so lets accept in an attempt to interpret the file anyway, but return values at this point are to be flagged as invalid. else if (buffer.string[i] == f_fss_type_header_part2) { i++; @@ -140,12 +141,13 @@ extern "C" { if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - f_string_range length = f_string_range_initialize; + f_string_range range = f_string_range_initialize; - length.start = i - 4; - length.stop = i; + range.start = i - 4; + range.stop = i; - f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, length); + f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + if (F_status_is_error(status)) return status; header->length = i + 1; @@ -160,8 +162,8 @@ extern "C" { } } - // TODO: At some point add checksum and compressions checks here, but the above statements will have to be adjusted accordingly - // 3: eventually this will be processing the checksum and 4: will be processing the compression + // @todo At some point add checksum and compressions checks here, but the above statements will have to be adjusted accordingly. + // 3: eventually this will be processing the checksum and 4: will be processing the compression. return FL_fss_header_not; } @@ -252,7 +254,6 @@ extern "C" { width_max = buffer.used - range.start; } - // @todo update to check against zero-width space. return f_utf_is_graph(buffer.string + range.start, width_max); } #endif // _di_fl_fss_is_graph_ diff --git a/level_1/fl_fss/c/fss.h b/level_1/fl_fss/c/fss.h index 0437766..d9f2a1d 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -66,9 +66,11 @@ extern "C" { * The header data to populate with results of this function. * * @return + * F_none on success * FL_fss_header_not if no header is found. * FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header. - * F_parameter (with error bit) if a parameter is invalid. + * + * Errors from (with error bit): f_conversion_string_to_hexidecimal_unsigned(). */ #ifndef _di_fl_fss_identify_ extern f_return_status fl_fss_identify(const f_string_static buffer, f_fss_header *header); @@ -86,9 +88,10 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * + * Errors from (with error bit): f_conversion_string_to_hexidecimal_unsigned(). * Errors from (with error bit): f_file_read_until(). * Errors from (with error bit): fl_fss_identify() - * File errors (with error bit): F_file_seek, F_file_closed. + * File errors (with error bit): f_file_seek(). * * @see f_file_read_until() * @see fl_fss_identify() diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 462497f..a913506 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -911,7 +911,7 @@ extern "C" { printf("%s", parameter_file_name_micro); } - printf(".%c", f_string_eol[0]); + printf("'.%c", f_string_eol[0]); } }