From f66934da9f57b94c9ab2ca4ef9bd346f005ece57 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 19 Nov 2019 19:43:54 -0600 Subject: [PATCH] Refactor: make status codes more consistent Better follow the naming paradigm where reasonably possible. Use more consistent naming, which should also help with reducing the changes of enum to function name conflicts. Alphabetically organize status codes per group. --- level_0/f_console/c/console.h | 4 +- level_0/f_conversion/c/conversion.c | 90 +++++------ level_0/f_conversion/c/conversion.h | 72 ++++----- level_0/f_file/c/file.c | 42 ++--- level_0/f_file/c/file.h | 28 ++-- level_0/f_memory/c/memory.c | 6 +- level_0/f_memory/c/memory.h | 6 +- level_0/f_pipe/c/pipe.c | 8 +- level_0/f_pipe/c/pipe.h | 8 +- level_0/f_print/c/print.c | 6 +- level_0/f_print/c/print.h | 6 +- level_0/f_status/c/status.h | 176 ++++++++++----------- level_0/f_utf/c/utf.h | 2 +- level_1/fl_color/c/color.h | 10 +- level_1/fl_console/c/console.h | 12 +- level_1/fl_directory/c/directory.c | 2 +- level_1/fl_directory/c/directory.h | 2 +- level_1/fl_file/c/file.c | 8 +- level_1/fl_fss/c/fss.c | 6 +- level_1/fl_fss/c/fss.h | 2 +- level_1/fl_fss/c/fss_basic.h | 8 +- level_1/fl_fss/c/fss_basic_list.h | 8 +- level_1/fl_fss/c/fss_extended.h | 8 +- level_1/fl_fss/c/fss_extended_list.h | 8 +- level_1/fl_fss/c/fss_status.h | 10 +- level_1/fl_serialized/c/serialized.h | 4 +- level_1/fl_socket/c/socket.c | 6 +- level_1/fl_status/c/status.c | 84 +++++----- level_1/fl_status/c/status.h | 90 +++++------ level_1/fl_string/c/string.h | 12 +- level_1/fl_utf/c/utf.h | 4 +- level_2/fll_fss/c/fss_basic.c | 2 +- level_2/fll_fss/c/fss_basic.h | 6 +- level_2/fll_fss/c/fss_basic_list.c | 2 +- level_2/fll_fss/c/fss_basic_list.h | 6 +- level_2/fll_fss/c/fss_extended.c | 2 +- level_2/fll_fss/c/fss_extended.h | 6 +- level_2/fll_fss/c/fss_extended_list.c | 2 +- level_2/fll_fss/c/fss_extended_list.h | 6 +- level_2/fll_fss/c/fss_status.c | 8 +- level_2/fll_fss/c/fss_status.h | 4 +- level_2/fll_program/c/program.c | 2 +- level_2/fll_program/c/program.h | 2 +- level_2/fll_status/c/status.c | 84 +++++----- level_3/byte_dump/c/private-byte_dump.c | 2 +- level_3/firewall/c/firewall.c | 6 +- level_3/firewall/c/private-firewall.c | 34 ++-- .../c/private-fss_basic_list_read.c | 26 +-- .../fss_basic_list_write/c/fss_basic_list_write.c | 10 +- level_3/fss_basic_read/c/private-fss_basic_read.c | 26 +-- level_3/fss_basic_write/c/fss_basic_write.c | 10 +- .../c/private-fss_extended_list_read.c | 16 +- .../c/private-fss_extended_read.c | 26 +-- level_3/fss_extended_write/c/fss_extended_write.c | 12 +- .../fss_status_code/c/private-fss_status_code.c | 2 +- .../fss_status_code/c/private-fss_status_code.h | 18 +-- level_3/init/c/private-init.c | 26 +-- level_3/status_code/c/private-status_code.c | 2 +- level_3/status_code/c/private-status_code.h | 18 +-- 59 files changed, 552 insertions(+), 552 deletions(-) diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index bb78438..8bc199b 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -229,7 +229,7 @@ extern "C" { * @return * f_none on success. * f_no_data the input string is empty. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_console_identify_ extern f_return_status f_console_identify(const f_string input, f_console_id *result); @@ -272,7 +272,7 @@ extern "C" { * f_failure (with error bit) if width is not long enough to convert when processing arguments as UTF-8. * f_invalid_parameter (with error bit) if a parameter is invalid. * f_invalid_utf (with error bit) if character is an invalid UTF-8 character, when processing arguments. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_f_console_parameter_process_ extern f_return_status f_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining); diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index 69c7a9d..cc75cd8 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -83,7 +83,7 @@ extern "C" { case 0x30: *number = 0; break; case 0x31: *number = 1; break; default: - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return f_none; @@ -108,7 +108,7 @@ extern "C" { case 0x38: *number = 8; break; case 0x39: *number = 9; break; default: - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return f_none; @@ -137,7 +137,7 @@ extern "C" { case 0x61: *decimal = 10; break; case 0x62: *decimal = 11; break; default: - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return f_none; @@ -174,7 +174,7 @@ extern "C" { case 0x65: *decimal = 14; break; case 0x66: *decimal = 15; break; default: - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return f_none; @@ -197,7 +197,7 @@ extern "C" { case 0x36: *number = 6; break; case 0x37: *number = 7; break; default: - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return f_none; @@ -224,7 +224,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_binary_signed) { - return f_status_set_error(f_underflow); + return f_status_set_error(f_number_underflow); } converted <<= 1; @@ -232,7 +232,7 @@ extern "C" { } else { if (scale > f_conversion_scale_binary_signed) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } converted <<= 1; @@ -251,7 +251,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -279,7 +279,7 @@ extern "C" { scale++; if (scale > f_conversion_scale_binary_unsigned) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } converted <<= 1; @@ -291,7 +291,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -322,7 +322,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_decimal_signed) { if ((converted * 10) - digit < f_type_number_size_negative || (converted * 10) - digit > converted) { - return f_status_set_error(f_underflow); + return f_status_set_error(f_number_underflow); } } @@ -332,7 +332,7 @@ extern "C" { else { if (scale > f_conversion_scale_decimal_signed) { if ((converted * 10) + digit > f_type_number_size_positive || (converted * 10) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -352,7 +352,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -382,7 +382,7 @@ extern "C" { if (scale > f_conversion_scale_decimal_unsigned) { if ((converted * 10) + digit > f_type_number_size_unsigned || (converted * 10) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -395,7 +395,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -426,7 +426,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_duodecimal_signed) { if ((converted * 12) - digit < f_type_number_size_negative || (converted * 12) - digit > converted) { - return f_status_set_error(f_underflow); + return f_status_set_error(f_number_underflow); } } @@ -436,7 +436,7 @@ extern "C" { else { if (scale > f_conversion_scale_duodecimal_signed) { if ((converted * 12) + digit > f_type_number_size_positive || (converted * 12) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -456,7 +456,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -486,7 +486,7 @@ extern "C" { if (scale > f_conversion_scale_duodecimal_unsigned) { if ((converted * 12) + digit > f_type_number_size_unsigned || (converted * 12) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -499,7 +499,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -530,7 +530,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_hexidecimal_signed) { if ((converted << 4) - digit < f_type_number_size_negative || (converted << 4) - digit > converted) { - return f_status_set_error(f_underflow); + return f_status_set_error(f_number_underflow); } } @@ -540,7 +540,7 @@ extern "C" { else { if (scale > f_conversion_scale_hexidecimal_signed) { if ((converted << 4) + digit > f_type_number_size_positive || (converted << 4) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -560,7 +560,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -590,7 +590,7 @@ extern "C" { if (scale > f_conversion_scale_hexidecimal_unsigned) { if ((converted << 4) + digit > f_type_number_size_unsigned || (converted << 4) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -603,7 +603,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -634,7 +634,7 @@ extern "C" { if (negative) { if (scale > f_conversion_scale_octal_signed) { if ((converted << 3) - digit < f_type_number_size_negative || (converted << 3) - digit > converted) { - return f_status_set_error(f_underflow); + return f_status_set_error(f_number_underflow); } } @@ -644,7 +644,7 @@ extern "C" { else { if (scale > f_conversion_scale_octal_signed) { if ((converted << 3) + digit > f_type_number_size_positive || (converted << 3) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -664,7 +664,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -694,7 +694,7 @@ extern "C" { if (scale > f_conversion_scale_octal_unsigned) { if ((converted << 3) + digit > f_type_number_size_unsigned || (converted << 3) + digit < converted) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } } @@ -707,7 +707,7 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } // for @@ -747,7 +747,7 @@ extern "C" { continue; } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } else { @@ -770,7 +770,7 @@ extern "C" { } } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } if (string[i] == 0x30) { @@ -801,7 +801,7 @@ extern "C" { offset += 2; } else { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } break; @@ -814,7 +814,7 @@ extern "C" { offset++; } else { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } @@ -825,7 +825,7 @@ extern "C" { offset++; } else { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } @@ -834,11 +834,11 @@ extern "C" { break; } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } // for if (mode == 0) { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } f_string_location location_offset = f_string_location_initialize; @@ -896,7 +896,7 @@ extern "C" { continue; } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } } else { @@ -919,7 +919,7 @@ extern "C" { } } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } if (string[i] == 0x30) { @@ -950,7 +950,7 @@ extern "C" { offset += 2; } else { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } break; @@ -971,11 +971,11 @@ extern "C" { break; } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } // for if (mode == 0) { - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } f_string_location location_offset = f_string_location_initialize; @@ -1002,13 +1002,13 @@ extern "C" { if (sign_found) { if (status == f_none) { if (sign_found == -1) { - return f_status_set_error(f_negative_number); + return f_status_set_error(f_number_negative); } - return f_status_set_error(f_positive_number); + return f_status_set_error(f_number_positive); } - return f_status_set_error(f_invalid_number); + return f_status_set_error(f_number_invalid); } return status; diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index 1c67884..eaa8770 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -163,7 +163,7 @@ extern "C" { * * @return * f_none if character was converted to a binary. - * f_invalid_number (with error bit) if no conversion was made due to non-binary values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-binary values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_binary_ @@ -181,7 +181,7 @@ extern "C" { * * @return * f_none if character was converted to a decimal. - * f_invalid_number (with error bit) if no conversion was made due to non-decimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_decimal_ @@ -199,7 +199,7 @@ extern "C" { * * @return * f_none if character was converted to a duodecimal. - * f_invalid_number (with error bit) if no conversion was made due to non-duodecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_duodecimal_ @@ -217,7 +217,7 @@ extern "C" { * * @return * f_none if character was converted to a hexidecimal. - * f_invalid_number (with error bit) if no conversion was made due to non-hexidecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_hexidecimal_ @@ -235,7 +235,7 @@ extern "C" { * * @return * f_none if character was converted to a hexidecimal. - * f_invalid_number (with error bit) if no conversion was made due to non-hexidecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_octal_ @@ -261,10 +261,10 @@ extern "C" { * * @return * f_none if the binary string was converted to an signed long. - * f_invalid_number (with error bit) if no conversion was made due to non-binary values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-binary values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_overflow (with error bit) on integer overflow. + * f_number_underflow (with error bit) on integer underflow. */ #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_location location, const bool negative); @@ -287,9 +287,9 @@ extern "C" { * * @return * f_none if the binary string was converted to an unsigned long. - * f_invalid_number (with error bit) if no conversion was made due to non-binary values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-binary values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location); @@ -314,10 +314,10 @@ extern "C" { * * @return * f_none if the decimal string was converted to an signed long. - * f_invalid_number (with error bit) if no conversion was made due to non-decimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_overflow (with error bit) on integer overflow. + * f_number_underflow (with error bit) on integer underflow. */ #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_location location, const bool negative); @@ -340,9 +340,9 @@ extern "C" { * * @return * f_none if the decimal string was converted to an unsigned long. - * f_invalid_number (with error bit) if no conversion was made due to non-decimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location); @@ -367,10 +367,10 @@ extern "C" { * * @return * f_none if the duodecimal string was converted to an signed long. - * f_invalid_number (with error bit) if no conversion was made due to non-duodecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_overflow (with error bit) on integer overflow. + * f_number_underflow (with error bit) on integer underflow. */ #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_location location, const bool negative); @@ -393,9 +393,9 @@ extern "C" { * * @return * f_none if the duodecimal string was converted to an unsigned long. - * f_invalid_number (with error bit) if no conversion was made due to non-duodecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location); @@ -420,10 +420,10 @@ extern "C" { * * @return * f_none if the hexidecimal string was converted to an signed long. - * f_invalid_number (with error bit) if no conversion was made due to non-hexidecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_overflow (with error bit) on integer overflow. + * f_number_underflow (with error bit) on integer underflow. */ #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_location location, const bool negative); @@ -446,9 +446,9 @@ extern "C" { * * @return * f_none if the hexidecimal string was converted to an unsigned long. - * f_invalid_number (with error bit) if no conversion was made due to non-hexidecimal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location); @@ -473,9 +473,9 @@ extern "C" { * * @return * f_none if the octal string was converted to an signed long. - * f_invalid_number (with error bit) if no conversion was made due to non-octal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-octal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location, const bool negative); @@ -498,9 +498,9 @@ extern "C" { * * @return * f_none if the octal string was converted to an unsigned long. - * f_invalid_number (with error bit) if no conversion was made due to non-octal values being found. + * f_number_invalid (with error bit) if no conversion was made due to non-octal values being found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) on integer overflow. + * f_number_overflow (with error bit) on integer overflow. */ #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_location location); @@ -537,9 +537,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts with a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_invalid (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. * * @see strtoll() @@ -580,10 +580,10 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts with a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_positive_number (with error bit) on positive value (has a +, such as '+1', when only '1' is valid here). - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. * * @see strtoull() diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index 0310ca4..ba11cfd 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -26,11 +26,11 @@ extern "C" { file->address = fopen(file_name, file->mode); if (file->address == 0) return f_status_set_error(f_file_not_found); - if (ferror(file->address) != 0) return f_status_set_error(f_file_open_error); + if (ferror(file->address) != 0) return f_status_set_error(f_file_error_open); file->id = fileno(file->address); - if (file->id == -1) return f_status_set_error(f_file_descriptor_error); + if (file->id == -1) return f_status_set_error(f_file_error_descriptor); return f_none; } @@ -47,7 +47,7 @@ extern "C" { // if we were given a file descriptor as well, make sure to flush all changes to the disk that are not flushed by the 'fflush()' command if (file->id) { // make sure all unfinished data gets completed. - if (fsync(file->id) != 0) return f_status_set_error(f_file_synchronize_error); + if (fsync(file->id) != 0) return f_status_set_error(f_file_error_synchronize); } if (fclose(file->address) == 0) { @@ -55,7 +55,7 @@ extern "C" { return f_none; } - return f_status_set_error(f_file_close_error); + return f_status_set_error(f_file_error_close); } #endif // _di_f_file_close_ @@ -77,7 +77,7 @@ extern "C" { return f_status_set_error(f_out_of_memory); } else if (errno == EOVERFLOW) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } else if (errno == ENOTDIR) { return f_status_set_error(f_invalid_directory); @@ -115,7 +115,7 @@ extern "C" { return f_status_set_error(f_out_of_memory); } else if (errno == EOVERFLOW) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } else if (errno == ENOTDIR) { return f_status_set_error(f_invalid_directory); @@ -150,7 +150,7 @@ extern "C" { if (fflush(file->address) == 0) return f_none; - return f_status_set_error(f_file_flush_error); + return f_status_set_error(f_file_error_flush); } #endif // _di_f_file_flush_ @@ -165,8 +165,8 @@ extern "C" { int result = fread(buffer->string + buffer->used, file->byte_size, buffer->size - buffer->used - 1, file->address); - if (file->address == 0) return f_status_set_error(f_file_read_error); - if (ferror(file->address) != 0) return f_status_set_error(f_file_read_error); + if (file->address == 0) return f_status_set_error(f_file_error_read); + if (ferror(file->address) != 0) return f_status_set_error(f_file_error_read); buffer->used += (result / file->byte_size); @@ -204,8 +204,8 @@ extern "C" { result = fread(buffer->string + buffer_start, file->byte_size, total_elements, file->address); } - if (file->address == 0) return f_status_set_error(f_file_read_error); - if (ferror(file->address) != 0) return f_status_set_error(f_file_read_error); + if (file->address == 0) return f_status_set_error(f_file_error_read); + if (ferror(file->address) != 0) return f_status_set_error(f_file_error_read); // Save how much of our allocated buffer is actually used. if (buffer_start + result > buffer->used) { @@ -247,7 +247,7 @@ extern "C" { // first seek to 'where' we need to begin the read unsigned long current_file_position = ftell(file->address); - if (current_file_position == (unsigned long) -1) return f_status_set_error(f_file_seek_error); + if (current_file_position == (unsigned long) -1) return f_status_set_error(f_file_error_seek); int result = 0; @@ -258,7 +258,7 @@ extern "C" { result = f_macro_file_seek_to(file->address, file->byte_size * (position.file_start - current_file_position)); } - if (result != 0) return f_status_set_error(f_file_seek_error); + if (result != 0) return f_status_set_error(f_file_error_seek); // now do the actual read if (position.total_elements == 0) { @@ -268,8 +268,8 @@ extern "C" { result = fread(buffer->string + position.buffer_start, file->byte_size, position.total_elements, file->address); } - if (file->address == 0) return f_status_set_error(f_file_read_error); - if (ferror(file->address) != 0) return f_status_set_error(f_file_read_error); + if (file->address == 0) return f_status_set_error(f_file_error_read); + if (ferror(file->address) != 0) return f_status_set_error(f_file_error_read); // now save how much of our allocated buffer is actually used // also make sure that we aren't making used space vanish @@ -304,7 +304,7 @@ extern "C" { return f_status_set_error(f_out_of_memory); } else if (errno == EOVERFLOW) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } else if (errno == ENOTDIR) { return f_status_set_error(f_invalid_directory); @@ -319,7 +319,7 @@ extern "C" { return f_status_set_error(f_loop); } - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } return f_none; @@ -345,7 +345,7 @@ extern "C" { return f_status_set_error(f_out_of_memory); } else if (errno == EOVERFLOW) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } else if (errno == ENOTDIR) { return f_status_set_error(f_invalid_directory); @@ -360,7 +360,7 @@ extern "C" { return f_status_set_error(f_loop); } - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } return f_none; @@ -386,7 +386,7 @@ extern "C" { return f_status_set_error(f_out_of_memory); } else if (errno == EOVERFLOW) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } else if (errno == ENOTDIR) { return f_status_set_error(f_invalid_directory); @@ -401,7 +401,7 @@ extern "C" { return f_status_set_error(f_loop); } - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } return f_none; diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index 24be5b8..29c755d 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -250,8 +250,8 @@ extern "C" { * @return * f_none on success. * f_file_not_found (with error bit) if the file was not found. - * f_file_open_error (with error bit) if the file is already open. - * f_file_descriptor_error (with error bit) if unable to load the file descriptor (the file pointer may still be valid). + * f_file_error_open (with error bit) if the file is already open. + * f_file_error_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_file_open_ @@ -269,8 +269,8 @@ extern "C" { * @return * f_none on success. * f_file_not_open (with error bit) if the file is not open. - * f_file_synchronize_error (with error bit) on fsync() failure. - * f_file_close_error (with error bit) if fclose() failed. + * f_file_error_synchronize (with error bit) on fsync() failure. + * f_file_error_close (with error bit) if fclose() failed. * f_invalid_parameter (with error bit) if a parameter is invalid. * * @see fsync() @@ -292,7 +292,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. * f_invalid_name (with error bit) if the filename is too long. * f_out_of_memory (with error bit) if out of memory. - * f_overflow (with error bit) on overflow error. + * f_number_overflow (with error bit) on overflow error. * f_invalid_directory (with error bit) on invalid directory. * f_access_denied (with error bit) on access denied. * f_loop (with error bit) on loop error. @@ -318,7 +318,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. * f_invalid_name (with error bit) if the filename is too long. * f_out_of_memory (with error bit) if out of memory. - * f_overflow (with error bit) on overflow error. + * f_number_overflow (with error bit) on overflow error. * f_invalid_directory (with error bit) on invalid directory. * f_access_denied (with error bit) on access denied. * f_loop (with error bit) on loop error. @@ -339,7 +339,7 @@ extern "C" { * @return * f_none is returned on success. * f_file_not_open (with error bit) if the file is not open. - * f_file_flush_error (with error bit) if the flush failed. + * f_file_error_flush (with error bit) if the flush failed. * f_invalid_parameter (with error bit) if a parameter is invalid. * * @see fflush() @@ -360,7 +360,7 @@ extern "C" { * f_none on success. * f_none_on_eof on success and EOF was reached. * f_file_not_open (with error bit) if file is not open. - * f_file_read_error (with error bit) if file read failed. + * f_file_error_read (with error bit) if file read failed. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_file_read_ @@ -385,7 +385,7 @@ extern "C" { * f_none is returned if file_stat has a non-zero address. * f_none_on_eof on success and EOF was reached. * f_file_not_open (with error bit) if file is not open. - * f_file_read_error (with error bit) if file read failed. + * f_file_error_read (with error bit) if file read failed. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_file_read_range_ @@ -410,8 +410,8 @@ extern "C" { * f_none is returned if file_stat has a non-zero address. * f_none_on_eof on success and EOF was reached. * f_file_not_open (with error bit) if file is not open. - * f_file_seek_error (with error bit) if file seek failed. - * f_file_read_error (with error bit) if file read failed. + * f_file_error_seek (with error bit) if file seek failed. + * f_file_error_read (with error bit) if file read failed. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_file_read_at_ @@ -440,7 +440,7 @@ extern "C" { * f_none is returned if file_stat has a non-zero address. * f_invalid_name (with error bit) if the name is somehow invalid. * f_out_of_memory (with error bit) if out of memory. - * f_overflow (with error bit) on overflow error. + * f_number_overflow (with error bit) on overflow error. * f_invalid_directory (with error bit) on invalid directory. * f_file_not_found (with error bit) if the file was not found. * f_access_denied (with error bit) if access to the file was denied. @@ -470,7 +470,7 @@ extern "C" { * f_none on success. * f_invalid_name (with error bit) if the name is somehow invalid. * f_out_of_memory (with error bit) if out of memory. - * f_overflow (with error bit) on overflow error. + * f_number_overflow (with error bit) on overflow error. * f_invalid_directory (with error bit) on invalid directory. * f_file_not_found (with error bit) if the file was not found. * f_access_denied (with error bit) if access to the file was denied. @@ -500,7 +500,7 @@ extern "C" { * f_none on success. * f_invalid_name (with error bit) if the name is somehow invalid. * f_out_of_memory (with error bit) if out of memory. - * f_overflow (with error bit) on overflow error. + * f_number_overflow (with error bit) on overflow error. * f_invalid_directory (with error bit) on invalid directory. * f_file_not_found (with error bit) if the file was not found. * f_access_denied (with error bit) if access to the file was denied. diff --git a/level_0/f_memory/c/memory.c b/level_0/f_memory/c/memory.c index 8cf5dd4..092439f 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -22,7 +22,7 @@ extern "C" { return f_none; } - return f_status_set_error(f_allocation_error); + return f_status_set_error(f_error_allocation); } #endif // _di_f_memory_new_ @@ -121,7 +121,7 @@ extern "C" { return f_none; } - return f_status_set_error(f_reallocation_error); + return f_status_set_error(f_error_reallocation); } #endif // ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) ) @@ -186,7 +186,7 @@ extern "C" { return f_none; } - return f_status_set_error(f_reallocation_error); + return f_status_set_error(f_error_reallocation); } #endif // ! ( defined (_di_f_memory_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) diff --git a/level_0/f_memory/c/memory.h b/level_0/f_memory/c/memory.h index 97ba4c8..fb11901 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -84,7 +84,7 @@ extern "C" { * * @return * f_none on success. - * f_allocation_error (with error bit) on allocation error. + * f_error_allocation (with error bit) on allocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_memory_new_ @@ -149,7 +149,7 @@ extern "C" { * * @return * f_none on success. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) ) @@ -172,7 +172,7 @@ extern "C" { * * @return * f_none on success. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) diff --git a/level_0/f_pipe/c/pipe.c b/level_0/f_pipe/c/pipe.c index 3e0e3b0..b038b5e 100644 --- a/level_0/f_pipe/c/pipe.c +++ b/level_0/f_pipe/c/pipe.c @@ -9,7 +9,7 @@ extern "C" { struct stat st_info; if (fstat(fileno(f_pipe), &st_info) != 0) { - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } if (S_ISFIFO(st_info.st_mode)) { @@ -25,7 +25,7 @@ extern "C" { struct stat st_info; if (fstat(fileno(f_pipe_warning), &st_info) != 0) { - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } if (S_ISFIFO(st_info.st_mode)) { @@ -41,7 +41,7 @@ extern "C" { struct stat st_info; if (fstat(fileno(f_pipe_error), &st_info) != 0) { - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } if (S_ISFIFO(st_info.st_mode)) { @@ -57,7 +57,7 @@ extern "C" { struct stat st_info; if (fstat(fileno(f_pipe_debug), &st_info) != 0) { - return f_status_set_error(f_file_stat_error); + return f_status_set_error(f_file_error_stat); } if (S_ISFIFO(st_info.st_mode)) { diff --git a/level_0/f_pipe/c/pipe.h b/level_0/f_pipe/c/pipe.h index fcaefc5..bc60ee9 100644 --- a/level_0/f_pipe/c/pipe.h +++ b/level_0/f_pipe/c/pipe.h @@ -38,7 +38,7 @@ extern "C" { * @return * f_true if there is piped data. * f_false if there is no piped data. - * f_file_stat_error (with error bit) on stat() error. + * f_file_error_stat (with error bit) on stat() error. * * @see stat() */ @@ -54,7 +54,7 @@ extern "C" { * @return * f_true if there is piped data. * f_false if there is no piped data. - * f_file_stat_error (with error bit) on stat() error. + * f_file_error_stat (with error bit) on stat() error. * * @see stat() */ @@ -68,7 +68,7 @@ extern "C" { * @return * f_true if there is piped data. * f_false if there is no piped data. - * f_file_stat_error (with error bit) on stat() error. + * f_file_error_stat (with error bit) on stat() error. * * @see stat() */ @@ -84,7 +84,7 @@ extern "C" { * @return * f_true if there is piped data. * f_false if there is no piped data. - * f_file_stat_error (with error bit) on stat() error. + * f_file_error_stat (with error bit) on stat() error. * * @see stat() */ diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index bd8e8e6..df01b6c 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -16,7 +16,7 @@ extern "C" { for (; i < length; i++) { if (string[i] != f_string_eos) { if (fputc(string[i], output) == 0) { - return f_status_set_error(f_output_error); + return f_status_set_error(f_error_output); } } } // for @@ -36,7 +36,7 @@ extern "C" { for (; i < buffer.used; i++) { if (buffer.string[i] != f_string_eos) { if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_output_error); + return f_status_set_error(f_error_output); } } } // for @@ -60,7 +60,7 @@ extern "C" { for (; i <= location.stop; i++) { if (buffer.string[i] != f_string_eos) { if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_output_error); + return f_status_set_error(f_error_output); } } } // for diff --git a/level_0/f_print/c/print.h b/level_0/f_print/c/print.h index 48ec70c..9fbaed1 100644 --- a/level_0/f_print/c/print.h +++ b/level_0/f_print/c/print.h @@ -40,7 +40,7 @@ extern "C" { * * @return * f_none on success. - * f_output_error (with error bit) on failure. + * f_error_output (with error bit) on failure. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_ @@ -63,7 +63,7 @@ extern "C" { * * @return * f_none on success. - * f_output_error (with error bit) on failure. + * f_error_output (with error bit) on failure. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_ @@ -88,7 +88,7 @@ extern "C" { * * @return * f_none on success. - * f_output_error (with error bit) on failure. + * f_error_output (with error bit) on failure. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_partial_ diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 7b76ada..d1922b2 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -133,24 +133,24 @@ extern "C" { #endif // _di_f_status_signals_ #ifndef _di_f_status_basic_ - f_none = 197, // Start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255). - f_maybe, - f_dummy, // To only be used as a placeholder. - f_warn, // Warning. + f_none = 197, // Start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255). f_critical, - f_unknown, // For the "code should never get here" errors. (this is an EMERGENCY error). - f_unsupported, - f_no_data, // Warning. - f_out_of_memory, - f_input_error, - f_output_error, - f_input_output_error, f_does_not_exist, - f_not_connected, + f_dummy, + f_error_input, + f_error_output, + f_error_input_output, f_failure, - f_interrupted, // Usually by a signal. - f_loop, // Such as infinite recursion. - f_incomplete, // Incomplete information. + f_incomplete, + f_interrupted, + f_loop, + f_maybe, + f_not_connected, + f_no_data, + f_out_of_memory, + f_unknown, + f_unsupported, + f_warn, #endif // _di_f_status_basic_ #ifndef _di_f_status_invalid_ @@ -181,75 +181,75 @@ extern "C" { #ifndef _di_f_status_busy_ f_busy, f_busy_address, - f_busy_port, - f_busy_socket, + f_busy_buffer, f_busy_device, f_busy_pipe, - f_busy_buffer, + f_busy_port, f_busy_process, + f_busy_socket, #endif // _di_f_status_busy_ #ifndef _di_f_status_unavailable_ f_unavailable, f_unavailable_address, - f_unavailable_port, - f_unavailable_socket, + f_unavailable_buffer, f_unavailable_device, f_unavailable_pipe, - f_unavailable_buffer, + f_unavailable_port, f_unavailable_process, + f_unavailable_socket, #endif // _di_f_status_unavailable_ #ifndef _di_f_status_digits_ - f_underflow, - f_overflow, - f_divide_by_zero, - f_negative_number, - f_positive_number, - f_zero_number, - f_decimal_number, - f_whole_number, - f_invalid_number, + f_number_decimal, + f_number_divide_by_zero, + f_number_invalid, + f_number_negative, + f_number_overflow, + f_number_positive, + f_number_underflow, + f_number_whole, + f_number_zero, #endif // _di_f_status_digits_ #ifndef _di_f_status_buffers_ - f_no_data_on_eof, - f_no_data_on_eol, - f_no_data_on_eos, - f_no_data_on_stop, - f_none_on_eof, - f_none_on_eol, - f_none_on_eos, - f_none_on_stop, + f_buffer_too_small, + f_buffer_too_large, f_error_on_eof, f_error_on_eol, f_error_on_eos, f_error_on_stop, - f_buffer_too_small, - f_buffer_too_large, + f_incomplete_utf, + f_incomplete_utf_on_eof, + f_incomplete_utf_on_eol, + f_incomplete_utf_on_eos, + f_incomplete_utf_on_stop, + f_none_on_eof, + f_none_on_eol, + f_none_on_eos, + f_none_on_stop, + f_no_data_on_eof, + f_no_data_on_eol, + f_no_data_on_eos, + f_no_data_on_stop, f_string_too_small, f_string_too_large, - f_unterminated_nest, - f_unterminated_nest_on_eof, - f_unterminated_nest_on_eol, - f_unterminated_nest_on_eos, - f_unterminated_nest_on_stop, f_unterminated_group, f_unterminated_group_on_eof, f_unterminated_group_on_eol, f_unterminated_group_on_eos, f_unterminated_group_on_stop, - f_incomplete_utf, - f_incomplete_utf_on_eof, - f_incomplete_utf_on_eol, - f_incomplete_utf_on_eos, - f_incomplete_utf_on_stop, + f_unterminated_nest, + f_unterminated_nest_on_eof, + f_unterminated_nest_on_eol, + f_unterminated_nest_on_eos, + f_unterminated_nest_on_stop, #endif // _di_f_status_buffers_ #ifndef _di_f_status_allocation_ - f_allocation_error, - f_reallocation_error, - f_deallocation_error, + f_error_allocation, + f_error_deallocation, + f_error_reallocation, #endif // _di_f_status_allocation_ #ifndef _di_f_status_fork_ @@ -258,51 +258,51 @@ extern "C" { #endif // _di_f_status_fork_ #ifndef _di_f_status_file_ - f_file_seek_error, - f_file_read_error, - f_file_write_error, - f_file_flush_error, - f_file_purge_error, - f_file_open_error, - f_file_close_error, - f_file_synchronize_error, - f_file_descriptor_error, - f_file_not_found, + f_file_error, + f_file_error_allocation, + f_file_error_close, + f_file_error_deallocation, + f_file_error_descriptor, + f_file_error_flush, + f_file_error_open, + f_file_error_purge, + f_file_error_read, + f_file_error_reallocation, + f_file_error_seek, + f_file_error_stat, + f_file_error_synchronize, + f_file_error_write, f_file_found, f_file_is_empty, + f_file_not_found, f_file_not_open, - f_file_allocation_error, - f_file_reallocation_error, - f_file_deallocation_error, - f_file_stat_error, - f_file_error, f_file_not_utf, #endif // _di_f_status_file_ // Most of these are a guess until I get around to researching & implementing linux directory I/O. #ifndef _di_f_status_directory_ - f_directory_read_error, - f_directory_write_error, - f_directory_flush_error, - f_directory_purge_error, - f_directory_open_error, - f_directory_close_error, - f_directory_synchronize_error, - f_directory_descriptor_error, - f_directory_not_found, + f_directory_error, + f_directory_error_allocation, + f_directory_error_close, + f_directory_error_descriptor, + f_directory_error_flush, + f_directory_error_open, + f_directory_error_purge, + f_directory_error_read, + f_directory_error_reallocation, + f_directory_error_synchronize, + f_directory_error_write, f_directory_is_empty, + f_directory_not_found, f_directory_not_open, - f_directory_allocation_error, - f_directory_reallocation_error, - f_directory_error, f_directory_not_utf, #endif // _di_f_status_directory_ #ifndef _di_f_status_socket_ - f_socket_connection_client_error, - f_socket_connection_target_error, - f_socket_receive_error, - f_socket_send_error, + f_socket_error_connection_client, + f_socket_error_connection_target, + f_socket_error_receive, + f_socket_error_send, #endif // _di_f_status_socket_ #ifndef _di_f_status_non_ @@ -314,13 +314,13 @@ extern "C" { #ifndef _di_f_status_access_denied_ f_access_denied, - f_access_denied_user, + f_access_denied_execute, f_access_denied_group, - f_access_denied_world, f_access_denied_read, + f_access_denied_super, // "super" as in super user (root user). + f_access_denied_user, + f_access_denied_world, f_access_denied_write, - f_access_denied_execute, - f_access_denied_super, // Not super user (aka: not root). #endif // _di_f_status_access_denied_ // Required. diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 5eb77d1..5dd5ebb 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -653,7 +653,7 @@ extern "C" { * f_failure (with error bit) if width is not long enough to convert. * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_allocation_error (with error bit) on memory allocation error. + * f_error_allocation (with error bit) on memory allocation error. * f_failure (with error bit) if width is not long enough to convert. */ #ifndef _di_f_utf_character_to_char_ diff --git a/level_1/fl_color/c/color.h b/level_1/fl_color/c/color.h index e59d20d..5caee23 100644 --- a/level_1/fl_color/c/color.h +++ b/level_1/fl_color/c/color.h @@ -157,7 +157,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #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); @@ -190,7 +190,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_output_error (with error bit) on output error. + * f_error_output (with error bit) on output error. */ #ifndef _di_fl_color_print_ extern f_return_status fl_color_print(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...); @@ -217,7 +217,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_output_error (with error bit) on output error. + * f_error_output (with error bit) on output error. */ #ifndef _di_fl_color_print_line_ extern f_return_status fl_color_print_line(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...); @@ -236,7 +236,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_output_error (with error bit) on output error. + * f_error_output (with error bit) on output error. */ #ifndef _di_fl_color_print_code_ extern f_return_status fl_color_print_code(FILE *file, const f_string_dynamic color); @@ -258,7 +258,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #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.h b/level_1/fl_console/c/console.h index 4513785..20eb871 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -50,9 +50,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_overflow (with error bit) on integer overflow. - * f_underflow (with error bit) on integer underflow. + * f_number_invalid (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. * * @see f_conversion_string_to_number_signed() @@ -85,9 +85,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. * * @see f_conversion_string_to_number_unsigned() diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 13a9fe7..75906e7 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -77,7 +77,7 @@ extern "C" { } else if (length == -1) { if (errno == ENOMEM) { - return f_status_set_error(f_allocation_error); + return f_status_set_error(f_error_allocation); } else { return f_status_set_error(f_failure); diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index bb73e73..c195867 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -56,7 +56,7 @@ extern "C" { * f_no_data if directory is empty (@fixme: unlikely due to '.' and '..' probably always being returned.). * f_failure (with error bit) if failed to read directory information. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. * * @see scandir() */ diff --git a/level_1/fl_file/c/file.c b/level_1/fl_file/c/file.c index 039cbd5..911f776 100644 --- a/level_1/fl_file/c/file.c +++ b/level_1/fl_file/c/file.c @@ -50,7 +50,7 @@ extern "C" { if (infinite) { if (size + f_file_default_read_size > f_string_max_size) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } size += f_file_default_read_size; @@ -94,7 +94,7 @@ extern "C" { } if (size + f_file_default_read_size > f_string_max_size) { - return f_status_set_error(f_overflow); + return f_status_set_error(f_number_overflow); } size += f_file_default_read_size; @@ -114,7 +114,7 @@ extern "C" { size = fwrite(buffer.string, file.byte_size, buffer.used, file.address); if (size < buffer.used * file.byte_size) { - return f_status_set_error(f_file_write_error); + return f_status_set_error(f_file_error_write); } return f_none; @@ -137,7 +137,7 @@ extern "C" { size = fwrite(buffer.string + position.start, file.byte_size, total, file.address); if (size < total * file.byte_size) { - return f_status_set_error(f_file_write_error); + return f_status_set_error(f_file_error_write); } return f_none; diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index be73638..5288409 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -104,7 +104,7 @@ extern "C" { i++; header->length = i; - return f_status_is_warning(fl_fss_accepted_but_invalid); + return f_status_is_warning(fl_fss_invalid_but_accepted); } } } @@ -149,7 +149,7 @@ extern "C" { header->length = i + 1; - return f_status_is_warning(fl_fss_accepted_but_invalid); + return f_status_is_warning(fl_fss_invalid_but_accepted); } } } @@ -186,7 +186,7 @@ extern "C" { { int seek_result = f_macro_file_seek_begin(file->address, 0); - if (seek_result != 0) return f_status_set_error(f_file_seek_error); + if (seek_result != 0) return f_status_set_error(f_file_error_seek); } // 1: Prepare the buffer to handle a size of f_fss_max_header_length diff --git a/level_1/fl_fss/c/fss.h b/level_1/fl_fss/c/fss.h index 849c49d..42bd3e1 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -88,7 +88,7 @@ extern "C" { * * Errors from (with error bit): f_file_read_at(). * Errors from (with error bit): fl_fss_identify() - * File errors (with error bit): f_file_seek_error, f_file_not_open. + * File errors (with error bit): f_file_error_seek, f_file_not_open. * * @see f_file_read_at() * @see fl_fss_identify() diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index c9d5da8..88eda87 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -59,7 +59,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_object_read_ @@ -94,7 +94,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_content_read_ @@ -124,7 +124,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_object_write_ @@ -153,7 +153,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_content_write_ diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index cf08c45..d562cb0 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -60,7 +60,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_object_read_ @@ -95,7 +95,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_content_read_ @@ -126,7 +126,7 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_object_write_ @@ -155,7 +155,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_content_write_ diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index ed168a6..c461dce 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -59,7 +59,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_object_read_ @@ -94,7 +94,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_content_read_ @@ -124,7 +124,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_object_write_ @@ -153,7 +153,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_content_write_ diff --git a/level_1/fl_fss/c/fss_extended_list.h b/level_1/fl_fss/c/fss_extended_list.h index fc8a3fc..6de6fef 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -60,7 +60,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_object_read_ @@ -95,7 +95,7 @@ extern "C" { * f_incomplete_utf_on_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_content_read_ @@ -126,7 +126,7 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_object_write_ @@ -155,7 +155,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_content_write_ diff --git a/level_1/fl_fss/c/fss_status.h b/level_1/fl_fss/c/fss_status.h index eb68a4f..e90ca2b 100644 --- a/level_1/fl_fss/c/fss_status.h +++ b/level_1/fl_fss/c/fss_status.h @@ -28,18 +28,18 @@ enum { #endif // _di_fl_fss_status_error_ #ifndef _di_fl_fss_status_warning_ + fl_fss_invalid_but_accepted, + fl_fss_invalid_but_accepted_eos, fl_fss_no_header, - fl_fss_accepted_but_invalid, fl_fss_no_header_eos, - fl_fss_accepted_but_invalid_eos, #endif // _di_fl_fss_status_warning_ #ifndef _di_fl_fss_status_success_ - fl_fss_found_object, fl_fss_found_content, - fl_fss_found_no_object, + fl_fss_found_object, + fl_fss_found_object_no_content, fl_fss_found_no_content, - fl_fss_found_object_no_content, // for the case where an object is found but no content could possibly exist + fl_fss_found_no_object, #endif // _di_fl_fss_status_success_ #ifndef _di_fl_fss_status_codes_ diff --git a/level_1/fl_serialized/c/serialized.h b/level_1/fl_serialized/c/serialized.h index 7b5fc4a..d5d92b1 100644 --- a/level_1/fl_serialized/c/serialized.h +++ b/level_1/fl_serialized/c/serialized.h @@ -44,7 +44,7 @@ extern "C" { * @return * f_none on success. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_serialize_simple_ extern f_return_status fl_serialize_simple(const f_string_dynamic value, f_string_dynamic *serialized); @@ -71,7 +71,7 @@ extern "C" { * f_none on success. * f_incomplete_utf_on_eos if end of sting is reached before a complete UTF-8 character can be processed. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_unserialize_simple_map_ extern f_return_status fl_unserialize_simple_map(const f_string_dynamic serialized, f_string_locations *locations); diff --git a/level_1/fl_socket/c/socket.c b/level_1/fl_socket/c/socket.c index e366479..5281cbe 100644 --- a/level_1/fl_socket/c/socket.c +++ b/level_1/fl_socket/c/socket.c @@ -59,7 +59,7 @@ extern "C"{ return f_busy; } else if (errno == EBADF) { - return f_file_descriptor_error; + return f_file_error_descriptor; } else if (errno == ENOTSOCK) { return f_invalid_socket; @@ -99,7 +99,7 @@ extern "C"{ if (error_code > 0) { if (error_code == EBADF) { - return f_file_descriptor_error; + return f_file_error_descriptor; } else if (error_code == EINVAL) { return f_invalid_value; @@ -114,7 +114,7 @@ extern "C"{ return f_interrupted; } else if (error_code == EBADF) { - return f_input_output_error; + return f_error_input_output; } return f_failure; diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index f6c0601..68f9de8 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -243,13 +243,13 @@ extern "C" { case f_out_of_memory: *string = fl_status_string_out_of_memory; break; - case f_input_error: + case f_error_input: *string = fl_status_string_input_error; break; - case f_output_error: + case f_error_output: *string = fl_status_string_output_error; break; - case f_input_output_error: + case f_error_input_output: *string = fl_status_string_input_output_error; break; case f_does_not_exist: @@ -396,31 +396,31 @@ extern "C" { #endif // _di_fl_status_unavailable_ #ifndef _di_fl_status_digits_ - case f_underflow: + case f_number_underflow: *string = fl_status_string_underflow; break; - case f_overflow: + case f_number_overflow: *string = fl_status_string_overflow; break; - case f_divide_by_zero: + case f_number_divide_by_zero: *string = fl_status_string_divide_by_zero; break; - case f_negative_number: + case f_number_negative: *string = fl_status_string_negative_number; break; - case f_positive_number: + case f_number_positive: *string = fl_status_string_positive_number; break; - case f_zero_number: + case f_number_zero: *string = fl_status_string_zero_number; break; - case f_decimal_number: + case f_number_decimal: *string = fl_status_string_decimal_number; break; - case f_whole_number: + case f_number_whole: *string = fl_status_string_whole_number; break; - case f_invalid_number: + case f_number_invalid: *string = fl_status_string_invalid_number; break; #endif // _di_fl_status_digits_ @@ -522,13 +522,13 @@ extern "C" { #endif // _di_fl_status_buffers_ #ifndef _di_fl_status_allocation_ - case f_allocation_error: + case f_error_allocation: *string = fl_status_string_allocation_error; break; - case f_reallocation_error: + case f_error_reallocation: *string = fl_status_string_reallocation_error; break; - case f_deallocation_error: + case f_error_deallocation: *string = fl_status_string_deallocation_error; break; #endif // _di_fl_status_allocation_ @@ -543,31 +543,31 @@ extern "C" { #endif // _di_fl_status_fork_ #ifndef _di_fl_status_file_ - case f_file_seek_error: + case f_file_error_seek: *string = fl_status_string_file_seek_error; break; - case f_file_read_error: + case f_file_error_read: *string = fl_status_string_file_read_error; break; - case f_file_write_error: + case f_file_error_write: *string = fl_status_string_file_write_error; break; - case f_file_flush_error: + case f_file_error_flush: *string = fl_status_string_file_flush_error; break; - case f_file_purge_error: + case f_file_error_purge: *string = fl_status_string_file_purge_error; break; - case f_file_open_error: + case f_file_error_open: *string = fl_status_string_file_open_error; break; - case f_file_close_error: + case f_file_error_close: *string = fl_status_string_file_close_error; break; - case f_file_synchronize_error: + case f_file_error_synchronize: *string = fl_status_string_file_synchronize_error; break; - case f_file_descriptor_error: + case f_file_error_descriptor: *string = fl_status_string_file_descriptor_error; break; case f_file_not_found: @@ -582,16 +582,16 @@ extern "C" { case f_file_not_open: *string = fl_status_string_file_not_open; break; - case f_file_allocation_error: + case f_file_error_allocation: *string = fl_status_string_file_allocation_error; break; - case f_file_reallocation_error: + case f_file_error_reallocation: *string = fl_status_string_file_reallocation_error; break; - case f_file_deallocation_error: + case f_file_error_deallocation: *string = fl_status_string_file_deallocation_error; break; - case f_file_stat_error: + case f_file_error_stat: *string = fl_status_string_file_stat_error; break; case f_file_error: @@ -603,28 +603,28 @@ extern "C" { #endif // _di_fl_status_file_ #ifndef _di_fl_status_directory_ - case f_directory_read_error: + case f_directory_error_read: *string = fl_status_string_directory_read_error; break; - case f_directory_write_error: + case f_directory_error_write: *string = fl_status_string_directory_write_error; break; - case f_directory_flush_error: + case f_directory_error_flush: *string = fl_status_string_directory_flush_error; break; - case f_directory_purge_error: + case f_directory_error_purge: *string = fl_status_string_directory_purge_error; break; - case f_directory_open_error: + case f_directory_error_open: *string = fl_status_string_directory_open_error; break; - case f_directory_close_error: + case f_directory_error_close: *string = fl_status_string_directory_close_error; break; - case f_directory_synchronize_error: + case f_directory_error_synchronize: *string = fl_status_string_directory_synchronize_error; break; - case f_directory_descriptor_error: + case f_directory_error_descriptor: *string = fl_status_string_directory_descriptor_error; break; case f_directory_not_found: @@ -636,10 +636,10 @@ extern "C" { case f_directory_not_open: *string = fl_status_string_directory_not_open; break; - case f_directory_allocation_error: + case f_directory_error_allocation: *string = fl_status_string_directory_allocation_error; break; - case f_directory_reallocation_error: + case f_directory_error_reallocation: *string = fl_status_string_directory_reallocation_error; break; case f_directory_error: @@ -651,16 +651,16 @@ extern "C" { #endif // _di_fl_status_directory_ #ifndef _di_fl_status_socket_ - case f_socket_connection_client_error: + case f_socket_error_connection_client: *string = fl_status_string_socket_connection_client_error; break; - case f_socket_connection_target_error: + case f_socket_error_connection_target: *string = fl_status_string_socket_connection_target_error; break; - case f_socket_receive_error: + case f_socket_error_receive: *string = fl_status_string_socket_receive_error; break; - case f_socket_send_error: + case f_socket_error_send: *string = fl_status_string_socket_send_error; break; #endif // _di_fl_status_socket_ diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index 7a788db..ebe0813 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -251,13 +251,13 @@ extern "C" { #define fl_status_string_out_of_memory "f_out_of_memory" #define fl_status_string_out_of_memory_length 16 - #define fl_status_string_input_error "f_input_error" + #define fl_status_string_input_error "f_error_input" #define fl_status_string_input_error_length 14 - #define fl_status_string_output_error "f_output_error" + #define fl_status_string_output_error "f_error_output" #define fl_status_string_output_error_length 15 - #define fl_status_string_input_output_error "f_input_output_error" + #define fl_status_string_input_output_error "f_error_input_output" #define fl_status_string_input_output_error_length 21 #define fl_status_string_does_not_exist "f_does_not_exist" @@ -400,31 +400,31 @@ extern "C" { #endif // _di_fl_status_unavailable_ #ifndef _di_fl_status_digits_ - #define fl_status_string_underflow "f_underflow" - #define fl_status_string_underflow_length 12 + #define fl_status_string_underflow "f_number_underflow" + #define fl_status_string_underflow_length 19 - #define fl_status_string_overflow "f_overflow" - #define fl_status_string_overflow_length 11 + #define fl_status_string_overflow "f_number_overflow" + #define fl_status_string_overflow_length 18 - #define fl_status_string_divide_by_zero "f_divide_by_zero" - #define fl_status_string_divide_by_zero_length 17 + #define fl_status_string_divide_by_zero "f_number_divide_by_zero" + #define fl_status_string_divide_by_zero_length 24 - #define fl_status_string_negative_number "f_negative_number" + #define fl_status_string_negative_number "f_number_negative" #define fl_status_string_negative_number_length 18 - #define fl_status_string_positive_number "f_positive_number" + #define fl_status_string_positive_number "f_number_positive" #define fl_status_string_positive_number_length 18 - #define fl_status_string_zero_number "f_zero_number" + #define fl_status_string_zero_number "f_number_zero" #define fl_status_string_zero_number_length 14 - #define fl_status_string_decimal_number "f_decimal_number" + #define fl_status_string_decimal_number "f_number_decimal" #define fl_status_string_decimal_number_length 17 - #define fl_status_string_whole_number "f_whole_number" + #define fl_status_string_whole_number "f_number_whole" #define fl_status_string_whole_number_length 15 - #define fl_status_string_invalid_number "f_invalid_number" + #define fl_status_string_invalid_number "f_number_invalid" #define fl_status_string_invalid_number_length 17 #endif // _di_fl_status_digits_ @@ -524,13 +524,13 @@ extern "C" { #endif // _di_fl_status_buffers_ #ifndef _di_fl_status_allocation_ - #define fl_status_string_allocation_error "f_allocation_error" + #define fl_status_string_allocation_error "f_error_allocation" #define fl_status_string_allocation_error_length 19 - #define fl_status_string_reallocation_error "f_reallocation_error" + #define fl_status_string_reallocation_error "f_error_reallocation" #define fl_status_string_reallocation_error_length 21 - #define fl_status_string_deallocation_error "f_deallocation_error" + #define fl_status_string_deallocation_error "f_error_deallocation" #define fl_status_string_deallocation_error_length 21 #endif // _di_fl_status_allocation_ @@ -543,31 +543,31 @@ extern "C" { #endif // _di_fl_status_fork_ #ifndef _di_fl_status_file_ - #define fl_status_string_file_seek_error "f_file_seek_error" + #define fl_status_string_file_seek_error "f_file_error_seek" #define fl_status_string_file_seek_error_length 18 - #define fl_status_string_file_read_error "f_file_read_error" + #define fl_status_string_file_read_error "f_file_error_read" #define fl_status_string_file_read_error_length 18 - #define fl_status_string_file_write_error "f_file_write_error" + #define fl_status_string_file_write_error "f_file_error_write" #define fl_status_string_file_write_error_length 19 - #define fl_status_string_file_flush_error "f_file_flush_error" + #define fl_status_string_file_flush_error "f_file_error_flush" #define fl_status_string_file_flush_error_length 19 - #define fl_status_string_file_purge_error "f_file_purge_error" + #define fl_status_string_file_purge_error "f_file_error_purge" #define fl_status_string_file_purge_error_length 19 - #define fl_status_string_file_open_error "f_file_open_error" + #define fl_status_string_file_open_error "f_file_error_open" #define fl_status_string_file_open_error_length 18 - #define fl_status_string_file_close_error "f_file_close_error" + #define fl_status_string_file_close_error "f_file_error_close" #define fl_status_string_file_close_error_length 19 - #define fl_status_string_file_synchronize_error "f_file_synchronize_error" + #define fl_status_string_file_synchronize_error "f_file_error_synchronize" #define fl_status_string_file_synchronize_error_length 25 - #define fl_status_string_file_descriptor_error "f_file_descriptor_error" + #define fl_status_string_file_descriptor_error "f_file_error_descriptor" #define fl_status_string_file_descriptor_error_length 24 #define fl_status_string_file_not_found "f_file_not_found" @@ -582,16 +582,16 @@ extern "C" { #define fl_status_string_file_not_open "f_file_not_open" #define fl_status_string_file_not_open_length 16 - #define fl_status_string_file_allocation_error "f_file_allocation_error" + #define fl_status_string_file_allocation_error "f_file_error_allocation" #define fl_status_string_file_allocation_error_length 24 - #define fl_status_string_file_reallocation_error "f_file_reallocation_error" + #define fl_status_string_file_reallocation_error "f_file_error_reallocation" #define fl_status_string_file_reallocation_error_length 26 - #define fl_status_string_file_deallocation_error "f_file_deallocation_error" + #define fl_status_string_file_deallocation_error "f_file_error_deallocation" #define fl_status_string_file_deallocation_error_length 26 - #define fl_status_string_file_stat_error "f_file_stat_error" + #define fl_status_string_file_stat_error "f_file_error_stat" #define fl_status_string_file_stat_error_length 18 #define fl_status_string_file_error "f_file_error" @@ -602,28 +602,28 @@ extern "C" { #endif // _di_fl_status_file_ #ifndef _di_fl_status_directory_ - #define fl_status_string_directory_read_error "f_directory_read_error" + #define fl_status_string_directory_read_error "f_directory_error_read" #define fl_status_string_directory_read_error_length 23 - #define fl_status_string_directory_write_error "f_directory_write_error" + #define fl_status_string_directory_write_error "f_directory_error_write" #define fl_status_string_directory_write_error_length 24 - #define fl_status_string_directory_flush_error "f_directory_flush_error" + #define fl_status_string_directory_flush_error "f_directory_error_flush" #define fl_status_string_directory_flush_error_length 24 - #define fl_status_string_directory_purge_error "f_directory_purge_error" + #define fl_status_string_directory_purge_error "f_directory_error_purge" #define fl_status_string_directory_purge_error_length 24 - #define fl_status_string_directory_open_error "f_directory_open_error" + #define fl_status_string_directory_open_error "f_directory_error_open" #define fl_status_string_directory_open_error_length 23 - #define fl_status_string_directory_close_error "f_directory_close_error" + #define fl_status_string_directory_close_error "f_directory_error_close" #define fl_status_string_directory_close_error_length 24 - #define fl_status_string_directory_synchronize_error "f_directory_synchronize_error" + #define fl_status_string_directory_synchronize_error "f_directory_error_synchronize" #define fl_status_string_directory_synchronize_error_length 30 - #define fl_status_string_directory_descriptor_error "f_directory_descriptor_error" + #define fl_status_string_directory_descriptor_error "f_directory_error_descriptor" #define fl_status_string_directory_descriptor_error_length 29 #define fl_status_string_directory_not_found "f_directory_not_found" @@ -635,10 +635,10 @@ extern "C" { #define fl_status_string_directory_not_open "f_directory_not_open" #define fl_status_string_directory_not_open_length 21 - #define fl_status_string_directory_allocation_error "f_directory_allocation_error" + #define fl_status_string_directory_allocation_error "f_directory_error_allocation" #define fl_status_string_directory_allocation_error_length 29 - #define fl_status_string_directory_reallocation_error "f_directory_reallocation_error" + #define fl_status_string_directory_reallocation_error "f_directory_error_reallocation" #define fl_status_string_directory_reallocation_error_length 31 #define fl_status_string_directory_error "f_directory_error" @@ -649,16 +649,16 @@ extern "C" { #endif // _di_fl_status_directory_ #ifndef _di_fl_status_socket_ - #define fl_status_string_socket_connection_client_error "f_socket_connection_client_error" + #define fl_status_string_socket_connection_client_error "f_socket_error_connection_client" #define fl_status_string_socket_connection_client_error_length 33 - #define fl_status_string_socket_connection_target_error "f_socket_connection_target_error" + #define fl_status_string_socket_connection_target_error "f_socket_error_connection_target" #define fl_status_string_socket_connection_target_error_length 33 - #define fl_status_string_socket_receive_error "f_socket_receive_error" + #define fl_status_string_socket_receive_error "f_socket_error_receive" #define fl_status_string_socket_receive_error_length 23 - #define fl_status_string_socket_send_error "f_socket_send_error" + #define fl_status_string_socket_send_error "f_socket_error_send" #define fl_status_string_socket_send_error_length 20 #endif // _di_fl_status_socket_ diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index 9e257d6..37d8a63 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -116,8 +116,8 @@ extern "C" { * f_none on success. * f_no_data if nothing to rip, no allocations or reallocations are performed. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_allocation_error (with error bit) on memory allocation error. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_allocation (with error bit) on memory allocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_string_rip_ extern f_return_status fl_string_rip(const f_string_dynamic buffer, const f_string_location location, f_string_dynamic *result); @@ -192,8 +192,8 @@ extern "C" { * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. * f_incomplete_utf_on_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_allocation_error (with error bit) on memory allocation error. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_allocation (with error bit) on memory allocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_string_seek_line_until_graph_ extern f_return_status fl_string_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder); @@ -218,8 +218,8 @@ extern "C" { * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. * f_incomplete_utf_on_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_allocation_error (with error bit) on memory allocation error. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_allocation (with error bit) on memory allocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_string_seek_line_until_non_graph_ extern f_return_status fl_string_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder); diff --git a/level_1/fl_utf/c/utf.h b/level_1/fl_utf/c/utf.h index 41b7d80..45c3fed 100644 --- a/level_1/fl_utf/c/utf.h +++ b/level_1/fl_utf/c/utf.h @@ -107,8 +107,8 @@ extern "C" { * f_none on success. * f_no_data if nothing to rip, no allocations or reallocations are performed. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_allocation_error (with error bit) on memory allocation error. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_allocation (with error bit) on memory allocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_utf_string_rip_ extern f_return_status fl_utf_string_rip(const f_utf_string_dynamic buffer, const f_utf_string_location location, f_utf_string_dynamic *result); diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index accd4e7..0ce0914 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -129,7 +129,7 @@ extern "C" { contents->used++; } while (input->start < f_string_max_size); - return f_status_is_error(f_overflow); + return f_status_is_error(f_number_overflow); } #endif // _di_fll_fss_basic_read_ diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index c82d96f..a92881f 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -49,9 +49,9 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) if the maximimum buffer size is reached. + * f_number_overflow (with error bit) if the maximimum buffer size is reached. */ #ifndef _di_fll_fss_basic_read_ extern f_return_status fll_fss_basic_read(f_string_dynamic *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); @@ -75,7 +75,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_basic_write_ diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index d66a340..ae6d5ce 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -129,7 +129,7 @@ extern "C" { contents->used++; } while (input->start < f_string_max_size); - return f_status_is_error(f_overflow); + return f_status_is_error(f_number_overflow); } #endif // _di_fll_fss_basic_list_read_ diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index 3d42034..500944e 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -48,9 +48,9 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) if the maximimum buffer size is reached. + * f_number_overflow (with error bit) if the maximimum buffer size is reached. */ #ifndef _di_fll_fss_basic_list_read_ extern f_return_status fll_fss_basic_list_read(f_string_dynamic *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); @@ -74,7 +74,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_basic_list_write_ diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 35d091d..d2d4942 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -129,7 +129,7 @@ extern "C" { contents->used++; } while (input->start < f_string_max_size); - return f_status_is_error(f_overflow); + return f_status_is_error(f_number_overflow); } #endif // _di_fll_fss_extended_read_ diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index 3000ba2..e3d43d6 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -48,9 +48,9 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) if the maximimum buffer size is reached. + * f_number_overflow (with error bit) if the maximimum buffer size is reached. */ #ifndef _di_fll_fss_extended_read_ extern f_return_status fll_fss_extended_read(f_string_dynamic *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents); @@ -74,7 +74,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_extended_write_ diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index 3a6a466..fa9018e 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -129,7 +129,7 @@ extern "C" { contents->used++; } while (input->start < f_string_max_size); - return f_status_is_error(f_overflow); + return f_status_is_error(f_number_overflow); } #endif // _di_fll_fss_extended_list_read_ diff --git a/level_2/fll_fss/c/fss_extended_list.h b/level_2/fll_fss/c/fss_extended_list.h index 0f33abb..e28030e 100644 --- a/level_2/fll_fss/c/fss_extended_list.h +++ b/level_2/fll_fss/c/fss_extended_list.h @@ -48,9 +48,9 @@ extern "C" { * f_no_data_on_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_overflow (with error bit) if the maximimum buffer size is reached. + * f_number_overflow (with error bit) if the maximimum buffer size is reached. */ #ifndef _di_fll_fss_extended_list_read_ extern f_return_status fll_fss_extended_list_read(f_string_dynamic *buffer, f_string_location *input, f_fss_objects *objects, f_fss_content_nests *contents); @@ -74,7 +74,7 @@ extern "C" { * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. * f_incomplete_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete. * f_invalid_utf (with error bit) is returned on failure to read/process a UTF-8 character. - * f_reallocation_error (with error bit) on reallocation error. + * f_error_reallocation (with error bit) on reallocation error. * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_extended_list_write_ diff --git a/level_2/fll_fss/c/fss_status.c b/level_2/fll_fss/c/fss_status.c index 1f9b999..f7da963 100644 --- a/level_2/fll_fss/c/fss_status.c +++ b/level_2/fll_fss/c/fss_status.c @@ -45,7 +45,7 @@ extern "C" { } if (fl_string_compare(string, fll_fss_status_string_accepted_but_invalid, length, fll_fss_status_string_accepted_but_invalid_length) == f_equal_to) { - *code = fl_fss_accepted_but_invalid; + *code = fl_fss_invalid_but_accepted; return f_none; } @@ -55,7 +55,7 @@ extern "C" { } if (fl_string_compare(string, fll_fss_status_string_accepted_but_invalid_eos, length, fll_fss_status_string_accepted_but_invalid_eos_length) == f_equal_to) { - *code = fl_fss_accepted_but_invalid_eos; + *code = fl_fss_invalid_but_accepted_eos; return f_none; } #endif // _di_fll_fss_status_warning_ @@ -130,13 +130,13 @@ extern "C" { case fl_fss_no_header: *string = fll_fss_status_string_no_header; break; - case fl_fss_accepted_but_invalid: + case fl_fss_invalid_but_accepted: *string = fll_fss_status_string_accepted_but_invalid; break; case fl_fss_no_header_eos: *string = fll_fss_status_string_no_header_eos; break; - case fl_fss_accepted_but_invalid_eos: + case fl_fss_invalid_but_accepted_eos: *string = fll_fss_status_string_accepted_but_invalid_eos; break; #endif // _di_fll_fss_status_warning_ diff --git a/level_2/fll_fss/c/fss_status.h b/level_2/fll_fss/c/fss_status.h index 417844c..5063ba8 100644 --- a/level_2/fll_fss/c/fss_status.h +++ b/level_2/fll_fss/c/fss_status.h @@ -43,13 +43,13 @@ extern "C" { #define fll_fss_status_string_no_header "fl_fss_no_header" #define fll_fss_status_string_no_header_length 17 - #define fll_fss_status_string_accepted_but_invalid "fl_fss_accepted_but_invalid" + #define fll_fss_status_string_accepted_but_invalid "fl_fss_invalid_but_accepted" #define fll_fss_status_string_accepted_but_invalid_length 28 #define fll_fss_status_string_no_header_eos "fl_fss_no_header_eos" #define fll_fss_status_string_no_header_eos_length 21 - #define fll_fss_status_string_accepted_but_invalid_eos "fl_fss_accepted_but_invalid_eos" + #define fll_fss_status_string_accepted_but_invalid_eos "fl_fss_invalid_but_accepted_eos" #define fll_fss_status_string_accepted_but_invalid_eos_length 32 #endif // _di_fll_fss_status_warning_ diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 1d1205f..985581e 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -110,7 +110,7 @@ extern "C" { // to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0 // nothing can be 0 as that represents the program name, unless argv[] is improperly created } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == f_invalid_utf) { diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 31b341b..49bdd8a 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -135,7 +135,7 @@ extern "C" { * f_none on success. * f_no_data if "additional" parameters were expected but not found. * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_reallocation_error (with error bit) on memory reallocation error. + * f_error_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fll_program_process_parameters_ extern f_return_status fll_program_process_parameters(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, f_string_lengths *remaining, fl_color_context *context); diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index 57337b3..50246e2 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -407,17 +407,17 @@ extern "C" { } if (fl_string_compare(string, fl_status_string_input_error, length, fl_status_string_input_error_length) == f_equal_to) { - *code = f_input_error; + *code = f_error_input; return f_none; } if (fl_string_compare(string, fl_status_string_output_error, length, fl_status_string_output_error_length) == f_equal_to) { - *code = f_output_error; + *code = f_error_output; return f_none; } if (fl_string_compare(string, fl_status_string_input_output_error, length, fl_status_string_input_output_error_length) == f_equal_to) { - *code = f_input_output_error; + *code = f_error_input_output; return f_none; } @@ -650,47 +650,47 @@ extern "C" { #ifndef _di_fll_status_digits_ if (fl_string_compare(string, fl_status_string_underflow, length, fl_status_string_underflow_length) == f_equal_to) { - *code = f_underflow; + *code = f_number_underflow; return f_none; } if (fl_string_compare(string, fl_status_string_overflow, length, fl_status_string_overflow_length) == f_equal_to) { - *code = f_overflow; + *code = f_number_overflow; return f_none; } if (fl_string_compare(string, fl_status_string_divide_by_zero, length, fl_status_string_divide_by_zero_length) == f_equal_to) { - *code = f_divide_by_zero; + *code = f_number_divide_by_zero; return f_none; } if (fl_string_compare(string, fl_status_string_negative_number, length, fl_status_string_negative_number_length) == f_equal_to) { - *code = f_negative_number; + *code = f_number_negative; return f_none; } if (fl_string_compare(string, fl_status_string_positive_number, length, fl_status_string_positive_number_length) == f_equal_to) { - *code = f_positive_number; + *code = f_number_positive; return f_none; } if (fl_string_compare(string, fl_status_string_zero_number, length, fl_status_string_zero_number_length) == f_equal_to) { - *code = f_zero_number; + *code = f_number_zero; return f_none; } if (fl_string_compare(string, fl_status_string_decimal_number, length, fl_status_string_decimal_number_length) == f_equal_to) { - *code = f_decimal_number; + *code = f_number_decimal; return f_none; } if (fl_string_compare(string, fl_status_string_whole_number, length, fl_status_string_whole_number_length) == f_equal_to) { - *code = f_whole_number; + *code = f_number_whole; return f_none; } if (fl_string_compare(string, fl_status_string_invalid_number, length, fl_status_string_invalid_number_length) == f_equal_to) { - *code = f_invalid_number; + *code = f_number_invalid; return f_none; } #endif // _di_fll_status_digits_ @@ -854,17 +854,17 @@ extern "C" { #ifndef _di_fll_status_allocation_ if (fl_string_compare(string, fl_status_string_allocation_error, length, fl_status_string_allocation_error_length) == f_equal_to) { - *code = f_allocation_error; + *code = f_error_allocation; return f_none; } if (fl_string_compare(string, fl_status_string_reallocation_error, length, fl_status_string_reallocation_error_length) == f_equal_to) { - *code = f_reallocation_error; + *code = f_error_reallocation; return f_none; } if (fl_string_compare(string, fl_status_string_deallocation_error, length, fl_status_string_deallocation_error_length) == f_equal_to) { - *code = f_deallocation_error; + *code = f_error_deallocation; return f_none; } #endif // _di_fll_status_allocation_ @@ -883,47 +883,47 @@ extern "C" { #ifndef _di_fll_status_file_ if (fl_string_compare(string, fl_status_string_file_seek_error, length, fl_status_string_file_seek_error_length) == f_equal_to) { - *code = f_file_seek_error; + *code = f_file_error_seek; return f_none; } if (fl_string_compare(string, fl_status_string_file_read_error, length, fl_status_string_file_read_error_length) == f_equal_to) { - *code = f_file_read_error; + *code = f_file_error_read; return f_none; } if (fl_string_compare(string, fl_status_string_file_write_error, length, fl_status_string_file_write_error_length) == f_equal_to) { - *code = f_file_write_error; + *code = f_file_error_write; return f_none; } if (fl_string_compare(string, fl_status_string_file_flush_error, length, fl_status_string_file_flush_error_length) == f_equal_to) { - *code = f_file_flush_error; + *code = f_file_error_flush; return f_none; } if (fl_string_compare(string, fl_status_string_file_purge_error, length, fl_status_string_file_purge_error_length) == f_equal_to) { - *code = f_file_purge_error; + *code = f_file_error_purge; return f_none; } if (fl_string_compare(string, fl_status_string_file_open_error, length, fl_status_string_file_open_error_length) == f_equal_to) { - *code = f_file_open_error; + *code = f_file_error_open; return f_none; } if (fl_string_compare(string, fl_status_string_file_close_error, length, fl_status_string_file_close_error_length) == f_equal_to) { - *code = f_file_close_error; + *code = f_file_error_close; return f_none; } if (fl_string_compare(string, fl_status_string_file_synchronize_error, length, fl_status_string_file_synchronize_error_length) == f_equal_to) { - *code = f_file_synchronize_error; + *code = f_file_error_synchronize; return f_none; } if (fl_string_compare(string, fl_status_string_file_descriptor_error, length, fl_status_string_file_descriptor_error_length) == f_equal_to) { - *code = f_file_descriptor_error; + *code = f_file_error_descriptor; return f_none; } @@ -948,22 +948,22 @@ extern "C" { } if (fl_string_compare(string, fl_status_string_file_allocation_error, length, fl_status_string_file_allocation_error_length) == f_equal_to) { - *code = f_file_allocation_error; + *code = f_file_error_allocation; return f_none; } if (fl_string_compare(string, fl_status_string_file_reallocation_error, length, fl_status_string_file_reallocation_error_length) == f_equal_to) { - *code = f_file_reallocation_error; + *code = f_file_error_reallocation; return f_none; } if (fl_string_compare(string, fl_status_string_file_deallocation_error, length, fl_status_string_file_deallocation_error_length) == f_equal_to) { - *code = f_file_deallocation_error; + *code = f_file_error_deallocation; return f_none; } if (fl_string_compare(string, fl_status_string_file_stat_error, length, fl_status_string_file_stat_error_length) == f_equal_to) { - *code = f_file_stat_error; + *code = f_file_error_stat; return f_none; } @@ -980,42 +980,42 @@ extern "C" { #ifndef _di_fll_status_directory_ if (fl_string_compare(string, fl_status_string_directory_read_error, length, fl_status_string_directory_read_error_length) == f_equal_to) { - *code = f_directory_read_error; + *code = f_directory_error_read; return f_none; } if (fl_string_compare(string, fl_status_string_directory_write_error, length, fl_status_string_directory_write_error_length) == f_equal_to) { - *code = f_directory_write_error; + *code = f_directory_error_write; return f_none; } if (fl_string_compare(string, fl_status_string_directory_flush_error, length, fl_status_string_directory_flush_error_length) == f_equal_to) { - *code = f_directory_flush_error; + *code = f_directory_error_flush; return f_none; } if (fl_string_compare(string, fl_status_string_directory_purge_error, length, fl_status_string_directory_purge_error_length) == f_equal_to) { - *code = f_directory_purge_error; + *code = f_directory_error_purge; return f_none; } if (fl_string_compare(string, fl_status_string_directory_open_error, length, fl_status_string_directory_open_error_length) == f_equal_to) { - *code = f_directory_open_error; + *code = f_directory_error_open; return f_none; } if (fl_string_compare(string, fl_status_string_directory_close_error, length, fl_status_string_directory_close_error_length) == f_equal_to) { - *code = f_directory_close_error; + *code = f_directory_error_close; return f_none; } if (fl_string_compare(string, fl_status_string_directory_synchronize_error, length, fl_status_string_directory_synchronize_error_length) == f_equal_to) { - *code = f_directory_synchronize_error; + *code = f_directory_error_synchronize; return f_none; } if (fl_string_compare(string, fl_status_string_directory_descriptor_error, length, fl_status_string_directory_descriptor_error_length) == f_equal_to) { - *code = f_directory_descriptor_error; + *code = f_directory_error_descriptor; return f_none; } @@ -1035,12 +1035,12 @@ extern "C" { } if (fl_string_compare(string, fl_status_string_directory_allocation_error, length, fl_status_string_directory_allocation_error_length) == f_equal_to) { - *code = f_directory_allocation_error; + *code = f_directory_error_allocation; return f_none; } if (fl_string_compare(string, fl_status_string_directory_reallocation_error, length, fl_status_string_directory_reallocation_error_length) == f_equal_to) { - *code = f_directory_reallocation_error; + *code = f_directory_error_reallocation; return f_none; } @@ -1057,22 +1057,22 @@ extern "C" { #ifndef _di_fll_status_socket_ if (fl_string_compare(string, fl_status_string_socket_connection_client_error, length, fl_status_string_socket_connection_client_error_length) == f_equal_to) { - *code = f_socket_connection_client_error; + *code = f_socket_error_connection_client; return f_none; } if (fl_string_compare(string, fl_status_string_socket_connection_target_error, length, fl_status_string_socket_connection_target_error_length) == f_equal_to) { - *code = f_socket_connection_target_error; + *code = f_socket_error_connection_target; return f_none; } if (fl_string_compare(string, fl_status_string_socket_receive_error, length, fl_status_string_socket_receive_error_length) == f_equal_to) { - *code = f_socket_receive_error; + *code = f_socket_error_receive; return f_none; } if (fl_string_compare(string, fl_status_string_socket_send_error, length, fl_status_string_socket_send_error_length) == f_equal_to) { - *code = f_socket_send_error; + *code = f_socket_error_send; return f_none; } #endif // _di_fll_status_socket_ diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index d22834e..59910ac 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -819,7 +819,7 @@ extern "C" { return; } - if (status == f_overflow) { + if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Overflow while trying to access file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 629c93f..fea6892 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -270,7 +270,7 @@ extern "C" { if (f_status_is_error(status)) { status = f_status_set_fine(status); - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else { @@ -320,7 +320,7 @@ extern "C" { if (f_status_is_error(status)) { status = f_status_set_fine(status); - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_no_data) { @@ -551,7 +551,7 @@ extern "C" { firewall_delete_local_data(&local); - if (status == f_file_not_found || status == f_file_open_error || status == f_file_descriptor_error || status == fl_fss_found_object_no_content) { + if (status == f_file_not_found || status == f_file_error_open || status == f_file_error_descriptor || status == fl_fss_found_object_no_content) { status = f_status_set_error(status); continue; } diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 2049883..1f2a748 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -594,13 +594,13 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const fl_color_print_line(f_standard_warning, data.context.warning, data.context.reset, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string); status = f_none; } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%.*s'", file_path.used, file_path.string); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else { @@ -630,19 +630,19 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read()"); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string); } else if (status == f_file_not_open) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%.*s'", file_path.used, file_path.string); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else { @@ -669,7 +669,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) { // empty files are to be silently ignored } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else { @@ -1352,7 +1352,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } - else if (status != f_file_not_found && status != f_file_open_error && status != f_file_descriptor_error) { + else if (status != f_file_not_found && status != f_file_error_open && status != f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open().", status); } } else { @@ -1362,10 +1362,10 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'.", filename); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'.", filename); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename); } else { @@ -1389,19 +1389,19 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read()."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); } else if (status == f_file_not_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -1427,7 +1427,7 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -1452,7 +1452,7 @@ f_return_status firewall_process_rules(f_string_location *input, firewall_local_ if (f_status_is_error(status)) { status = f_status_set_fine(status); - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == f_failure) { diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 2d77d0a..6a43577 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -13,7 +13,7 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -23,12 +23,12 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -38,22 +38,22 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -74,35 +74,35 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_invalid_number) { + else if (status == f_number_invalid) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_underflow) { + else if (status == f_number_underflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_negative_number) { + else if (status == f_number_negative) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_positive_number) { + else if (status == f_number_positive) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' contains a '"); @@ -272,7 +272,7 @@ extern "C" { fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 6dd0a50..0bc9e51 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -75,10 +75,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -156,10 +156,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { @@ -179,7 +179,7 @@ extern "C" { if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_write_error) { + else if (status == f_file_error_write) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index 69cb1fc..a91db2b 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -13,7 +13,7 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -23,12 +23,12 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -38,22 +38,22 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -74,35 +74,35 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_invalid_number) { + else if (status == f_number_invalid) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_underflow) { + else if (status == f_number_underflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_negative_number) { + else if (status == f_number_negative) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_positive_number) { + else if (status == f_number_positive) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' contains a '"); @@ -272,7 +272,7 @@ extern "C" { fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index 5807453..442b1ef 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -75,10 +75,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -156,10 +156,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { @@ -179,7 +179,7 @@ extern "C" { if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_write_error) { + else if (status == f_file_error_write) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 877c721..9f5dcf3 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -13,7 +13,7 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -23,12 +23,12 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -38,22 +38,22 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -238,7 +238,7 @@ extern "C" { if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_extended_list_read() for the file '%s'", filename); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index 1536802..a1ef4fa 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -13,7 +13,7 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -23,12 +23,12 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "' is no longer open."); } - else if (status == f_file_seek_error) { + else if (status == f_file_error_seek) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_read_error) { + else if (status == f_file_error_read) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); @@ -38,22 +38,22 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -74,35 +74,35 @@ extern "C" { fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_standard_error, context.error, context.reset, "."); } - else if (status == f_invalid_number) { + else if (status == f_number_invalid) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_underflow) { + else if (status == f_number_underflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_overflow) { + else if (status == f_number_overflow) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_negative_number) { + else if (status == f_number_negative) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_standard_error, context.notable, context.reset, "--%s", parameter_name); fl_color_print_line(f_standard_error, context.error, context.reset, "'."); } - else if (status == f_positive_number) { + else if (status == f_number_positive) { fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument); fl_color_print(f_standard_error, context.error, context.reset, "' contains a '"); @@ -272,7 +272,7 @@ extern "C" { fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'."); } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory"); } else if (status == f_incomplete_utf_on_stop) { diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 01e6632..7d14bfe 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -55,7 +55,7 @@ extern "C" { // to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0 // nothing can be 0 as that represents the program name, unless arguments.argv[] is improperly created } - else if (status == f_allocation_error || status == f_reallocation_error) { + else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == f_invalid_utf) { @@ -102,10 +102,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -221,10 +221,10 @@ extern "C" { else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } - else if (status == f_file_open_error) { + else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } - else if (status == f_file_descriptor_error) { + else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { @@ -244,7 +244,7 @@ extern "C" { if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_write_error) { + else if (status == f_file_error_write) { fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index 48b9429..9c0cf9d 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -140,7 +140,7 @@ extern "C" { } if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_negative_number) { + if (f_status_set_fine(status) == f_number_negative) { fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range"); } else { diff --git a/level_3/fss_status_code/c/private-fss_status_code.h b/level_3/fss_status_code/c/private-fss_status_code.h index 07b9083..3e3c10f 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.h +++ b/level_3/fss_status_code/c/private-fss_status_code.h @@ -24,9 +24,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_fss_status_code_process_check_ @@ -62,9 +62,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_fss_status_code_process_normal_ @@ -86,9 +86,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_fss_status_code_convert_number_ diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 0ec1556..4fb2d2c 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -18,7 +18,7 @@ if (optional) { if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); - } else if (status != f_file_not_found && status != f_file_open_error && status != f_file_descriptor_error) { + } else if (status != f_file_not_found && status != f_file_error_open && status != f_file_error_descriptor) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open().", status); } } else { @@ -26,9 +26,9 @@ fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } else if (status == f_file_not_found) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to find the file '%s'.", filename); - } else if (status == f_file_open_error) { + } else if (status == f_file_error_open) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%s'.", filename); - } else if (status == f_file_descriptor_error) { + } else if (status == f_file_error_descriptor) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename); } else { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling f_file_open().", status); @@ -50,15 +50,15 @@ if (status == f_invalid_parameter) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read()."); - } else if (status == f_overflow) { + } else if (status == f_number_overflow) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); } else if (status == f_file_not_open) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); - } else if (status == f_file_seek_error) { + } else if (status == f_file_error_seek) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); - } else if (status == f_file_read_error) { + } else if (status == f_file_error_read) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); - } else if (status == f_allocation_error || status == f_reallocation_error) { + } else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fl_file_read().", status); @@ -80,7 +80,7 @@ fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename); } else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); - } else if (status == f_allocation_error || status == f_reallocation_error) { + } else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); @@ -107,7 +107,7 @@ if (f_status_is_error(status)) { status = f_status_set_fine(status); - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == f_failure) { // the error message has already been displayed. @@ -499,7 +499,7 @@ fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file); } else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file); - } else if (status == f_allocation_error || status == f_reallocation_error) { + } else if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occured while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file); @@ -526,7 +526,7 @@ status = fll_fss_extended_read(&buffer, &location, &objects, &contents); if (f_status_is_error(status_process)) { - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -553,7 +553,7 @@ if (f_status_is_error(status)) { status = f_status_set_fine(status); - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, data.context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == f_failure) { // the error message has already been displayed. @@ -567,7 +567,7 @@ } } else { - if (status == f_allocation_error || status == f_reallocation_error) { + if (status == f_error_allocation || status == f_error_reallocation) { fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index 256f254..07f0526 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -134,7 +134,7 @@ extern "C" { } if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_negative_number) { + if (f_status_set_fine(status) == f_number_negative) { fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range"); } else { diff --git a/level_3/status_code/c/private-status_code.h b/level_3/status_code/c/private-status_code.h index 2268b4e..09fd4ab 100644 --- a/level_3/status_code/c/private-status_code.h +++ b/level_3/status_code/c/private-status_code.h @@ -24,9 +24,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_status_code_process_check_ @@ -62,9 +62,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_status_code_process_normal_ @@ -86,9 +86,9 @@ extern "C" { * f_none on success. * f_no_data (with error bit) if string starts wth a null (length is 0). * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid_number (with error bit) if parameter is not a number. - * f_negative_number (with error bit) on negative value. - * f_overflow (with error bit) on integer overflow. + * f_number_invalid (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. */ #ifndef _di_status_code_convert_number_ -- 1.8.3.1