From: Kevin Day Date: Sat, 23 May 2020 15:36:05 +0000 (-0500) Subject: Refactor: use capital F, FL, and FLL for status codes to avoid potential conflicts X-Git-Tag: 0.5.0~242 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e6d8d137acc5bc62f0c5f09267039a5e9e51bf1d;p=fll Refactor: use capital F, FL, and FLL for status codes to avoid potential conflicts By only using the first part, the annoyance of all uppercase can be avoided. This then allows shortening the names and removing words like "_error". Also restructure where the "_not" are placed (placing them immediately after what they apply to). This will be followed up by a restructuring commit. --- diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 5e27093..58e054c 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -7,14 +7,14 @@ extern "C" { #ifndef _di_f_console_identify_ f_return_status f_console_identify(const f_string input, f_console_id *result) { #ifndef _di_level_0_parameter_checking_ - if (result == 0) return f_status_set_error(f_invalid_parameter); + if (result == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f const f_string_length length = strnlen(input, 3); if (length == 0) { *result = f_console_none; - return f_no_data; + return F_data_not; } if (input[0] == f_console_symbol_enable) { @@ -43,19 +43,19 @@ extern "C" { } else *result = f_console_none; - return f_none; + return F_none; } #endif // _di_f_console_identify_ #ifndef _di_f_console_parameter_process_ f_return_status f_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining) { #ifndef _di_level_0_parameter_checking_ - if (remaining == 0) return f_status_set_error(f_invalid_parameter); + if (remaining == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_console_id result = 0; - bool found = f_false; + bool found = F_false; unsigned long location = 1; // Parameter 0 represents the program name so skip it. f_string_length sub_location = 0; @@ -81,7 +81,7 @@ extern "C" { if (parameters.parameter[i].additional.used >= parameters.parameter[i].additional.size) { f_macro_string_lengths_resize(status, parameters.parameter[i].additional, parameters.parameter[i].additional.size + f_console_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -161,7 +161,7 @@ extern "C" { status = f_utf_char_to_character(arguments.argv[location] + sub_location, width_max, &character_argument_utf); - if (status != f_none) { + if (status != F_none) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -170,7 +170,7 @@ extern "C" { status = f_utf_char_to_character((f_string) parameters.parameter[i].symbol_short, width_max, &character_console_utf); - if (status != f_none) { + if (status != F_none) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -196,7 +196,7 @@ extern "C" { if (parameters.parameter[i].locations.used >= parameters.parameter[i].locations.size) { f_macro_string_lengths_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -218,7 +218,7 @@ extern "C" { if (needs_additional.used + parameters.parameter[i].has_additional > needs_additional.size) { f_macro_string_lengths_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -237,7 +237,7 @@ extern "C" { } // while } else { - found = f_false; + found = F_false; for (i = 0; i < parameters.used; i++) { if (parameters.parameter[i].type != f_console_type_other) continue; @@ -249,7 +249,7 @@ extern "C" { if (parameters.parameter[i].locations.used >= parameters.parameter[i].locations.size) { f_macro_string_lengths_resize(status, parameters.parameter[i].locations, parameters.parameter[i].locations.size + f_console_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -267,7 +267,7 @@ extern "C" { if (needs_additional.used + parameters.parameter[i].has_additional > needs_additional.size) { f_macro_string_lengths_resize(status, needs_additional, needs_additional.used + parameters.parameter[i].has_additional); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -279,7 +279,7 @@ extern "C" { } // for } - found = f_true; + found = F_true; break; } // for @@ -288,7 +288,7 @@ extern "C" { if (remaining->used >= remaining->size) { f_macro_string_lengths_resize(status, (*remaining), remaining->size + f_console_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(needs_additional); return status; } @@ -303,10 +303,10 @@ extern "C" { } // while if (needs_additional.used > 0) { - status = f_no_data; + status = F_data_not; } else { - status = f_none; + status = F_none; } f_macro_string_lengths_delete_simple(needs_additional); @@ -318,19 +318,19 @@ extern "C" { #ifndef _di_f_console_parameter_prioritize_left_ f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) { #ifndef _di_level_0_parameter_checking_ - if (decision == 0) return f_status_set_error(f_invalid_parameter); - if (choices.id == 0) return f_status_set_error(f_invalid_parameter); + if (decision == 0) return F_status_set_error(F_parameter); + if (choices.id == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (choices.used == 0) return f_no_data; - if (parameters.used == 0) return f_no_data; + if (choices.used == 0) return F_data_not; + if (parameters.used == 0) return F_data_not; f_array_length location = 0; f_array_length location_sub = 0; f_console_parameter_id priority = 0; for (f_array_length i = 0; i < choices.used; i++) { - if (choices.id[i] > parameters.used) return f_status_set_error(f_invalid_parameter); + if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter); if (parameters.parameter[choices.id[i]].result == f_console_result_found) { if (parameters.parameter[choices.id[i]].location < location) { @@ -347,31 +347,31 @@ extern "C" { // The first parameter location (argc = 0) is the program name, therefore if the location is 0, then no matches were found. if (location == 0) { - return f_no_data; + return F_data_not; } *decision = priority; - return f_none; + return F_none; } #endif // _di_f_console_parameter_prioritize_left_ #ifndef _di_f_console_parameter_prioritize_right_ f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) { #ifndef _di_level_0_parameter_checking_ - if (decision == 0) return f_status_set_error(f_invalid_parameter); - if (choices.id == 0) return f_status_set_error(f_invalid_parameter); + if (decision == 0) return F_status_set_error(F_parameter); + if (choices.id == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (choices.used == 0) return f_no_data; - if (parameters.used == 0) return f_no_data; + if (choices.used == 0) return F_data_not; + if (parameters.used == 0) return F_data_not; f_array_length location = 0; f_array_length location_sub = 0; f_console_parameter_id priority = 0; for (f_array_length i = 0; i < choices.used; i++) { - if (choices.id[i] > parameters.used) return f_status_set_error(f_invalid_parameter); + if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter); if (parameters.parameter[choices.id[i]].result == f_console_result_found) { if (parameters.parameter[choices.id[i]].location > location) { @@ -388,12 +388,12 @@ extern "C" { // The first parameter location (argc = 0) is the program name, therefore if the location is 0, then no matches were found. if (location == 0) { - return f_no_data; + return F_data_not; } *decision = priority; - return f_none; + return F_none; } #endif // _di_f_console_parameter_prioritize_right_ diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index f5b81d2..645118a 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -284,9 +284,9 @@ extern "C" { * The resulting console type code determined by this function. * * @return - * f_none on success. - * f_no_data the input string is empty. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not the input string is empty. + * F_memory_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); @@ -324,12 +324,12 @@ extern "C" { * A list of remaining parameters not associated with anything. * * @return - * f_none on success. - * f_no_data if "additional" parameters were expected but not found. - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if "additional" parameters were expected but not found. + * F_failure (with error bit) if width is not long enough to convert when processing arguments as UTF-8. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character, when processing arguments. + * F_memory_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); @@ -357,9 +357,9 @@ extern "C" { * If none of the parameters are found, then this will not be updated (therefore it is safe to have it pre-initialized to the default). * * @return - * f_none on success. - * f_no_data if no parameters were found. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not if no parameters were found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_console_parameter_prioritize_left_ extern f_return_status f_console_parameter_prioritize_left(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision); @@ -387,9 +387,9 @@ extern "C" { * If none of the parameters are found, then this will not be updated (therefore it is safe to have it pre-initialized to the default). * * @return - * f_none on success. - * f_no_data if no parameters were found. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not if no parameters were found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_console_parameter_prioritize_right_ extern f_return_status f_console_parameter_prioritize_right(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision); diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index 35140d1..2a83b70 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -8,10 +8,10 @@ extern "C" { f_return_status f_conversion_character_is_binary(const int8_t character) { if (character == 0x30 || character == 0x31) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_conversion_character_is_binary_ @@ -19,10 +19,10 @@ extern "C" { f_return_status f_conversion_character_is_decimal(const int8_t character) { if (character > 0x29 && character < 0x40) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_conversion_character_is_decimal_ @@ -30,18 +30,18 @@ extern "C" { f_return_status f_conversion_character_is_duodecimal(const int8_t character) { if (character > 0x29 && character < 0x40) { - return f_true; + return F_true; } if (character == 0x41 || character == 0x42) { - return f_true; + return F_true; } if (character == 0x61 || character == 0x62) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_conversion_character_is_duodecimal_ @@ -49,16 +49,16 @@ extern "C" { f_return_status f_conversion_character_is_hexidecimal(const int8_t character) { if (character > 0x29 && character < 0x40) { - return f_true; + return F_true; } else if (character > 0x40 && character < 0x47) { - return f_true; + return F_true; } else if (character > 0x60 && character < 0x67) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_conversion_character_is_hexidecimal_ @@ -66,34 +66,34 @@ extern "C" { f_return_status f_conversion_character_is_octal(const int8_t character) { if (character > 0x29 && character < 0x38) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_conversion_character_is_octal_ #ifndef _di_f_conversion_character_to_binary_ f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ - if (number == 0) return f_status_set_error(f_invalid_parameter); + if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { case 0x30: *number = 0; break; case 0x31: *number = 1; break; default: - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } - return f_none; + return F_none; } #endif // _di_f_conversion_character_to_binary_ #ifndef _di_f_conversion_character_to_decimal_ f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ - if (number == 0) return f_status_set_error(f_invalid_parameter); + if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -108,17 +108,17 @@ extern "C" { case 0x38: *number = 8; break; case 0x39: *number = 9; break; default: - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } - return f_none; + return F_none; } #endif // _di_f_conversion_character_to_decimal_ #ifndef _di_f_conversion_character_to_duodecimal_ f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *decimal) { #ifndef _di_level_0_parameter_checking_ - if (decimal == 0) return f_status_set_error(f_invalid_parameter); + if (decimal == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -137,17 +137,17 @@ extern "C" { case 0x61: *decimal = 10; break; case 0x62: *decimal = 11; break; default: - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } - return f_none; + return F_none; } #endif // _di_f_conversion_character_to_duodecimal_ #ifndef _di_f_conversion_character_to_hexidecimal_ f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *decimal) { #ifndef _di_level_0_parameter_checking_ - if (decimal == 0) return f_status_set_error(f_invalid_parameter); + if (decimal == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -174,17 +174,17 @@ extern "C" { case 0x65: *decimal = 14; break; case 0x66: *decimal = 15; break; default: - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } - return f_none; + return F_none; } #endif // _di_f_conversion_character_to_hexidecimal_ #ifndef _di_f_conversion_character_to_octal_ f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ - if (number == 0) return f_status_set_error(f_invalid_parameter); + if (number == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ switch (character) { @@ -197,20 +197,20 @@ extern "C" { case 0x36: *number = 6; break; case 0x37: *number = 7; break; default: - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } - return f_none; + return F_none; } #endif // _di_f_conversion_character_to_octal_ #ifndef _di_f_conversion_string_to_binary_signed_ f_return_status f_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -218,13 +218,13 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_binary(string[i], &digit) == f_none) { + if (f_conversion_character_to_binary(string[i], &digit) == F_none) { if (scale) { scale++; if (negative) { if (scale > f_conversion_scale_binary_signed) { - return f_status_set_error(f_number_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_number_overflow); + return F_status_set_error(F_number_overflow); } converted <<= 1; @@ -251,22 +251,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_binary_signed_ #ifndef _di_f_conversion_string_to_binary_unsigned_ f_return_status f_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -274,12 +274,12 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_binary(string[i], &digit) == f_none) { + if (f_conversion_character_to_binary(string[i], &digit) == F_none) { if (scale) { scale++; if (scale > f_conversion_scale_binary_unsigned) { - return f_status_set_error(f_number_overflow); + return F_status_set_error(F_number_overflow); } converted <<= 1; @@ -291,22 +291,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_binary_unsigned_ #ifndef _di_f_conversion_string_to_decimal_signed_ f_return_status f_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -314,7 +314,7 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_decimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_decimal(string[i], &digit) == F_none) { if (scale) { scale++; @@ -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_number_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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -352,22 +352,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_decimal_signed_ #ifndef _di_f_conversion_string_to_decimal_unsigned_ f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -375,14 +375,14 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_decimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_decimal(string[i], &digit) == F_none) { if (scale) { scale++; 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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -395,22 +395,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_decimal_unsigned_ #ifndef _di_f_conversion_string_to_duodecimal_signed_ f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -418,7 +418,7 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_duodecimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) { if (scale) { scale++; @@ -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_number_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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -456,22 +456,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_duodecimal_signed_ #ifndef _di_f_conversion_string_to_duodecimal_unsigned_ f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -479,14 +479,14 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_duodecimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) { if (scale) { scale++; 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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -499,22 +499,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_duodecimal_unsigned_ #ifndef _di_f_conversion_string_to_hexidecimal_signed_ f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -522,7 +522,7 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_hexidecimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) { if (scale) { scale++; @@ -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_number_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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -560,22 +560,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_hexidecimal_signed_ #ifndef _di_f_conversion_string_to_hexidecimal_unsigned_ f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -583,14 +583,14 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_hexidecimal(string[i], &digit) == f_none) { + if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) { if (scale) { scale++; 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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -603,22 +603,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_hexidecimal_unsigned_ #ifndef _di_f_conversion_string_to_octal_signed_ f_return_status f_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -626,7 +626,7 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_octal(string[i], &digit) == f_none) { + if (f_conversion_character_to_octal(string[i], &digit) == F_none) { if (scale) { scale++; @@ -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_number_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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -664,22 +664,22 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_octal_signed_ #ifndef _di_f_conversion_string_to_octal_unsigned_ f_return_status f_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; @@ -687,14 +687,14 @@ extern "C" { f_number_unsigned converted = 0; for (f_string_length i = range.start; i <= range.stop; i++) { - if (f_conversion_character_to_octal(string[i], &digit) == f_none) { + if (f_conversion_character_to_octal(string[i], &digit) == F_none) { if (scale) { scale++; 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_number_overflow); + return F_status_set_error(F_number_overflow); } } @@ -707,26 +707,26 @@ extern "C" { } } else if (string[i] != '\0') { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } // for *number = converted; - return f_none; + return F_none; } #endif // _di_f_conversion_string_to_octal_unsigned_ #ifndef _di_f_conversion_string_to_number_signed_ f_return_status f_conversion_string_to_number_signed(const f_string string, f_number_signed *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (string[0] == '\0') { - return f_status_set_error(f_no_data); + return F_status_set_error(F_data_not); } uint8_t width = 0; @@ -735,7 +735,7 @@ extern "C" { int8_t vector = 0; // 0 for assumed positive, 1 for explicit positive, -1 for negative. f_string_length j = 0; f_string_length offset = 0; - f_status status = f_none; + f_status status = F_none; for (f_string_length i = range.start; i <= range.stop; i++) { width = f_macro_utf_byte_width_is(string[i]); @@ -747,7 +747,7 @@ extern "C" { continue; } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } else { @@ -756,21 +756,21 @@ extern "C" { status = f_utf_is_whitespace(string + i, width_max); - if (status == f_true) { + if (status == F_true) { offset = i + 1; continue; } - if (f_status_is_error(status)) { - if (status == f_status_set_error(f_maybe)) { - status = f_status_set_error(f_incomplete_utf); + if (F_status_is_error(status)) { + if (status == F_status_set_error(F_maybe)) { + status = F_status_set_error(F_incomplete_utf); } return status; } } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } if (string[i] == 0x30) { @@ -779,7 +779,7 @@ extern "C" { // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'. if (j > range.stop) { *number = 0; - return f_none; + return F_none; } else if (string[j] > 0x29 && string[j] < 0x3a) { mode = 10; @@ -801,7 +801,7 @@ extern "C" { offset += 2; } else { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } break; @@ -814,7 +814,7 @@ extern "C" { offset++; } else { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } @@ -825,20 +825,20 @@ extern "C" { offset++; } else { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } - if (f_conversion_character_is_decimal(string[i]) == f_true) { + if (f_conversion_character_is_decimal(string[i]) == F_true) { mode = 10; break; } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } // for if (mode == 0) { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } f_string_range location_offset = f_string_range_initialize; @@ -868,14 +868,14 @@ extern "C" { #ifndef _di_f_conversion_string_to_number_unsigned_ f_return_status f_conversion_string_to_number_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (number == 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (number == 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (string[0] == '\0') { - return f_status_set_error(f_no_data); + return F_status_set_error(F_data_not); } uint8_t width = 0; @@ -883,7 +883,7 @@ extern "C" { uint8_t mode = 0; f_string_length j = 0; f_string_length offset = 0; - f_status status = f_none; + f_status status = F_none; int8_t sign_found = 0; for (f_string_length i = range.start; i <= range.stop; i++) { @@ -896,7 +896,7 @@ extern "C" { continue; } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } } else { @@ -905,21 +905,21 @@ extern "C" { status = f_utf_is_whitespace(string + i, width_max); - if (status == f_true) { + if (status == F_true) { offset = i + 1; continue; } - if (f_status_is_error(status)) { - if (status == f_status_set_error(f_maybe)) { - status = f_status_set_error(f_incomplete_utf); + if (F_status_is_error(status)) { + if (status == F_status_set_error(F_maybe)) { + status = F_status_set_error(F_incomplete_utf); } return status; } } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } if (string[i] == 0x30) { @@ -928,7 +928,7 @@ extern "C" { // Immediate next value must be either a number, 'x', 'X', 'd', 'D', 'o', 'O', 'b', or 'B'. if (j > range.stop) { *number = 0; - return f_none; + return F_none; } else if (string[j] > 0x29 && string[j] < 0x3a) { mode = 10; @@ -950,7 +950,7 @@ extern "C" { offset += 2; } else { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } break; @@ -966,16 +966,16 @@ extern "C" { sign_found = -1; } - if (f_conversion_character_is_decimal(string[i]) == f_true) { + if (f_conversion_character_is_decimal(string[i]) == F_true) { mode = 10; break; } - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } // for if (mode == 0) { - return f_status_set_error(f_number_invalid); + return F_status_set_error(F_number_invalid); } f_string_range location_offset = f_string_range_initialize; @@ -1000,15 +1000,15 @@ extern "C" { // +/- signs are not allowed. if (sign_found) { - if (status == f_none) { + if (status == F_none) { if (sign_found == -1) { - return f_status_set_error(f_number_negative); + return F_status_set_error(F_number_negative); } - return f_status_set_error(f_number_positive); + return F_status_set_error(F_number_positive); } - return f_status_set_error(f_number_invalid); + 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 3c3fbd5..a3084cf 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -89,8 +89,8 @@ extern "C" { * The character to validate. * * @return - * f_true if character is a binary. - * f_false if character is not a binary. + * F_true if character is a binary. + * F_false if character is not a binary. */ #ifndef _di_f_conversion_character_is_binary_ extern f_return_status f_conversion_character_is_binary(const int8_t character); @@ -103,8 +103,8 @@ extern "C" { * The character to validate. * * @return - * f_true if character is a decimal. - * f_false if character is not a decimal. + * F_true if character is a decimal. + * F_false if character is not a decimal. */ #ifndef _di_f_conversion_character_is_decimal_ extern f_return_status f_conversion_character_is_decimal(const int8_t character); @@ -117,8 +117,8 @@ extern "C" { * The character to validate. * * @return - * f_true if character is a duodecimal. - * f_false if character is not a duodecimal. + * F_true if character is a duodecimal. + * F_false if character is not a duodecimal. */ #ifndef _di_f_conversion_character_is_duodecimal_ extern f_return_status f_conversion_character_is_duodecimal(const int8_t character); @@ -131,8 +131,8 @@ extern "C" { * The character to validate. * * @return - * f_true if character is a hexidecimal. - * f_false if character is not a hexidecimal. + * F_true if character is a hexidecimal. + * F_false if character is not a hexidecimal. */ #ifndef _di_f_conversion_character_is_hexidecimal_ extern f_return_status f_conversion_character_is_hexidecimal(const int8_t character); @@ -145,8 +145,8 @@ extern "C" { * The character to validate. * * @return - * f_true if character is an octal. - * f_false if character is not an octal. + * F_true if character is an octal. + * F_false if character is not an octal. */ #ifndef _di_f_conversion_character_is_octal_ extern f_return_status f_conversion_character_is_octal(const int8_t character); @@ -162,9 +162,9 @@ extern "C" { * This value is only changed on success. * * @return - * f_none if character was converted to a binary. - * 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_none if character was converted to a binary. + * F_number_invalid (with error bit) if no conversion was made due to non-binary values being found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_binary_ extern f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number); @@ -180,9 +180,9 @@ extern "C" { * This value is only changed on success. * * @return - * f_none if character was converted to a decimal. - * 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_none if character was converted to a decimal. + * F_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_decimal_ extern f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number); @@ -198,9 +198,9 @@ extern "C" { * This value is only changed on success. * * @return - * f_none if character was converted to a duodecimal. - * 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_none if character was converted to a duodecimal. + * F_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_duodecimal_ extern f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *number); @@ -216,9 +216,9 @@ extern "C" { * This value is only changed on success. * * @return - * f_none if character was converted to a hexidecimal. - * 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_none if character was converted to a hexidecimal. + * F_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_hexidecimal_ extern f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *number); @@ -234,9 +234,9 @@ extern "C" { * This value is only changed on success. * * @return - * f_none if character was converted to a hexidecimal. - * 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_none if character was converted to a hexidecimal. + * F_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_octal_ extern f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number); @@ -260,11 +260,11 @@ extern "C" { * Set to 0 to treat string as a positive number, 1 for as a negative number. * * @return - * f_none if the binary string was converted to an signed long. - * 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_number_overflow (with error bit) on integer overflow. - * f_number_underflow (with error bit) on integer underflow. + * F_none if the binary string was converted to an signed long. + * F_number_invalid (with error bit) if no conversion was made due to non-binary values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. + * F_number_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_binary_signed_ extern f_return_status f_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -286,10 +286,10 @@ extern "C" { * The start/stop range to convert. * * @return - * f_none if the binary string was converted to an unsigned long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the binary string was converted to an unsigned long. + * F_number_invalid (with error bit) if no conversion was made due to non-binary values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_binary_unsigned_ extern f_return_status f_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -313,11 +313,11 @@ extern "C" { * Set to 0 to treat string as a positive number, 1 for as a negative number. * * @return - * f_none if the decimal string was converted to an signed long. - * 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_number_overflow (with error bit) on integer overflow. - * f_number_underflow (with error bit) on integer underflow. + * F_none if the decimal string was converted to an signed long. + * F_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. + * F_number_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_decimal_signed_ extern f_return_status f_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -339,10 +339,10 @@ extern "C" { * The start/stop range to convert. * * @return - * f_none if the decimal string was converted to an unsigned long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the decimal string was converted to an unsigned long. + * F_number_invalid (with error bit) if no conversion was made due to non-decimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_decimal_unsigned_ extern f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -366,11 +366,11 @@ extern "C" { * Set to 0 to treat string as a positive number, 1 for as a negative number. * * @return - * f_none if the duodecimal string was converted to an signed long. - * 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_number_overflow (with error bit) on integer overflow. - * f_number_underflow (with error bit) on integer underflow. + * F_none if the duodecimal string was converted to an signed long. + * F_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. + * F_number_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_duodecimal_signed_ extern f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -392,10 +392,10 @@ extern "C" { * The start/stop range to convert. * * @return - * f_none if the duodecimal string was converted to an unsigned long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the duodecimal string was converted to an unsigned long. + * F_number_invalid (with error bit) if no conversion was made due to non-duodecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_duodecimal_unsigned_ extern f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -419,11 +419,11 @@ extern "C" { * Set to 0 to treat string as a positive number, 1 for as a negative number. * * @return - * f_none if the hexidecimal string was converted to an signed long. - * 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_number_overflow (with error bit) on integer overflow. - * f_number_underflow (with error bit) on integer underflow. + * F_none if the hexidecimal string was converted to an signed long. + * F_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. + * F_number_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_hexidecimal_signed_ extern f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -445,10 +445,10 @@ extern "C" { * The start/stop range to convert. * * @return - * f_none if the hexidecimal string was converted to an unsigned long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the hexidecimal string was converted to an unsigned long. + * F_number_invalid (with error bit) if no conversion was made due to non-hexidecimal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_hexidecimal_unsigned_ extern f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -472,10 +472,10 @@ extern "C" { * Set to 0 to treat string as a positive number, 1 for as a negative number. * * @return - * f_none if the octal string was converted to an signed long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the octal string was converted to an signed long. + * F_number_invalid (with error bit) if no conversion was made due to non-octal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_octal_signed_ extern f_return_status f_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_range range, const bool negative); @@ -497,10 +497,10 @@ extern "C" { * The start/stop range to convert. * * @return - * f_none if the octal string was converted to an unsigned long. - * 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_number_overflow (with error bit) on integer overflow. + * F_none if the octal string was converted to an unsigned long. + * F_number_invalid (with error bit) if no conversion was made due to non-octal values being found. + * F_parameter (with error bit) if a parameter is invalid. + * F_number_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_octal_unsigned_ extern f_return_status f_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_range range); @@ -534,13 +534,13 @@ extern "C" { * The start/stop range to convert. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts with a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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() */ @@ -577,14 +577,14 @@ extern "C" { * The start/stop range to convert. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts with a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_directory/c/directory.c b/level_0/f_directory/c/directory.c index 9614348..4088609 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -8,54 +8,54 @@ extern "C" { #ifndef _di_f_directory_create_ f_return_status f_directory_create(const f_string path, const mode_t mode) { if (mkdir(path, mode) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == EMLINK) return f_status_set_error(f_directory_error_link_max); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EMLINK) return F_status_set_error(F_directory_link_max); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_directory_create_ #ifndef _di_f_directory_create_at_ f_return_status f_directory_create_at(const int at_id, const f_string path, const mode_t mode) { #ifndef _di_level_0_parameter_checking_ - if (at_id <= 0) return f_status_set_error(f_invalid_parameter); + if (at_id <= 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (mkdirat(at_id, path, mode) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINVAL || errno == EBADF) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == EMLINK) return f_status_set_error(f_directory_error_link_max); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINVAL || errno == EBADF) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EMLINK) return F_status_set_error(F_directory_link_max); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_directory_create_at_ @@ -66,21 +66,21 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_false; - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_false; + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + + return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return f_true; + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; - return f_false; + return F_false; } #endif // _di_f_directory_exists_ @@ -91,21 +91,21 @@ extern "C" { memset(&file_stat, AT_SYMLINK_NOFOLLOW, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_false; - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_false; + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + + return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return f_true; + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; - return f_false; + return F_false; } #endif // _di_f_directory_is_ @@ -116,40 +116,40 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (fstatat(file_id, path, &file_stat, follow ? 0 : AT_SYMLINK_NOFOLLOW) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_false; - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_false; + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + + return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return f_true; + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; - return f_false; + return F_false; } #endif // _di_f_directory_is_at_ #ifndef _di_f_directory_list_ f_return_status f_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_string_dynamics *names) { #ifndef _di_level_0_parameter_checking_ - if (names == 0) return f_status_set_error(f_invalid_parameter); + if (names == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ struct dirent **listing = 0; size_t i = 0; f_string_length size = 0; - f_status status = f_none; + f_status status = F_none; const size_t length = scandir(path, &listing, filter, sort); if (length == -1) { - if (errno == ENOMEM) return f_status_set_error(f_error_allocation); - else return f_status_set_error(f_failure); + if (errno == ENOMEM) return F_status_set_error(F_memory_allocation); + else return F_status_set_error(F_failure); } for (; i < length; i++) { @@ -163,11 +163,11 @@ extern "C" { if (names->used >= names->size) { f_macro_string_dynamics_resize(status, (*names), names->size + f_directory_default_allocation_step); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } f_macro_string_dynamic_new(status, names->array[names->used], size); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; memcpy(names->array[names->used].string, listing[i]->d_name, size); names->array[names->used].used = size; @@ -182,17 +182,17 @@ extern "C" { f_memory_delete((void **) & listing, sizeof(struct dirent *), 1); - if (f_status_is_error(status)) return status; - if (length == 0) return f_no_data; + if (F_status_is_error(status)) return status; + if (length == 0) return F_data_not; - return f_none; + return F_none; } #endif // _di_f_directory_list_ #ifndef _di_f_directory_remove_ f_return_status f_directory_remove(const f_string path, const int recursion_max, const bool preserve) { #ifndef _di_level_0_parameter_checking_ - if (recursion_max < 0) return f_status_set_error(f_invalid_parameter); + if (recursion_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ int result = 0; @@ -206,40 +206,40 @@ extern "C" { } else { // Not recursively deleting and the path is requested to be preserved, so there is nothing to delete. - if (preserve) return f_none; + if (preserve) return F_none; result = remove(path); } if (result < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EBUSY) return f_status_set_error(f_busy); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EMFILE) return f_status_set_error(f_file_max_descriptors); - if (errno == ENFILE) return f_status_set_error(f_file_max_open); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EMFILE) return F_status_set_error(F_file_descriptors_max); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); + if (errno == EINVAL) return F_status_set_error(F_parameter); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_directory_remove_ #ifndef _di_f_directory_remove_custom_ f_return_status f_directory_remove_custom(const f_string path, const int recursion_max, const bool preserve, int (*custom) (const char *, const struct stat *, int, struct FTW *)) { #ifndef _di_level_0_parameter_checking_ - if (recursion_max < 0) return f_status_set_error(f_invalid_parameter); + if (recursion_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ int result = 0; @@ -253,33 +253,33 @@ extern "C" { } else { // Not recursively deleting and the path is requested to be preserved, so there is nothing to delete. - if (preserve) return f_none; + if (preserve) return F_none; result = remove(path); } if (result < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EBUSY) return f_status_set_error(f_busy); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EMFILE) return f_status_set_error(f_file_max_descriptors); - if (errno == ENFILE) return f_status_set_error(f_file_max_open); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EMFILE) return F_status_set_error(F_file_descriptors_max); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); + if (errno == EINVAL) return F_status_set_error(F_parameter); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_directory_remove_custom_ diff --git a/level_0/f_directory/c/directory.h b/level_0/f_directory/c/directory.h index 6c1e537..5c7ce6f 100644 --- a/level_0/f_directory/c/directory.h +++ b/level_0/f_directory/c/directory.h @@ -85,23 +85,23 @@ extern "C" { #define f_macro_directory_listing_delete(status, listing) \ f_macro_string_dynamics_delete(status, listing.block) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.character) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.directory) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.file) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.link) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.pipe) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.socket) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.character) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.directory) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.file) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.link) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.pipe) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.socket) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) #define f_macro_directory_listing_destroy(status, listing) \ f_macro_string_dynamics_destroy(status, listing.block) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.character) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.directory) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.file) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.link) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.pipe) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.socket) \ - if (!f_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.character) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.directory) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.file) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.link) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.pipe) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_destroy(status, listing.socket) \ + if (!F_status_is_error(status)) f_macro_string_dynamics_delete(status, listing.unknown) #define f_macro_directory_listing_delete_simple(listing) \ f_macro_string_dynamics_delete_simple(listing.block) \ @@ -199,21 +199,21 @@ extern "C" { * The directory mode to use when creating. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if a file within the path is not found (such as a broken symbolic link). - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_directory_error_link_max (with error bit) max links limit reached or exceeded. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * * @see mkdir() */ @@ -232,21 +232,21 @@ extern "C" { * The directory mode to use when creating. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if a file within the path is not found (such as a broken symbolic link). - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_directory_error_link_max (with error bit) max links limit reached or exceeded. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if a file within the path is not found (such as a broken symbolic link). + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory_link_max (with error bit) max links limit reached or exceeded. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. * * @see mkdir() */ @@ -262,14 +262,14 @@ extern "C" { * * @return * t_true if path was found and path is a directory (or a symlink to a directory). - * f_false if path was found and path is not a directory. - * f_file_not_found if the path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was found and path is not a directory. + * F_file_found_not if the path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstat() */ @@ -285,14 +285,14 @@ extern "C" { * * @return * t_true if path was found and path is a directory. - * f_false if path was found and path is not a directory (this includes symlinks). - * f_file_not_found if the path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was found and path is not a directory (this includes symlinks). + * F_file_found_not if the path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstat() */ @@ -313,14 +313,14 @@ extern "C" { * * @return * t_true if path was found and path is a directory. - * f_false if path was found and path is not a directory. - * f_file_not_found if the path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was found and path is not a directory. + * F_file_found_not if the path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() */ @@ -346,11 +346,11 @@ extern "C" { * Will be populated with the names of each file and/or directory inside path. * * @return - * f_none on success. - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not 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_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see alphasort() * @see scandir() @@ -374,23 +374,23 @@ extern "C" { * When recursion_max is 0, then this should only be FALSE (setting this to TRUE would be a no-op). * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_busy (with error bit) if file is busy. - * f_error_input_output (with error bit) if an I/O error occurred. - * f_file_is_type_directory (with error bit) file is a directory (directories cannot be removed via this function). - * f_loop (with error bit) on loop error. - * f_invalid_name (with error bit) on path name error. - * f_file_not_found (with error bit) if file not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (unlink()) error. - * f_number_overflow (with error bit) on integer overflow. - * f_file_max_descriptors (with error bit) if max file descriptors was reached. - * f_file_max_open (with error bit) too many open files. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_busy (with error bit) if file is busy. + * F_input_output (with error bit) if an I/O error occurred. + * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_loop (with error bit) on loop error. + * F_name (with error bit) on path name error. + * F_file_found_not (with error bit) if file not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (unlink()) error. + * F_number_overflow (with error bit) on integer overflow. + * F_file_descriptors_max (with error bit) if max file descriptors was reached. + * F_file_open_max (with error bit) too many open files. * * @see nftw() * @see remove() @@ -416,20 +416,20 @@ extern "C" { * Such as a custom function for verbose printing of removed files. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_busy (with error bit) if file is busy. - * f_error_input_output (with error bit) if an I/O error occurred. - * f_file_is_type_directory (with error bit) file is a directory (directories cannot be removed via this function). - * f_loop (with error bit) on loop error. - * f_invalid_name (with error bit) on path name error. - * f_file_not_found (with error bit) if file not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (unlink()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_busy (with error bit) if file is busy. + * F_input_output (with error bit) if an I/O error occurred. + * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_loop (with error bit) on loop error. + * F_name (with error bit) on path name error. + * F_file_found_not (with error bit) if file not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (unlink()) error. * * @see nftw() * @see remove() diff --git a/level_0/f_environment/c/environment.c b/level_0/f_environment/c/environment.c index 5509cf9..ccca086 100644 --- a/level_0/f_environment/c/environment.c +++ b/level_0/f_environment/c/environment.c @@ -8,10 +8,10 @@ extern "C" { #ifndef _di_f_environment_clear_ f_return_status f_environment_clear() { if (clearenv() == 0) { - return f_none; + return F_none; } - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } #endif // _di_f_environment_clear_ @@ -24,11 +24,11 @@ extern "C" { #ifndef _di_f_environment_get_dynamic_ f_return_status f_environment_get_dynamic(const f_string_static name, f_string_dynamic *value) { #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return f_status_set_error(f_invalid_parameter); - if (value->used > value->size) return f_status_set_error(f_invalid_parameter); + if (name.used > name.size) return F_status_set_error(F_parameter); + if (value->used > value->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (name.used == 0) return f_no_data; + if (name.used == 0) return F_data_not; if (name.string[name.used - 1] == 0) { return private_f_environment_get(name.string, value); @@ -52,11 +52,11 @@ extern "C" { #ifndef _di_f_environment_set_dynamic_ f_return_status f_environment_set_dynamic(const f_string_static name, const f_string_static value, const bool replace) { #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return f_status_set_error(f_invalid_parameter); - if (value.used > value.size) return f_status_set_error(f_invalid_parameter); + if (name.used > name.size) return F_status_set_error(F_parameter); + if (value.used > value.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (name.used == 0) return f_no_data; + if (name.used == 0) return F_data_not; if (name.string[name.used - 1] == 0) { if (value.used > 0 && value.string[value.used - 1] == 0) { @@ -104,10 +104,10 @@ extern "C" { #ifndef _di_f_environment_unset_ f_return_status f_environment_unset_dynamic(const f_string_static name) { #ifndef _di_level_0_parameter_checking_ - if (name.used > name.size) return f_status_set_error(f_invalid_parameter); + if (name.used > name.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (name.used == 0) return f_no_data; + if (name.used == 0) return F_data_not; if (name.string[name.used - 1] == 0) { return private_f_environment_unset(name.string); diff --git a/level_0/f_environment/c/environment.h b/level_0/f_environment/c/environment.h index bae2d02..621889f 100644 --- a/level_0/f_environment/c/environment.h +++ b/level_0/f_environment/c/environment.h @@ -35,8 +35,8 @@ extern "C" { * Delete all environment variables. * * @return - * f_none on success. - * f_failure (with error bit) on failure. + * F_none on success. + * F_failure (with error bit) on failure. * * @see clearenv() */ @@ -59,10 +59,10 @@ extern "C" { * The value will be appended (set value->used to 0 to replace). * * @return - * f_none on success. - * f_does_not_exist if name does not exist. - * f_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_exist_not if name does not exist. + * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see getenv() */ @@ -85,12 +85,12 @@ extern "C" { * The value will be appended (set value->used to 0 to replace). * * @return - * f_none on success. - * f_does_not_exist if name does not exist. - * f_no_data if name.used is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_exist_not if name does not exist. + * F_data_not if name.used is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see getenv() */ @@ -115,10 +115,10 @@ extern "C" { * Set to FALSE to not replace value if name already exists. * * @return - * f_none on success. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. * * @see setenv() */ @@ -143,12 +143,12 @@ extern "C" { * Set to FALSE to not replace value if name already exists. * * @return - * f_none on success. - * f_no_data if name.used is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_data_not if name.used is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. * * @see setenv() */ @@ -165,10 +165,10 @@ extern "C" { * The name must be NULL terminated. * * @return - * f_none on success. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. * * @see unsetenv() */ @@ -185,11 +185,11 @@ extern "C" { * The name need not be NULL terminated. * * @return - * f_none on success. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. + * F_parameter (with error bit) if a parameter is invalid. * * @see unsetenv() */ diff --git a/level_0/f_environment/c/private-environment.c b/level_0/f_environment/c/private-environment.c index de49359..a65ef96 100644 --- a/level_0/f_environment/c/private-environment.c +++ b/level_0/f_environment/c/private-environment.c @@ -10,7 +10,7 @@ extern "C" { const f_string result = getenv(name); if (result == 0) { - return f_does_not_exist; + return F_exist_not; } const f_string_length size = strnlen(result, f_environment_max_length); @@ -20,21 +20,21 @@ extern "C" { } else { if (value->used + size > f_environment_max_length) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } if (value->used + size > value->size) { - f_status status = f_none; + f_status status = F_none; f_macro_string_dynamic_resize(status, (*value), size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(value->string + value->used, result, value->used + size); value->used = size; } - return f_none; + return F_none; } #endif // !defined(_di_f_environment_get_) || !defined(_di_f_environment_get_dynamic_) @@ -42,16 +42,16 @@ extern "C" { f_return_status private_f_environment_set(const f_string name, const f_string value, const bool replace) { if (setenv(name, value, replace) < 0) { if (errno == EINVAL) { - return f_status_set_error(f_invalid); + return F_status_set_error(F_invalid); } else if (errno == ENOMEM) { - return f_status_set_error(f_out_of_memory); + return F_status_set_error(F_memory_out); } - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_environment_set_) || !defined(_di_f_environment_set_dynamic_) @@ -59,16 +59,16 @@ extern "C" { f_return_status private_f_environment_unset(const f_string name) { if (unsetenv(name) < 0) { if (errno == EINVAL) { - return f_status_set_error(f_invalid); + return F_status_set_error(F_invalid); } else if (errno == ENOMEM) { - return f_status_set_error(f_out_of_memory); + return F_status_set_error(F_memory_out); } - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_environment_unset_) || !defined(_di_f_environment_unset_dynamic_) diff --git a/level_0/f_environment/c/private-environment.h b/level_0/f_environment/c/private-environment.h index 4dc80b4..a031ed8 100644 --- a/level_0/f_environment/c/private-environment.h +++ b/level_0/f_environment/c/private-environment.h @@ -29,10 +29,10 @@ extern "C" { * The value will be appended (set value->used to 0 to replace). * * @return - * f_none on success. - * f_does_not_exist if name does not exist. - * f_string_too_large (with error bit) if appended string length is too large to store in the buffer. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_exist_not if name does not exist. + * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see f_environment_get() * @see f_environment_get_dynamic() @@ -56,10 +56,10 @@ extern "C" { * Set to FALSE to not replace value if name already exists. * * @return - * f_none on success. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. * * @see f_environment_set() * @see f_environment_set_dynamic() @@ -76,10 +76,10 @@ extern "C" { * The name string must not contain the '=' character. * * @return - * f_none on success. - * f_invalid (with error bit) if name is an invalid string. - * f_out_of_memory (with error bit) on out of memory. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_invalid (with error bit) if name is an invalid string. + * F_memory_out (with error bit) on out of memory. + * F_failure (with error bit) on any other error. * * @see f_environment_unset() * @see f_environment_unset_dynamic() diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index c7a1c56..6f82e19 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -8,23 +8,23 @@ extern "C" { #ifndef _di_f_file_access_ f_return_status f_file_access(const f_string path) { #ifndef _di_level_0_parameter_checking_ - if (path == 0) return f_status_set_error(f_invalid_parameter); + if (path == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (access(path, F_OK)) { - if (errno == ENOENT) return f_false; - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); + if (errno == ENOENT) return F_false; + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); - return f_status_set_error(f_false); + return F_status_set_error(F_false); } - return f_true; + return F_true; } #endif // _di_f_file_access_ @@ -55,105 +55,105 @@ extern "C" { #ifndef _di_f_file_copy_ f_return_status f_file_copy(const f_string source, const f_string destination, const mode_t mode, const f_number_unsigned size_block, const bool exclusive) { #ifndef _di_level_0_parameter_checking_ - if (size_block == 0) return f_status_set_error(f_invalid_parameter); + if (size_block == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); - status = private_f_file_stat(source, &source_stat, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_stat(source, &source_stat, F_false); + if (F_status_is_error(status)) return status; if (f_macro_file_type_is_file(source_stat.st_mode)) { - status = private_f_file_create(destination, mode, exclusive, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_create(destination, mode, exclusive, F_false); + if (F_status_is_error(status)) return status; if (!exclusive) { - status = private_f_file_change_mode(destination, mode, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_mode(destination, mode, F_false); + if (F_status_is_error(status)) return status; } return private_f_file_copy_content(source, destination, size_block); } else if (f_macro_file_type_is_link(source_stat.st_mode)) { status = private_f_file_link(destination, source); - if (f_status_set_fine(status) == f_file_found) { + if (F_status_set_fine(status) == F_file_found) { if (exclusive) return status; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } - status = private_f_file_change_mode(destination, mode, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_mode(destination, mode, F_false); + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } - return f_unsupported; + return F_unsupported; } #endif // _di_f_file_copy_ #ifndef _di_f_file_clone_ f_return_status f_file_clone(const f_string source, const f_string destination, const f_number_unsigned size_block, const bool exclusive, const bool roles) { #ifndef _di_level_0_parameter_checking_ - if (size_block == 0) return f_status_set_error(f_invalid_parameter); + if (size_block == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; struct stat source_stat; memset(&source_stat, 0, sizeof(struct stat)); - status = private_f_file_stat(source, &source_stat, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_stat(source, &source_stat, F_false); + if (F_status_is_error(status)) return status; if (f_macro_file_type_is_file(source_stat.st_mode)) { - status = private_f_file_create(destination, source_stat.st_mode, exclusive, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_create(destination, source_stat.st_mode, exclusive, F_false); + if (F_status_is_error(status)) return status; if (!exclusive) { - status = private_f_file_change_mode(destination, source_stat.st_mode, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_mode(destination, source_stat.st_mode, F_false); + if (F_status_is_error(status)) return status; } if (roles) { - status = private_f_file_change_owner(destination, source_stat.st_uid, source_stat.st_gid, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_owner(destination, source_stat.st_uid, source_stat.st_gid, F_false); + if (F_status_is_error(status)) return status; } return private_f_file_copy_content(source, destination, size_block); } else if (f_macro_file_type_is_link(source_stat.st_mode)) { status = private_f_file_link(destination, source); - if (f_status_set_fine(status) == f_file_found) { + if (F_status_set_fine(status) == F_file_found) { if (exclusive) return status; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } - status = private_f_file_change_mode(destination, source_stat.st_mode, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_mode(destination, source_stat.st_mode, F_false); + if (F_status_is_error(status)) return status; if (roles) { - status = private_f_file_change_owner(destination, source_stat.st_uid, source_stat.st_gid, f_false); - if (f_status_is_error(status)) return status; + status = private_f_file_change_owner(destination, source_stat.st_uid, source_stat.st_gid, F_false); + if (F_status_is_error(status)) return status; } - return f_none; + return F_none; } - return f_unsupported; + return F_unsupported; } #endif // _di_f_file_clone_ #ifndef _di_f_file_close_ f_return_status f_file_close(int *id) { #ifndef _di_level_0_parameter_checking_ - if (id == 0) return f_status_set_error(f_invalid_parameter); + if (id == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_close(id); @@ -179,19 +179,19 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_false; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_false; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } - return f_true; + return F_true; } #endif // _di_f_file_exists_ @@ -202,19 +202,19 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (fstatat(at_id, path, &file_stat, follow ? 0 : AT_SYMLINK_NOFOLLOW) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } - return f_true; + return F_true; } #endif // _di_f_file_exists_at_ @@ -240,27 +240,27 @@ extern "C" { f_return_status f_file_link_hard(const f_string target, const f_string point) { if (link(target, point) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); - } - - return f_none; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); + } + + return F_none; } #endif // _di_f_file_link_hard_ @@ -268,28 +268,28 @@ extern "C" { f_return_status f_file_link_hard_at(const int at_id_target, const int at_id_point, const f_string target, const f_string point, const int flags) { if (linkat(at_id_target, target, at_id_point, point, flags) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); - } - - return f_none; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); + } + + return F_none; } #endif // _di_f_file_link_hard_at_ @@ -300,21 +300,21 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (stat(path, &file_stat) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } - if (f_macro_file_type_get(file_stat.st_mode) == type) return f_true; + if (f_macro_file_type_get(file_stat.st_mode) == type) return F_true; - return f_false; + return F_false; } #endif // _di_f_file_is_ @@ -325,28 +325,28 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); if (fstatat(at_id, path, &file_stat, follow ? 0 : AT_SYMLINK_NOFOLLOW) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } - if (file_stat.st_mode == (S_IFMT & S_IFDIR)) return f_true; + if (file_stat.st_mode == (S_IFMT & S_IFDIR)) return F_true; - return f_false; + return F_false; } #endif // _di_f_file_is_at_ #ifndef _di_f_file_open_ f_return_status f_file_open(const f_string path, const mode_t mode, f_file *file) { #ifndef _di_level_0_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_open(path, mode, file); @@ -356,7 +356,7 @@ extern "C" { #ifndef _di_f_file_open_at_ f_return_status f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) { #ifndef _di_level_0_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_open_at(at_id, path, mode, file); @@ -366,13 +366,13 @@ extern "C" { #ifndef _di_f_file_read_ f_return_status f_file_read(const f_file file, f_string_dynamic *buffer) { #ifndef _di_level_0_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; char buffer_read[file.size_read]; @@ -382,11 +382,11 @@ extern "C" { while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(buffer->string + buffer->used, buffer_read, size_read); @@ -394,35 +394,35 @@ extern "C" { } // while if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_read_ #ifndef _di_f_file_read_block_ f_return_status f_file_read_block(const f_file file, f_string_dynamic *buffer) { #ifndef _di_level_0_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; char buffer_read[file.size_read]; @@ -432,11 +432,11 @@ extern "C" { if ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(buffer->string + buffer->used, buffer_read, size_read); @@ -444,35 +444,35 @@ extern "C" { } if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_read_block_ #ifndef _di_f_file_read_until_ f_return_status f_file_read_until(const f_file file, f_string_dynamic *buffer, const f_string_length total) { #ifndef _di_level_0_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; f_string_length buffer_size = file.size_read; @@ -489,11 +489,11 @@ extern "C" { while (buffer_count < total && (size_read = read(file.id, buffer_read, buffer_size)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(buffer->string + buffer->used, buffer_read, size_read); @@ -502,22 +502,22 @@ extern "C" { } // while if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_read_until_ @@ -525,23 +525,23 @@ extern "C" { f_return_status f_file_remove(const f_string path) { if (unlink(path) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EBUSY) return f_status_set_error(f_busy); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_remove_ @@ -549,53 +549,53 @@ extern "C" { f_return_status f_file_remove_at(const int at_id, const f_string path, const int flags) { if (unlinkat(at_id, path, flags) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EBUSY) return f_status_set_error(f_busy); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EBUSY) return F_status_set_error(F_busy); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_remove_at_ #ifndef _di_f_file_seek_ f_return_status f_file_seek(const int id, const int whence, const f_string_length offset, f_string_length *seeked) { #ifndef _di_level_0_parameter_checking_ - if (id <= 0) return f_status_set_error(f_invalid_parameter); - if (whence < 0) return f_status_set_error(f_invalid_parameter); + if (id <= 0) return F_status_set_error(F_parameter); + if (whence < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ *seeked = lseek(id, offset, whence); if (*seeked < 0) { - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ENXIO) return f_status_set_error(f_out_of_bound); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ESPIPE) return f_status_set_error(f_file_is_type_pipe); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ENXIO) return F_status_set_error(F_bound_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ESPIPE) return F_status_set_error(F_file_type_pipe); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_f_file_seek_ #ifndef _di_f_file_size_ f_return_status f_file_size(const f_string path, const bool dereference, f_string_length *size) { #ifndef _di_level_0_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ struct stat file_stat; @@ -604,19 +604,19 @@ extern "C" { f_status status = private_f_file_stat(path, dereference, &file_stat); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; *size = file_stat.st_size; - return f_none; + return F_none; } #endif // _di_f_file_size_ #ifndef _di_f_file_size_at_ f_return_status f_file_size_at(const int at_id, const f_string path, const bool dereference, f_string_length *size) { #ifndef _di_level_0_parameter_checking_ - if (at_id <= 0) return f_status_set_error(f_invalid_parameter); - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (at_id <= 0) return F_status_set_error(F_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ struct stat file_stat; @@ -625,19 +625,19 @@ extern "C" { f_status status = private_f_file_stat_at(at_id, path, dereference, &file_stat); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; *size = file_stat.st_size; - return f_none; + return F_none; } #endif // _di_f_file_size_at_ #ifndef _di_f_file_size_by_id_ f_return_status f_file_size_by_id(const int id, f_string_length *size) { #ifndef _di_level_0_parameter_checking_ - if (id <= 0) return f_status_set_error(f_invalid_parameter); - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (id <= 0) return F_status_set_error(F_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ struct stat file_stat; @@ -646,18 +646,18 @@ extern "C" { f_status status = private_f_file_stat_by_id(id, &file_stat); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; *size = file_stat.st_size; - return f_none; + return F_none; } #endif // _di_f_file_size_by_id_ #ifndef _di_f_file_stat_ f_return_status f_file_stat(const f_string path, const bool dereference, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ - if (file_stat == 0) return f_status_set_error(f_invalid_parameter); + if (file_stat == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_stat(path, dereference, file_stat); @@ -667,8 +667,8 @@ extern "C" { #ifndef _di_f_file_stat_at_ f_return_status f_file_stat_at(const int at_id, const f_string path, const int flags, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ - if (at_id <= 0) return f_status_set_error(f_invalid_parameter); - if (file_stat == 0) return f_status_set_error(f_invalid_parameter); + if (at_id <= 0) return F_status_set_error(F_parameter); + if (file_stat == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_stat_at(at_id, path, flags, file_stat); @@ -678,8 +678,8 @@ extern "C" { #ifndef _di_f_file_stat_by_id_ f_return_status f_file_stat_by_id(const int id, struct stat *file_stat) { #ifndef _di_level_0_parameter_checking_ - if (id <= 0) return f_status_set_error(f_invalid_parameter); - if (file_stat == 0) return f_status_set_error(f_invalid_parameter); + if (id <= 0) return F_status_set_error(F_parameter); + if (file_stat == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_f_file_stat_by_id(id, file_stat); @@ -689,33 +689,33 @@ extern "C" { #ifndef _di_f_file_write_ f_return_status f_file_write(const f_file file, const f_string_dynamic buffer, f_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { if (written) *written = 0; - return f_no_data; + return F_data_not; } - f_status status = f_none; + f_status status = F_none; if (written) { private_f_file_write_until(file, buffer.string, buffer.used, written); - if (status == f_none && *written == buffer.used) return f_none_on_eos; + if (status == F_none && *written == buffer.used) return F_none_eos; } else { f_string_length written_local = 0; private_f_file_write_until(file, buffer.string, buffer.used, &written_local); - if (status == f_none && written_local == buffer.used) return f_none_on_eos; + if (status == F_none && written_local == buffer.used) return F_none_eos; } - if (f_status_is_error(status)) return f_status_set_error(status); + if (F_status_is_error(status)) return F_status_set_error(status); return status; } @@ -724,15 +724,15 @@ extern "C" { #ifndef _di_f_file_write_block_ f_return_status f_file_write_block(const f_file file, const f_string_dynamic buffer, f_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { if (written) *written = 0; - return f_no_data; + return F_data_not; } f_string_length write_max = file.size_write; @@ -741,14 +741,14 @@ extern "C" { write_max = buffer.used; } - f_status status = f_none; + f_status status = F_none; if (written) { private_f_file_write_until(file, buffer.string, write_max, written); - if (status == f_none) { - if (*written == buffer.used) return f_none_on_eos; - if (*written == write_max) return f_none_on_stop; + if (status == F_none) { + if (*written == buffer.used) return F_none_eos; + if (*written == write_max) return F_none_stop; } } else { @@ -756,9 +756,9 @@ extern "C" { private_f_file_write_until(file, buffer.string, write_max, &written_local); - if (status == f_none) { - if (written_local == buffer.used) return f_none_on_eos; - if (written_local == write_max) return f_none_on_stop; + if (status == F_none) { + if (written_local == buffer.used) return F_none_eos; + if (written_local == write_max) return F_none_stop; } } @@ -769,15 +769,15 @@ extern "C" { #ifndef _di_f_file_write_until_ f_return_status f_file_write_until(const f_file file, const f_string_dynamic buffer, const f_string_length total, f_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0 || total == 0) { if (written) *written = 0; - return f_no_data; + return F_data_not; } f_string_length write_max = file.size_write; @@ -786,14 +786,14 @@ extern "C" { write_max = buffer.used; } - f_status status = f_none; + f_status status = F_none; if (written) { private_f_file_write_until(file, buffer.string, write_max, written); - if (status == f_none) { - if (*written == buffer.used) return f_none_on_eos; - if (*written == write_max) return f_none_on_stop; + if (status == F_none) { + if (*written == buffer.used) return F_none_eos; + if (*written == write_max) return F_none_stop; } } else { @@ -801,9 +801,9 @@ extern "C" { private_f_file_write_until(file, buffer.string, buffer.used, &written_local); - if (status == f_none) { - if (written_local == buffer.used) return f_none_on_eos; - if (written_local == write_max) return f_none_on_stop; + if (status == F_none) { + if (written_local == buffer.used) return F_none_eos; + if (written_local == write_max) return F_none_stop; } } @@ -814,17 +814,17 @@ extern "C" { #ifndef _di_f_file_write_range_ f_return_status f_file_write_range(const f_file file, const f_string_dynamic buffer, const f_string_range range, f_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { if (written) *written = 0; - return f_no_data; + return F_data_not; } const f_string_length total = (range.stop - range.start) + 1; @@ -834,14 +834,14 @@ extern "C" { write_max = buffer.used; } - f_status status = f_none; + f_status status = F_none; if (written) { private_f_file_write_until(file, buffer.string + range.start, write_max, written); - if (status == f_none) { - if (range.start + *written == buffer.used) return f_none_on_stop; - if (range.start + *written == total) return f_none_on_eos; + if (status == F_none) { + if (range.start + *written == buffer.used) return F_none_stop; + if (range.start + *written == total) return F_none_eos; } } else { @@ -849,9 +849,9 @@ extern "C" { private_f_file_write_until(file, buffer.string + range.start, write_max, &written_local); - if (status == f_none) { - if (range.start + written_local == buffer.used) return f_none_on_eos; - if (range.start + written_local == total) return f_none_on_stop; + if (status == F_none) { + if (range.start + written_local == buffer.used) return F_none_eos; + if (range.start + written_local == total) return F_none_stop; } } diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index efbec56..1ab7e0e 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -255,16 +255,16 @@ extern "C" { * The path file name. * * @return - * f_true if file exists. - * f_false if file does not exist. - * 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_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. - * f_false (with error bit) on unknown/unhandled errors. + * F_true if file exists. + * F_false if file does not exist. + * F_parameter (with error bit) if a parameter is invalid. + * F_name (with error bit) if the filename is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_false (with error bit) on unknown/unhandled errors. * * @see access() */ @@ -284,18 +284,18 @@ extern "C" { * Set to FALSE to operate on the symlink itself. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see chmod() */ @@ -316,18 +316,18 @@ extern "C" { * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see chmod() */ @@ -349,16 +349,16 @@ extern "C" { * Set to FALSE to operate on the symlink itself. * * @return - * f_true if file exists. - * f_false if file does not exist. - * 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_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. - * f_false (with error bit) on unknown/unhandled errors. + * F_true if file exists. + * F_false if file does not exist. + * F_parameter (with error bit) if a parameter is invalid. + * F_name (with error bit) if the filename is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_false (with error bit) on unknown/unhandled errors. * * @see chown() */ @@ -381,16 +381,16 @@ extern "C" { * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW. * * @return - * f_true if file exists. - * f_false if file does not exist. - * 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_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. - * f_false (with error bit) on unknown/unhandled errors. + * F_true if file exists. + * F_false if file does not exist. + * F_parameter (with error bit) if a parameter is invalid. + * F_name (with error bit) if the filename is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_false (with error bit) on unknown/unhandled errors. * * @see chown() */ @@ -418,26 +418,26 @@ extern "C" { * If FALSE, will not fail if file already exists (existing file will be replaced). * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. - * f_file_error_read (with error bit) on file read error. - * f_file_error_write (with error bit) on file write error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_read (with error bit) on file read error. + * F_file_write (with error bit) on file write error. */ #ifndef _di_f_file_copy_ extern f_return_status f_file_copy(const f_string source, const f_string destination, const mode_t mode, const f_number_unsigned size_block, const bool exclusive); @@ -468,26 +468,26 @@ extern "C" { * (In both cases the file mode is copied.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. - * f_file_error_read (with error bit) on file read error. - * f_file_error_write (with error bit) on file write error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_read (with error bit) on file read error. + * F_file_write (with error bit) on file write error. */ #ifndef _di_f_file_clone_ extern f_return_status f_file_clone(const f_string source, const f_string destination, const f_number_unsigned size_block, const bool exclusive, const bool roles); @@ -502,15 +502,15 @@ extern "C" { * The file descriptor. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_file_error_descriptor (with error bit) if file descriptor is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_error_synchronize (with error bit) on flush failure. - * f_file_error_close (with error bit) if fclose() failed for any other reason. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_file_descriptor (with error bit) if file descriptor is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_synchronize (with error bit) on flush failure. + * F_file_close (with error bit) if fclose() failed for any other reason. * * @see fclose() */ @@ -536,24 +536,24 @@ extern "C" { * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * * @see open() */ @@ -581,24 +581,24 @@ extern "C" { * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * * @see openat() */ @@ -617,14 +617,14 @@ extern "C" { * * @return * t_true if path was found. - * f_false if path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see stat() */ @@ -646,16 +646,16 @@ extern "C" { * Additional flags to pass, such as AT_EACCESS or AT_SYMLINK_NOFOLLOW. * * @return - * f_true if file exists. - * f_false if file does not exist. - * 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_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. - * f_false (with error bit) on unknown/unhandled errors. + * F_true if file exists. + * F_false if file does not exist. + * F_parameter (with error bit) if a parameter is invalid. + * F_name (with error bit) if the filename is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_false (with error bit) on unknown/unhandled errors. * * @see fstatat() */ @@ -670,14 +670,14 @@ extern "C" { * The file descriptor. * * @return - * f_none is returned on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_file_error_descriptor (with error bit) if file descriptor is invalid. - * f_error_input_output (with error bit) on I/O error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_unsupported (with error bit) if the file system or file type does not support flushing. - * f_failure (with error bit) on any other failure. + * F_none is returned on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_file_descriptor (with error bit) if file descriptor is invalid. + * F_input_output (with error bit) on I/O error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_unsupported (with error bit) if the file system or file type does not support flushing. + * F_failure (with error bit) on any other failure. * * @see fsync() */ @@ -698,15 +698,15 @@ extern "C" { * * @return * t_true if path was found and path is type. - * f_false if path was found and path is not type. - * f_file_not_found if the path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was found and path is not type. + * F_file_found_not if the path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see stat() */ @@ -729,15 +729,15 @@ extern "C" { * * @return * t_true if path was found and path is type. - * f_false if path was found and path is not type. - * f_file_not_found if the path was not found. - * f_invalid_name (with error bit) if the name is somehow invalid. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory. - * f_access_denied (with error bit) if access to the file was denied. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_false if path was found and path is not type. + * F_file_found_not if the path was not found. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() */ @@ -842,11 +842,11 @@ extern "C" { * This will be updated with the file descriptor and file address. * * @return - * f_none on success. - * f_file_not_found (with error bit) if the file was not found. - * 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. + * F_none on success. + * F_file_found_not (with error bit) if the file was not found. + * F_file_open (with error bit) if the file is already open. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). + * F_parameter (with error bit) if a parameter is invalid. * * @see open() */ @@ -871,11 +871,11 @@ extern "C" { * This will be updated with the file descriptor and file address. * * @return - * f_none on success. - * f_file_not_found (with error bit) if the file was not found. - * 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. + * F_none on success. + * F_file_found_not (with error bit) if the file was not found. + * F_file_open (with error bit) if the file is already open. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). + * F_parameter (with error bit) if a parameter is invalid. * * @see openat() */ @@ -896,16 +896,16 @@ extern "C" { * The contents of the file is appended into this buffer. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see read() */ @@ -926,16 +926,16 @@ extern "C" { * The contents of the file is appended into this buffer. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see read() */ @@ -957,16 +957,16 @@ extern "C" { * The total bytes to read, unless EOF is reached first. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see read() */ @@ -981,20 +981,20 @@ extern "C" { * The path file name. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_busy (with error bit) if file is busy. - * f_error_input_output (with error bit) if an I/O error occurred. - * f_file_is_type_directory (with error bit) file is a directory (directories cannot be removed via this function). - * f_loop (with error bit) on loop error. - * f_invalid_name (with error bit) on path name error. - * f_file_not_found (with error bit) if file not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (unlink()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_busy (with error bit) if file is busy. + * F_input_output (with error bit) if an I/O error occurred. + * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_loop (with error bit) on loop error. + * F_name (with error bit) on path name error. + * F_file_found_not (with error bit) if file not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (unlink()) error. * * @see unlink() */ @@ -1013,20 +1013,20 @@ extern "C" { * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_busy (with error bit) if file is busy. - * f_error_input_output (with error bit) if an I/O error occurred. - * f_file_is_type_directory (with error bit) file is a directory (directories cannot be removed via this function). - * f_loop (with error bit) on loop error. - * f_invalid_name (with error bit) on path name error. - * f_file_not_found (with error bit) if file not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (unlink()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_busy (with error bit) if file is busy. + * F_input_output (with error bit) if an I/O error occurred. + * F_file_type_directory (with error bit) file is a directory (directories cannot be removed via this function). + * F_loop (with error bit) on loop error. + * F_name (with error bit) on path name error. + * F_file_found_not (with error bit) if file not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (unlink()) error. * * @see unlinkat() */ @@ -1048,13 +1048,13 @@ extern "C" { * To be compared against offset. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_out_of_bound (with error bit) if SEEK_DATA or SEEK_HOLE is specified as whence and offset is beyond the end of file. - * f_number_overflow (with error bit) on overflow for offset. - * f_file_is_type_pipe (with error bit) if file descriptor represents a pipe, socket, or FIFO. - * f_failure (with error bit) on any other error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_bound_out (with error bit) if SEEK_DATA or SEEK_HOLE is specified as whence and offset is beyond the end of file. + * F_number_overflow (with error bit) on overflow for offset. + * F_file_type_pipe (with error bit) if file descriptor represents a pipe, socket, or FIFO. + * F_failure (with error bit) on any other error. * * @see lseek */ @@ -1074,15 +1074,15 @@ extern "C" { * This gets set to the size of the file. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat() */ @@ -1104,15 +1104,15 @@ extern "C" { * This gets set to the size of the file. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat_at() */ @@ -1129,15 +1129,15 @@ extern "C" { * This gets set to the size of the file. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_stat_by_id() */ @@ -1157,15 +1157,15 @@ extern "C" { * The statistics read. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see stat() */ @@ -1186,15 +1186,15 @@ extern "C" { * The statistics read. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstatat() */ @@ -1211,15 +1211,15 @@ extern "C" { * The statistics read. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see fstat() */ @@ -1240,16 +1240,16 @@ extern "C" { * Set pointer to 0 to not use. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see write() */ @@ -1272,16 +1272,16 @@ extern "C" { * Set pointer to 0 to not use. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see write() */ @@ -1304,17 +1304,17 @@ extern "C" { * Set pointer to 0 to not use. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see write() */ @@ -1337,17 +1337,17 @@ extern "C" { * Set pointer to 0 to not use. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see write() */ diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index fca39e3..c83c515 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -9,21 +9,21 @@ extern "C" { f_return_status private_f_file_change_mode(const f_string path, const mode_t mode, const bool dereference) { if ((dereference ? chmod(path, mode) : lchmod(path, mode)) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EIO) return f_status_set_error(f_error_input_output); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EIO) return F_status_set_error(F_input_output); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_change_mode_) || !defined(_di_f_file_copy_) @@ -31,22 +31,22 @@ extern "C" { f_return_status private_f_file_change_mode_at(const int at_id, const f_string path, const mode_t mode, const int flags) { if (fchmodat(at_id, path, mode, flags) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EIO) return f_status_set_error(f_error_input_output); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EIO) return F_status_set_error(F_input_output); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_change_mode_at_) || !defined(_di_f_file_copy_at_) @@ -54,21 +54,21 @@ extern "C" { f_return_status private_f_file_change_owner(const f_string path, const uid_t uid, const gid_t gid, const bool dereference) { if ((dereference ? chown(path, uid, gid) : lchown(path, uid, gid)) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EIO) return f_status_set_error(f_error_input_output); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EIO) return F_status_set_error(F_input_output); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_change_owner_) || !defined(_di_f_file_copy_) @@ -76,41 +76,41 @@ extern "C" { f_return_status private_f_file_change_owner_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flags) { if (fchownat(at_id, path, uid, gid, flags) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == EIO) return f_status_set_error(f_error_input_output); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == EIO) return F_status_set_error(F_input_output); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_change_owner_at_) || !defined(_di_f_file_copy_at_) #if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) f_return_status private_f_file_close(int *id) { - if (f_status_is_error(private_f_file_flush(*id))) return f_status_set_error(f_file_error_synchronize); + if (F_status_is_error(private_f_file_flush(*id))) return F_status_set_error(F_file_synchronize); if (close(*id) < 0) { - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); - return f_status_set_error(f_file_error_close); + return F_status_set_error(F_file_close); } *id = 0; - return f_none; + return F_none; } #endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) @@ -123,10 +123,10 @@ extern "C" { file_destination.flags = f_file_flag_write_only | f_file_flag_no_follow; f_status status = private_f_file_open(source, 0, &file_source); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = private_f_file_open(destination, 0, &file_destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { private_f_file_close(&file_source.id); return status; } @@ -144,16 +144,16 @@ extern "C" { private_f_file_close(&file_destination.id); private_f_file_close(&file_source.id); - return f_status_set_error(f_file_error_write); + return F_status_set_error(F_file_write); } } // while private_f_file_close(&file_destination.id); private_f_file_close(&file_source.id); - if (size_read < 0) return f_status_set_error(f_file_error_read); + if (size_read < 0) return F_status_set_error(F_file_read); - return f_none; + return F_none; } #endif // !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_) @@ -209,16 +209,16 @@ extern "C" { f_return_status private_f_file_flush(const int id) { if (fsync(id) < 0) { - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EROFS) return f_status_set_error(f_unsupported); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EROFS) return F_status_set_error(F_unsupported); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_flush_) || !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) @@ -226,27 +226,27 @@ extern "C" { f_return_status private_f_file_link(const f_string target, const f_string point) { if (symlink(target, point) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_) @@ -254,28 +254,28 @@ extern "C" { f_return_status private_f_file_link_at(const int at_id, const f_string target, const f_string point) { if (symlinkat(target, at_id, point) < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_) @@ -289,28 +289,28 @@ extern "C" { } if (file->id < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENFILE) return f_status_set_error(f_file_max_open); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_) @@ -324,29 +324,29 @@ extern "C" { } if (file->id < 0) { - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == EDQUOT) return f_status_set_error(f_filesystem_quota_blocks); - if (errno == EEXIST) return f_status_set_error(f_file_found); - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EFBIG || errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == ENFILE) return f_status_set_error(f_file_max_open); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == ENOSPC) return f_status_set_error(f_no_space); - if (errno == EPERM) return f_status_set_error(f_prohibited); - if (errno == EROFS) return f_status_set_error(f_read_only); - if (errno == ETXTBSY) return f_status_set_error(f_busy); - - return f_status_set_error(f_failure); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_blocks); + if (errno == EEXIST) return F_status_set_error(F_file_found); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == ENFILE) return F_status_set_error(F_file_open_max); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == ENOSPC) return F_status_set_error(F_space_not); + if (errno == EPERM) return F_status_set_error(F_prohibited); + if (errno == EROFS) return F_status_set_error(F_read_only); + if (errno == ETXTBSY) return F_status_set_error(F_busy); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_) @@ -354,19 +354,19 @@ extern "C" { f_return_status private_f_file_stat(const f_string path, const bool dereference, struct stat *file_stat) { if ((dereference ? stat(path, file_stat) : lstat(path, file_stat)) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + + return F_status_set_error(F_file_stat); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_) @@ -374,21 +374,21 @@ extern "C" { f_return_status private_f_file_stat_at(const int at_id, const f_string path, const int flags, struct stat *file_stat) { if (fstatat(at_id, path, file_stat, flags) < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == ENOENT) return f_status_set_error(f_file_not_found); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == ENOENT) return F_status_set_error(F_file_found_not); + + return F_status_set_error(F_file_stat); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_stat_at_) || !defined(_di_f_file_copy_at_) @@ -397,19 +397,19 @@ extern "C" { int result = fstat(id, file_stat); if (result < 0) { - if (errno == ENAMETOOLONG) return f_status_set_error(f_invalid_name); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == ENOMEM) return f_status_set_error(f_out_of_memory); - if (errno == EOVERFLOW) return f_status_set_error(f_number_overflow); - if (errno == ENOTDIR) return f_status_set_error(f_invalid_directory); - if (errno == ENOENT) return f_file_not_found; - if (errno == EACCES) return f_status_set_error(f_access_denied); - if (errno == ELOOP) return f_status_set_error(f_loop); - - return f_status_set_error(f_file_error_stat); + if (errno == ENAMETOOLONG) return F_status_set_error(F_name); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == ENOMEM) return F_status_set_error(F_memory_out); + if (errno == EOVERFLOW) return F_status_set_error(F_number_overflow); + if (errno == ENOTDIR) return F_status_set_error(F_directory); + if (errno == ENOENT) return F_file_found_not; + if (errno == EACCES) return F_status_set_error(F_access_denied); + if (errno == ELOOP) return F_status_set_error(F_loop); + + return F_status_set_error(F_file_stat); } - return f_none; + return F_none; } #endif // !defined(_di_f_file_stat_by_id_) || !defined(_di_f_file_size_by_id_) @@ -417,7 +417,7 @@ extern "C" { f_return_status private_f_file_write_until(const f_file file, const f_string string, const f_string_length total, f_string_length *written) { *written = 0; - f_status status = f_none; + f_status status = F_none; f_string_length write_size = file.size_write; f_string_length write_max = total; @@ -436,22 +436,22 @@ extern "C" { } // while if (size_write == 0) { - return f_none_on_stop; + return F_none_stop; } if (size_write < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - - return f_status_set_error(f_failure); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // !defined(f_file_write) || !defined(f_file_write_until) || !defined(f_file_write_range) diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 83013f6..cb848b9 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -29,18 +29,18 @@ extern "C" { * Set to FALSE to operate on the symlink itself. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see f_file_change_mode() * @see f_file_copy() @@ -64,18 +64,18 @@ extern "C" { * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see f_file_change_mode_at() * @see f_file_copy_at() @@ -100,18 +100,18 @@ extern "C" { * Set to FALSE to operate on the symlink itself. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see f_file_change_owner() * @see f_file_copy() @@ -137,18 +137,18 @@ extern "C" { * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_invalid_name (with error bit) if the filename is too long. - * f_loop (with error bit) on loop error. - * f_file_not_found (with error bit) if file at path was not found. - * f_out_of_memory (with error bit) if out of memory. - * f_invalid_directory (with error bit) on invalid directory. - * f_prohibited (with error bit) if filesystem does not allow for file changes. - * f_read_only (with error bit) if file is read-only. - * f_error_input_output (with error bit) on I/O error. - * f_failure (with error bit) for any other (mkdir()) error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_name (with error bit) if the filename is too long. + * F_loop (with error bit) on loop error. + * F_file_found_not (with error bit) if file at path was not found. + * F_memory_out (with error bit) if out of memory. + * F_directory (with error bit) on invalid directory. + * F_prohibited (with error bit) if filesystem does not allow for file changes. + * F_read_only (with error bit) if file is read-only. + * F_input_output (with error bit) on I/O error. + * F_failure (with error bit) for any other (mkdir()) error. * * @see f_file_change_owner_at() * @see f_file_copy_at() @@ -166,15 +166,15 @@ extern "C" { * The file descriptor. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_file_error_descriptor (with error bit) if file descriptor is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * f_file_error_synchronize (with error bit) on flush failure. - * f_file_error_close (with error bit) if fclose() failed for any other reason. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_file_descriptor (with error bit) if file descriptor is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_file_synchronize (with error bit) on flush failure. + * F_file_close (with error bit) if fclose() failed for any other reason. * * @see f_file_close() * @see f_file_copy() @@ -203,26 +203,26 @@ extern "C" { * If FALSE, will not fail if file already exists (existing file will be replaced). * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. - * f_file_error_read (with error bit) on file read error. - * f_file_error_write (with error bit) on file write error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_read (with error bit) on file read error. + * F_file_write (with error bit) on file write error. * * @see f_file_copy() * @see f_file_clone() @@ -253,24 +253,24 @@ extern "C" { * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * * @see f_file_copy() * @see f_file_create() @@ -303,24 +303,24 @@ extern "C" { * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. * * @see f_file_copy_at() * @see f_file_create_at() @@ -378,14 +378,14 @@ extern "C" { * The file descriptor. * * @return - * f_none is returned on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_file_error_descriptor (with error bit) if file descriptor is invalid. - * f_error_input_output (with error bit) on I/O error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_no_space (with error bit) if filesystem is out of space (or filesystem quota is reached). - * f_unsupported (with error bit) if the file system or file type does not support flushing. - * f_failure (with error bit) on any other failure. + * F_none is returned on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_file_descriptor (with error bit) if file descriptor is invalid. + * F_input_output (with error bit) on I/O error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). + * F_unsupported (with error bit) if the file system or file type does not support flushing. + * F_failure (with error bit) on any other failure. * * @see f_file_close() * @see f_file_copy() @@ -450,11 +450,11 @@ extern "C" { * This will be updated with the file descriptor and file address. * * @return - * f_none on success. - * f_file_not_found (with error bit) if the file was not found. - * 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. + * F_none on success. + * F_file_found_not (with error bit) if the file was not found. + * F_file_open (with error bit) if the file is already open. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy() * @see f_file_open() @@ -480,11 +480,11 @@ extern "C" { * This will be updated with the file descriptor and file address. * * @return - * f_none on success. - * f_file_not_found (with error bit) if the file was not found. - * 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. + * F_none on success. + * F_file_found_not (with error bit) if the file was not found. + * F_file_open (with error bit) if the file is already open. + * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid). + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy_at() * @see f_file_open_at() @@ -507,15 +507,15 @@ extern "C" { * The statistics read. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy() * @see f_file_stat() @@ -540,15 +540,15 @@ extern "C" { * * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_copy_at() * @see f_file_stat_at() @@ -568,15 +568,15 @@ extern "C" { * The statistics read. * * @return - * 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_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. - * f_loop (with error bit) if a loop occurred. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_name (with error bit) if the name is somehow invalid. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory. + * F_file_found_not (with error bit) if the file was not found. + * F_access_denied (with error bit) if access to the file was denied. + * F_loop (with error bit) if a loop occurred. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_file_size_by_id() * @see f_file_stat_by_id() @@ -601,17 +601,17 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see f_file_write() * @see f_file_write_range() diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 8d17a75..fc0a755 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -350,7 +350,7 @@ extern "C" { */ #define f_macro_fss_item_delete(status, item) \ f_macro_fss_content_delete(status, item.content) \ - if (status == f_none) { \ + if (status == F_none) { \ item.object.start = 1; \ item.object.stop = 0; \ item.parent = 0; \ @@ -364,7 +364,7 @@ extern "C" { */ #define f_macro_fss_item_destroy(status, item) \ f_macro_fss_content_destroy(status, item.content) \ - if (status == f_none) { \ + if (status == F_none) { \ item.object.start = 1; \ item.object.stop = 0; \ item.parent = 0; \ @@ -476,7 +476,7 @@ extern "C" { items.size = 0; \ items.used = 0; \ status = f_memory_new((void **) & items.array, sizeof(f_fss_item), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ items.size = new_length; \ items.used = 0; \ } @@ -488,15 +488,15 @@ extern "C" { * items: the f_fss_items structure to operate on. */ #define f_macro_fss_items_delete(status, items) \ - status = f_none; \ + status = F_none; \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ f_macro_fss_item_delete(status, items.array[items.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ - if (status == f_none) items.size = 0; + if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ + if (status == F_none) items.size = 0; /** * Destroy a fss items. @@ -505,15 +505,15 @@ extern "C" { * items: the f_fss_items structure to operate on. */ #define f_macro_fss_items_destroy(status, items) \ - status = f_none; \ + status = F_none; \ items.used = items.size; \ while (items.used > 0) { \ items.used--; \ f_macro_fss_item_destroy(status, items.array[items.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ - if (status == f_none) items.size = 0; + if (status == F_none) status = f_memory_delete((void **) & items.array, sizeof(f_fss_item), items.size); \ + if (status == F_none) items.size = 0; /** * Delete a fss items. @@ -557,16 +557,16 @@ extern "C" { * new_length: the new size of the array. */ #define f_macro_fss_items_resize(status, items, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < items.size) { \ f_array_length i = items.size - new_length; \ for (; i < items.size; i++) { \ f_macro_fss_item_delete(status, items.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ + if (status == F_none) { \ if (new_length > items.size) { \ f_array_length i = items.size; \ for (; i < new_length; i++) { \ @@ -585,16 +585,16 @@ extern "C" { * new_length: the new size of the array. */ #define f_macro_fss_items_adjust(status, items, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < items.size) { \ length_variable i = items.size - new_length; \ for (; i < items.size; i++) { \ f_macro_fss_item_destroy(status, items.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & items.array, sizeof(f_fss_item), items.size, new_length); \ + if (status == F_none) { \ if (new_length > items.size) { \ length_variable i = items.size; \ for (; i < new_length; i++) { \ @@ -654,7 +654,7 @@ extern "C" { nest.size = 0; \ nest.used = 0; \ status = f_memory_new((void **) & nest.depth, sizeof(f_fss_items), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ nest.size = new_length; \ nest.used = 0; \ } @@ -666,15 +666,15 @@ extern "C" { * nest: the f_fss_nest structure to operate on. */ #define f_macro_fss_nest_delete(status, nest) \ - status = f_none; \ + status = F_none; \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ f_macro_fss_items_delete(status, nest.depth[nest.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ - if (status == f_none) nest.size = 0; + if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ + if (status == F_none) nest.size = 0; /** * Destroy a fss content nest. @@ -683,15 +683,15 @@ extern "C" { * nest: the f_fss_nest structure to operate on. */ #define f_macro_fss_nest_destroy(status, nest) \ - status = f_none; \ + status = F_none; \ nest.used = nest.size; \ while (nest.used > 0) { \ nest.used--; \ f_macro_fss_items_destroy(status, nest.depth[nest.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ - if (status == f_none) nest.size = 0; + if (status == F_none) status = f_memory_delete((void **) & nest.depth, sizeof(f_fss_items), nest.size); \ + if (status == F_none) nest.size = 0; /** * Delete a fss content nest. @@ -735,16 +735,16 @@ extern "C" { * new_length: the new size of the array. */ #define f_macro_fss_nest_resize(status, nest, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < nest.size) { \ f_array_length i = nest.size - new_length; \ for (; i < nest.size; i++) { \ f_macro_fss_items_delete(status, nest.depth[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items), nest.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & nest.depth, sizeof(f_fss_items), nest.size, new_length); \ + if (status == F_none) { \ if (new_length > nest.size) { \ f_array_length i = nest.size; \ for (; i < new_length; i++) { \ @@ -763,16 +763,16 @@ extern "C" { * new_length: the new size of the array. */ #define f_macro_fss_nest_adjust(status, nest, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < nest.size) { \ f_array_length i = nest.size - new_length; \ for (; i < nest.size; i++) { \ f_macro_fss_items_destroy(status, nest.depth[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item), nest.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & nest.depth, sizeof(f_fss_item), nest.size, new_length); \ + if (status == F_none) { \ if (new_length > nest.size) { \ f_array_length i = nest.size; \ for (; i < new_length; i++) { \ @@ -827,7 +827,7 @@ extern "C" { nests.size = 0; \ nests.used = 0; \ status = f_memory_new((void **) & nests.array, sizeof(f_fss_nest), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ nests.size = new_length; \ nests.used = 0; \ } @@ -839,15 +839,15 @@ extern "C" { * nests: the f_fss_nests structure to operate on. */ #define f_macro_fss_nests_delete(nests) \ - status = f_none; \ + status = F_none; \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ f_macro_fss_nest_delete(status, nests.array[nests.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ - if (status == f_none) nests.size = 0; + if (status == F_none) status = f_memory_delete((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ + if (status == F_none) nests.size = 0; /** * Destroy a fss content nests. @@ -856,15 +856,15 @@ extern "C" { * nests: the f_fss_nests structure to operate on. */ #define f_macro_fss_nests_destroy(nests) \ - status = f_none; \ + status = F_none; \ nests.used = nests.size; \ while (nests.used > 0) { \ nests.used--; \ f_macro_fss_nest_destroy(status, nests.array[nests.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ - if (status == f_none) nests.size = 0; + if (status == F_none) status = f_memory_destroy((void **) & nests.array, sizeof(f_fss_nest), nests.size); \ + if (status == F_none) nests.size = 0; /** * Delete a fss content nests. @@ -908,16 +908,16 @@ extern "C" { * new_length: the new size of the array. */ #define f_macro_fss_nests_resize(status, nests, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < nests.size) { \ f_array_length i = nests.size - new_length; \ for (; i < nests.size; i++) { \ f_macro_fss_nest_delete(status, nests.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ + if (status == F_none) { \ if (new_length > nests.size) { \ f_array_length i = nests.size; \ for (; i < new_length; i++) { \ @@ -936,16 +936,16 @@ extern "C" { * new_length: he new size of the array. */ #define f_macro_fss_nests_adjust(status, nests, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < nests.size) { \ f_array_length i = nests.size - new_length; \ for (; i < nests.size; i++) { \ f_macro_fss_nest_destroy(status, nests.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & nests.array, sizeof(f_fss_nest), nests.size, new_length); \ + if (status == F_none) { \ if (new_length > nests.size) { \ f_array_length i = nests.size; \ for (; i < new_length; i++) { \ diff --git a/level_0/f_memory/c/memory.c b/level_0/f_memory/c/memory.c index 092439f..4da4c68 100644 --- a/level_0/f_memory/c/memory.c +++ b/level_0/f_memory/c/memory.c @@ -7,53 +7,53 @@ extern "C" { #ifndef _di_f_memory_new_ f_return_status f_memory_new(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ - if (type <= 0) return f_status_set_error(f_invalid_parameter); - if (pointer == 0) return f_status_set_error(f_invalid_parameter); + if (type <= 0) return F_status_set_error(F_parameter); + if (pointer == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // prevent double-allocations - if (*pointer != 0) return f_none; + if (*pointer != 0) return F_none; // Some people use malloc(type * length) to produce the same results. // I have noticed this sometimes causes an increase in L1/L2 cache misses (0.02% L1 increase, 0.01% L2 increase). *pointer = calloc(type, length); if (*pointer) { - return f_none; + return F_none; } - return f_status_set_error(f_error_allocation); + return F_status_set_error(F_memory_allocation); } #endif // _di_f_memory_new_ #if ! ( defined (_di_f_memory_delete_) || defined (_f_memory_FORCE_secure_memory_) ) f_return_status f_memory_delete(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ - if (pointer == 0) return f_status_set_error(f_invalid_parameter); + if (pointer == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // prevent double-frees. - if (*pointer == 0) return f_none; + if (*pointer == 0) return F_none; free(*pointer); // it has been deallocated, so reset the pointer. if (*pointer != 0) *pointer = 0; - return f_none; + return F_none; } #endif // ! ( defined (_di_f_memory_delete_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_memory_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) f_return_status f_memory_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length) { #ifndef _di_level_0_parameter_checking_ - if (length < 0) return f_status_set_error(f_invalid_parameter); - if (type <= 0) return f_status_set_error(f_invalid_parameter); - if (pointer == 0) return f_status_set_error(f_invalid_parameter); + if (length < 0) return F_status_set_error(F_parameter); + if (type <= 0) return F_status_set_error(F_parameter); + if (pointer == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // prevent double-frees. - if (*pointer == 0) return f_none; + if (*pointer == 0) return F_none; if (length > 0) { memset(*pointer, 0, type * length); @@ -64,21 +64,21 @@ extern "C" { // it has been deallocated, so reset the pointer. if (*pointer != 0) *pointer = 0; - return f_none; + return F_none; } #endif // ! ( defined (_di_f_memory_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) #if ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) ) f_return_status f_memory_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { #ifndef _di_level_0_parameter_checking_ - if (type <= 0) return f_status_set_error(f_invalid_parameter); - if (old_length < 0) return f_status_set_error(f_invalid_parameter); - if (new_length < 0) return f_status_set_error(f_invalid_parameter); - if (pointer == 0) return f_status_set_error(f_invalid_parameter); + if (type <= 0) return F_status_set_error(F_parameter); + if (old_length < 0) return F_status_set_error(F_parameter); + if (new_length < 0) return F_status_set_error(F_parameter); + if (pointer == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // don't be wasteful. - if (old_length == new_length) return f_none; + if (old_length == new_length) return F_none; if (*pointer != 0) { void *new_pointer = 0; @@ -93,7 +93,7 @@ extern "C" { // it has been deallocated, so reset the pointer if (*pointer != 0) *pointer = 0; - return f_none; + return F_none; } if (new_pointer) { @@ -107,35 +107,35 @@ extern "C" { *pointer = new_pointer; } - return f_none; + return F_none; } } else if (new_length > 0) { *pointer = calloc(type, new_length); if (*pointer) { - return f_none; + return F_none; } } else { - return f_none; + return F_none; } - return f_status_set_error(f_error_reallocation); + return F_status_set_error(F_memory_reallocation); } #endif // ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) ) #if ! ( defined (_di_f_memory_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) f_return_status f_memory_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) { #ifndef _di_level_0_parameter_checking_ - if (type <= 0) return f_status_set_error(f_invalid_parameter); - if (old_length < 0) return f_status_set_error(f_invalid_parameter); - if (new_length < 0) return f_status_set_error(f_invalid_parameter); - if (pointer == 0) return f_status_set_error(f_invalid_parameter); + if (type <= 0) return F_status_set_error(F_parameter); + if (old_length < 0) return F_status_set_error(F_parameter); + if (new_length < 0) return F_status_set_error(F_parameter); + if (pointer == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ // don't be wasteful - if (old_length == new_length) return f_none; + if (old_length == new_length) return F_none; if (*pointer != 0) { void *new_pointer = 0; @@ -158,7 +158,7 @@ extern "C" { // it has been deallocated, so reset the pointer if (*pointer != 0) *pointer = 0; - return f_none; + return F_none; } if (new_pointer) { @@ -172,21 +172,21 @@ extern "C" { *pointer = new_pointer; } - return f_none; + return F_none; } } else if (new_length > 0) { *pointer = calloc(type, new_length); if (*pointer) { - return f_none; + return F_none; } } else { - return f_none; + return F_none; } - return f_status_set_error(f_error_reallocation); + return F_status_set_error(F_memory_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 c71c218..e43af4a 100644 --- a/level_0/f_memory/c/memory.h +++ b/level_0/f_memory/c/memory.h @@ -83,9 +83,9 @@ extern "C" { * The total number of blocks to be allocated. * * @return - * f_none on success. - * f_error_allocation (with error bit) on allocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_memory_allocation (with error bit) on allocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_memory_new_ extern f_return_status f_memory_new(void **pointer, const f_memory_size_t type, const f_memory_length length); @@ -106,8 +106,8 @@ extern "C" { * The total number of blocks to be allocated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_delete_) || defined (_f_memory_FORCE_secure_memory_) ) extern f_return_status f_memory_delete(void **pointer, const f_memory_size_t type, const f_memory_length length); @@ -126,8 +126,8 @@ extern "C" { * The total number of blocks to be allocated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_destroy_) || defined (_f_memory_FORCE_fast_memory_) ) extern f_return_status f_memory_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length); @@ -148,9 +148,9 @@ extern "C" { * The total number of blocks representing the length to be resized to. * * @return - * f_none on success. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) ) extern f_return_status f_memory_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); @@ -171,9 +171,9 @@ extern "C" { * The total number of blocks representing the length to be resized to. * * @return - * f_none on success. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #if ! ( defined (_di_f_memory_adjust_) || defined (_f_memory_FORCE_fast_memory_) ) extern f_return_status f_memory_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length); @@ -207,7 +207,7 @@ extern "C" { #define f_macro_memory_structure_new(status, structure, type, length) \ f_macro_memory_structure_clear(structure) \ status = f_memory_new((void **) & structure.array, sizeof(type), length); \ - if (status == f_none) { \ + if (status == F_none) { \ structure.size = length; \ structure.used = 0; \ } @@ -223,7 +223,7 @@ extern "C" { #ifndef _di_f_macro_memory_structure_delete_ #define f_macro_memory_structure_delete(status, structure, type) \ status = f_memory_delete((void **) & structure.array, sizeof(type), structure.size); \ - if (status == f_none) { \ + if (status == F_none) { \ structure.size = 0; \ structure.used = 0; \ } @@ -239,7 +239,7 @@ extern "C" { #ifndef _di_f_macro_memory_structure_destroy_ #define f_macro_memory_structure_destroy(status, structure, type) \ status = f_memory_destroy((void **) & structure.array, sizeof(type), structure.size); \ - if (status == f_none) { \ + if (status == F_none) { \ structure.size = 0; \ structure.used = 0; \ } @@ -253,7 +253,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_delete_simple_ #define f_macro_memory_structure_delete_simple(structure, type) \ - if (f_memory_delete((void **) & structure.array, sizeof(type), structure.size) == f_none) { \ + if (f_memory_delete((void **) & structure.array, sizeof(type), structure.size) == F_none) { \ structure.size = 0; \ structure.used = 0; \ } @@ -267,7 +267,7 @@ extern "C" { */ #ifndef _di_f_macro_memory_structure_destroy_simple_ #define f_macro_memory_structure_destroy_simple(structure, type) \ - if (f_memory_destroy((void **) & structure.array, sizeof(type), structure.size) == f_none) { \ + if (f_memory_destroy((void **) & structure.array, sizeof(type), structure.size) == F_none) { \ structure.size = 0; \ structure.used = 0; \ } @@ -284,7 +284,7 @@ extern "C" { #ifndef _di_f_macro_memory_structure_resize_ #define f_macro_memory_structure_resize(status, structure, type, new_length) \ status = f_memory_resize((void **) & structure.array, sizeof(type), structure.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ structure.size = new_length; \ if (structure.used > structure.size) structure.used = new_length; \ } @@ -301,7 +301,7 @@ extern "C" { #ifndef _di_f_macro_memory_structure_adjust_ #define f_macro_memory_structure_adjust(status, structure, type, new_length) \ status = f_memory_adjust((void **) & structure.array, sizeof(type), structure.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ structure.size = new_length; \ if (structure.used > structure.size) structure.used = new_length; \ } @@ -335,7 +335,7 @@ extern "C" { #define f_macro_memory_structures_new(status, structures, type, new_length) \ f_macro_memory_structures_clear(structures) \ status = f_memory_new((void **) & structures.array, sizeof(type), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ structures.size = new_length; \ structures.used = 0; \ } @@ -350,15 +350,15 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_delete_ #define f_macro_memory_structures_delete(status, structures, type) \ - status = f_none; \ + status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ f_macro_memory_structure_delete(status, structures.array[structures.used], type); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & structures.array, sizeof(type), structures.size); \ - if (status == f_none) structures.size = 0; + if (status == F_none) status = f_memory_delete((void **) & structures.array, sizeof(type), structures.size); \ + if (status == F_none) structures.size = 0; #endif // _di_f_macro_memory_structures_delete_ /** @@ -370,15 +370,15 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_destroy_ #define f_macro_memory_structures_destroy(status, structures, type) \ - status = f_none; \ + status = F_none; \ structures.used = structures.size; \ while (structures.used > 0) { \ structures.used--; \ f_macro_memory_structure_destroy(status, structures.array[structures.used], type); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & structures.array, sizeof(type), structures.size); \ - if (status == f_none) structures.size = 0; + if (status == F_none) status = f_memory_destroy((void **) & structures.array, sizeof(type), structures.size); \ + if (status == F_none) structures.size = 0; #endif // _di_f_macro_memory_structures_destroy_ /** @@ -432,16 +432,16 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_resize_ #define f_macro_memory_structures_resize(status, structures, type, new_length, length_variable) \ - status = f_none; \ + status = F_none; \ if (new_length < structures.size) { \ length_variable i = structures.size - new_length; \ for (; i < structures.size; i++) { \ f_macro_memory_structure_delete(status, structures.array[i], type); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & structures.array, sizeof(type), structures.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == F_none) { \ if (new_length > structures.size) { \ length_variable i = structures.size; \ for (; i < new_length; i++) { \ @@ -464,16 +464,16 @@ extern "C" { */ #ifndef _di_f_macro_memory_structures_adjust_ #define f_macro_memory_structures_adjust(status, structures, type, new_length, length_variable) \ - status = f_none; \ + status = F_none; \ if (new_length < structures.size) { \ length_variable i = structures.size - new_length; \ for (; i < structures.size; i++) { \ f_macro_memory_structure_destroy(status, structures.array[i], type); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & structures.array, sizeof(type), structures.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & structures.array, sizeof(type), structures.size, new_length); \ + if (status == F_none) { \ if (new_length > structures.size) { \ length_variable i = structures.size; \ for (; i < new_length; i++) { \ diff --git a/level_0/f_path/c/path.c b/level_0/f_path/c/path.c index 6b2e988..3ec5dec 100644 --- a/level_0/f_path/c/path.c +++ b/level_0/f_path/c/path.c @@ -7,11 +7,11 @@ extern "C" { #ifndef _di_f_path_explode_ f_return_status f_path_explode(const f_string path, f_string_dynamics *paths) { #ifndef _di_level_0_parameter_checking_ - if (paths == 0) return f_status_set_error(f_invalid_parameter); - if (paths->used > paths->size) return f_status_set_error(f_invalid_parameter); + if (paths == 0) return F_status_set_error(F_parameter); + if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; const f_string_length length = strnlen(path, PATH_MAX); if (length == 0) { @@ -20,22 +20,22 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } f_macro_string_dynamic_clear(paths->array[paths->used]); paths->used++; - return f_none; + return F_none; } f_string_length i = length; @@ -47,15 +47,15 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } @@ -74,13 +74,13 @@ extern "C" { if (total > 0) { if (path[i - 1] == f_path_separator[0]) { f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.used = total; } else { f_macro_string_dynamic_new(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.string[total] = f_path_separator[0]; part.used = total + 1; @@ -98,19 +98,19 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // _di_f_path_explode_ #ifndef _di_f_path_explode_dynamic_ f_return_status f_path_explode_dynamic(const f_string_static path, f_string_dynamics *paths) { #ifndef _di_level_0_parameter_checking_ - if (path.used > path.size) return f_status_set_error(f_invalid_parameter); - if (paths == 0) return f_status_set_error(f_invalid_parameter); - if (paths->used > paths->size) return f_status_set_error(f_invalid_parameter); + if (path.used > path.size) return F_status_set_error(F_parameter); + if (paths == 0) return F_status_set_error(F_parameter); + if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; if (path.used == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -118,22 +118,22 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } f_macro_string_dynamic_clear(paths->array[paths->used]); paths->used++; - return f_none; + return F_none; } f_string_length i = 0; @@ -148,15 +148,15 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } @@ -172,7 +172,7 @@ extern "C" { if (total > 0) { f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; for (j = 0; j < total; j++) { if (path.string[first + j] == 0) continue; @@ -183,7 +183,7 @@ extern "C" { if (part.string[part.used - 1] != f_path_separator[0]) { f_macro_string_dynamic_resize(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator[0]; part.used++; @@ -199,18 +199,18 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // _di_f_path_explode_dynamic_ #ifndef _di_f_path_explode_reverse_ f_return_status f_path_explode_reverse(const f_string path, f_string_dynamics *paths) { #ifndef _di_level_0_parameter_checking_ - if (paths == 0) return f_status_set_error(f_invalid_parameter); - if (paths->used > paths->size) return f_status_set_error(f_invalid_parameter); + if (paths == 0) return F_status_set_error(F_parameter); + if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; const f_string_length length = strnlen(path, PATH_MAX); if (length == 0) { @@ -219,15 +219,15 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } @@ -236,7 +236,7 @@ extern "C" { paths->array[paths->used].size = 0; paths->used++; - return f_none; + return F_none; } f_string_length i = length; @@ -253,15 +253,15 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } @@ -271,13 +271,13 @@ extern "C" { if (total > 0) { if (path[j + total] == f_path_separator[0]) { f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.used = total; } else { f_macro_string_dynamic_new(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.string[total] = f_path_separator[0]; part.used = total + 1; @@ -295,13 +295,13 @@ extern "C" { if (total > 0) { if (path[last - 1] == f_path_separator[0]) { f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.used = total; } else { f_macro_string_dynamic_new(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.used = total + 1; part.string[total] = f_path_separator[0]; @@ -318,19 +318,19 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // _di_f_path_explode_reverse_ #ifndef _di_f_path_explode_reverse_dynamic_ f_return_status f_path_explode_reverse_dynamic(const f_string_static path, f_string_dynamics *paths) { #ifndef _di_level_0_parameter_checking_ - if (path.used > path.size) return f_status_set_error(f_invalid_parameter); - if (paths == 0) return f_status_set_error(f_invalid_parameter); - if (paths->used > paths->size) return f_status_set_error(f_invalid_parameter); + if (path.used > path.size) return F_status_set_error(F_parameter); + if (paths == 0) return F_status_set_error(F_parameter); + if (paths->used > paths->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; if (path.used == 0) { // When PATH is "", this is actually a valid search path for PWD. @@ -338,22 +338,22 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } f_macro_string_dynamic_clear(paths->array[paths->used]); paths->used++; - return f_none; + return F_none; } f_string_length i = path.used; @@ -371,15 +371,15 @@ extern "C" { if (paths->used + 1 > paths->size) { if (paths->size + f_memory_default_allocation_step > f_array_length_size) { if (paths->size + 1 > f_array_length_size) { - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, (*paths), paths->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else { f_macro_string_dynamics_resize(status, (*paths), paths->used + f_memory_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } @@ -388,7 +388,7 @@ extern "C" { if (total > 0) { f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { if (path.string[i + k] == 0) continue; @@ -399,7 +399,7 @@ extern "C" { if (part.string[part.used - 1] != f_path_separator[0]) { f_macro_string_dynamic_resize(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.string[part.used] = f_path_separator[0]; part.used++; @@ -413,7 +413,7 @@ extern "C" { total = last - j; f_macro_string_dynamic_new(status, part, total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; for (k = 0; k < total; k++) { if (path.string[i + k] == 0) continue; @@ -424,7 +424,7 @@ extern "C" { if (part.string[part.used - 1] != f_path_separator[0]) { f_macro_string_dynamic_resize(status, part, total + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; part.string[part.used - 1] = f_path_separator[0]; part.used++; @@ -438,7 +438,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // _di_f_path_explode_reverse_dynamic_ diff --git a/level_0/f_path/c/path.h b/level_0/f_path/c/path.h index d678ebd..edf22d2 100644 --- a/level_0/f_path/c/path.h +++ b/level_0/f_path/c/path.h @@ -69,11 +69,11 @@ extern "C" { * Each exploded path is not NULL terminated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on reallocation error. - * f_error_allocation (with error bit) on allocation error. - * f_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on reallocation error. + * F_memory_allocation (with error bit) on allocation error. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. */ #ifndef _di_f_path_explode_ extern f_return_status f_path_explode(const f_string path, f_string_dynamics *paths); @@ -93,11 +93,11 @@ extern "C" { * Each exploded path is not NULL terminated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on reallocation error. - * f_error_allocation (with error bit) on allocation error. - * f_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on reallocation error. + * F_memory_allocation (with error bit) on allocation error. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. */ #ifndef _di_f_path_explode_dynamic_ extern f_return_status f_path_explode_dynamic(const f_string_static path, f_string_dynamics *paths); @@ -119,11 +119,11 @@ extern "C" { * Each exploded path is not NULL terminated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on reallocation error. - * f_error_allocation (with error bit) on allocation error. - * f_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on reallocation error. + * F_memory_allocation (with error bit) on allocation error. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. */ #ifndef _di_f_path_explode_reverse_ extern f_return_status f_path_explode_reverse(const f_string path, f_string_dynamics *paths); @@ -145,11 +145,11 @@ extern "C" { * Each exploded path is not NULL terminated. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on reallocation error. - * f_error_allocation (with error bit) on allocation error. - * f_buffer_too_large (with error bit) if paths array is too large for further addressing. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on reallocation error. + * F_memory_allocation (with error bit) on allocation error. + * F_buffer_too_large (with error bit) if paths array is too large for further addressing. */ #ifndef _di_f_path_explode_reverse_dynamic_ extern f_return_status f_path_explode_reverse_dynamic(const f_string_static path, f_string_dynamics *paths); diff --git a/level_0/f_pipe/c/pipe.c b/level_0/f_pipe/c/pipe.c index 27c59fd..d048e86 100644 --- a/level_0/f_pipe/c/pipe.c +++ b/level_0/f_pipe/c/pipe.c @@ -9,14 +9,14 @@ extern "C" { struct stat st_info; if (fstat(f_type_descriptor_input, &st_info) != 0) { - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } if (S_ISFIFO(st_info.st_mode)) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_pipe_input_exists_ @@ -25,14 +25,14 @@ extern "C" { struct stat st_info; if (fstat(f_type_descriptor_warning, &st_info) != 0) { - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } if (S_ISFIFO(st_info.st_mode)) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_pipe_warning_exists_ @@ -41,14 +41,14 @@ extern "C" { struct stat st_info; if (fstat(f_type_descriptor_error, &st_info) != 0) { - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } if (S_ISFIFO(st_info.st_mode)) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_pipe_error_exists_ @@ -57,14 +57,14 @@ extern "C" { struct stat st_info; if (fstat(f_type_descriptor_debug, &st_info) != 0) { - return f_status_set_error(f_file_error_stat); + return F_status_set_error(F_file_stat); } if (S_ISFIFO(st_info.st_mode)) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_pipe_debug_exists_ diff --git a/level_0/f_pipe/c/pipe.h b/level_0/f_pipe/c/pipe.h index 66172ac..d83f4b3 100644 --- a/level_0/f_pipe/c/pipe.h +++ b/level_0/f_pipe/c/pipe.h @@ -28,9 +28,9 @@ extern "C" { * Identify whether or not the standard input pipe source contains piped data. * * @return - * f_true if there is piped data. - * f_false if there is no piped data. - * f_file_error_stat (with error bit) on stat() error. + * F_true if there is piped data. + * F_false if there is no piped data. + * F_file_stat (with error bit) on stat() error. * * @see fstat() */ @@ -44,9 +44,9 @@ extern "C" { * For most systems, standard warning does not exist and instead maps to standard output. * * @return - * f_true if there is piped data. - * f_false if there is no piped data. - * f_file_error_stat (with error bit) on stat() error. + * F_true if there is piped data. + * F_false if there is no piped data. + * F_file_stat (with error bit) on stat() error. * * @see fstat() */ @@ -58,9 +58,9 @@ extern "C" { * Identify whether or not the standard error pipe source contains piped data. * * @return - * f_true if there is piped data. - * f_false if there is no piped data. - * f_file_error_stat (with error bit) on stat() error. + * F_true if there is piped data. + * F_false if there is no piped data. + * F_file_stat (with error bit) on stat() error. * * @see fstat() */ @@ -74,9 +74,9 @@ extern "C" { * For most systems, standard debug does not exist and instead maps to standard output. * * @return - * f_true if there is piped data. - * f_false if there is no piped data. - * f_file_error_stat (with error bit) on stat() error. + * F_true if there is piped data. + * F_false if there is no piped data. + * F_file_stat (with error bit) on stat() error. * * @see fstat() */ diff --git a/level_0/f_print/c/print.c b/level_0/f_print/c/print.c index eadb523..7b9a8f5 100644 --- a/level_0/f_print/c/print.c +++ b/level_0/f_print/c/print.c @@ -7,8 +7,8 @@ extern "C" { #ifndef _di_f_print_string_ f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length) { #ifndef _di_level_0_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (length < 1) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (length < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ register f_string_length i = 0; @@ -16,19 +16,19 @@ extern "C" { for (; i < length; i++) { if (string[i] != 0) { if (fputc(string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } } // for - return f_none; + return F_none; } #endif // _di_f_print_string_ #ifndef _di_f_print_string_dynamic_ f_return_status f_print_string_dynamic(FILE *output, const f_string_static buffer) { #ifndef _di_level_0_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ register f_string_length i = 0; @@ -36,23 +36,23 @@ extern "C" { for (; i < buffer.used; i++) { if (buffer.string[i] != 0) { if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } } // for - return f_none; + return F_none; } #endif // _di_f_print_string_dynamic_ #ifndef _di_f_print_string_dynamic_partial_ f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range) { #ifndef _di_level_0_parameter_checking_ - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); - if (range.stop >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); + if (range.stop >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ register f_string_length i = range.start; @@ -60,12 +60,12 @@ extern "C" { for (; i <= range.stop; i++) { if (buffer.string[i] != 0) { if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } } // for - return f_none; + return F_none; } #endif // _di_f_print_string_dynamic_partial_ diff --git a/level_0/f_print/c/print.h b/level_0/f_print/c/print.h index b533f60..9ba88f7 100644 --- a/level_0/f_print/c/print.h +++ b/level_0/f_print/c/print.h @@ -43,9 +43,9 @@ extern "C" { * The total number of characters to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_ extern f_return_status f_print_string(FILE *output, const f_string string, const f_string_length length); @@ -66,9 +66,9 @@ extern "C" { * The string to output. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_ extern f_return_status f_print_string_dynamic(FILE *output, const f_string_static buffer); @@ -91,9 +91,9 @@ extern "C" { * The range within the provided string to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_print_string_dynamic_partial_ extern f_return_status f_print_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range); diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 8581e20..0926c0a 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -22,358 +22,346 @@ extern "C" { /** * Status masks. */ -#ifndef _di_f_status_masks_ +#ifndef _di_F_status_masks_ // f_status is required to be exactly 16 bits, the first two high order bits represent error and warning respectively. - #define f_status_bit_error 0x8000 // 1000 0000 0000 0000 - #define f_status_bit_signal 0xc000 // 1100 0000 0000 0000 - #define f_status_bit_warning 0x4000 // 0100 0000 0000 0000 + #define F_status_bit_error 0x8000 // 1000 0000 0000 0000 + #define F_status_bit_signal 0xc000 // 1100 0000 0000 0000 + #define F_status_bit_warning 0x4000 // 0100 0000 0000 0000 - #define f_status_mask_fine 0x3fff // 0011 1111 1111 1111 - #define f_status_mask_code 0xc000 // 1100 0000 0000 0000 + #define F_status_mask_fine 0x3fff // 0011 1111 1111 1111 + #define F_status_mask_code 0xc000 // 1100 0000 0000 0000 - #define f_status_is_error(status) (status & f_status_bit_error) - #define f_status_is_fine(status) ((status & f_status_mask_code) == 0) - #define f_status_is_problem(status) ((status & f_status_bit_error) || (status & f_status_bit_warning)) - #define f_status_is_signal(status) (status & f_status_bit_signal) - #define f_status_is_warning(status) (status & f_status_bit_warning) + #define F_status_is_error(status) (status & F_status_bit_error) + #define F_status_is_fine(status) ((status & F_status_mask_code) == 0) + #define F_status_is_problem(status) ((status & F_status_bit_error) || (status & F_status_bit_warning)) + #define F_status_is_signal(status) (status & F_status_bit_signal) + #define F_status_is_warning(status) (status & F_status_bit_warning) - #define f_status_is_not_error(status) ((status & f_status_bit_error) == 0) - #define f_status_is_not_signal(status) ((status & f_status_bit_signal) == 0) - #define f_status_is_not_warning(status) ((status & f_status_bit_warning) == 0) + #define F_status_is_not_error(status) ((status & F_status_bit_error) == 0) + #define F_status_is_not_signal(status) ((status & F_status_bit_signal) == 0) + #define F_status_is_not_warning(status) ((status & F_status_bit_warning) == 0) - #define f_status_set_error(status) (status | f_status_bit_error) - #define f_status_set_signal(status) (status | f_status_bit_signal) - #define f_status_set_warning(status) (status | f_status_bit_warning) + #define F_status_set_error(status) (status | F_status_bit_error) + #define F_status_set_signal(status) (status | F_status_bit_signal) + #define F_status_set_warning(status) (status | F_status_bit_warning) - // Use f_status_set_fine to remove the error, warning, and signal bits. - #define f_status_set_fine(status) (status & f_status_mask_fine) + // Use F_status_set_fine to remove the error, warning, and signal bits. + #define F_status_set_fine(status) (status & F_status_mask_fine) // Maximum size of the status code. - #define f_status_size_max 0x3fff - #define f_status_size_max_with_signal 0x10000 -#endif // _di_f_status_masks_ + #define F_status_size_max 0x3fff + #define F_status_size_max_with_signal 0x10000 +#endif // _di_F_status_masks_ /** * All standard/core status codes. * - * The code f_status_code_last is intended to be used as the starting point for anything extending this and povided its own status codes. + * The code F_status_code_last is intended to be used as the starting point for anything extending this and povided its own status codes. */ -#ifndef _di_f_status_codes_ +#ifndef _di_F_status_codes_ enum { - #ifndef _di_f_status_booleans_ - f_false = 0, - f_true, - #endif // _di_f_status_booleans_ + #ifndef _di_F_status_booleans_ + F_false = 0, + F_true, + #endif // _di_F_status_booleans_ - #ifndef _di_f_status_signals_ - f_signal_hangup = 1, - f_signal_interrupt, - f_signal_quit, - f_signal_illegal, - f_signal_trap, - f_signal_abort, - f_signal_bus_error, - f_signal_floating_point_exception, - f_signal_kill, // unblockable - f_signal_user_1, - f_signal_segmentation_fault, - f_signal_user_2, - f_signal_broken_pipe, - f_signal_alarm_clock, - f_signal_termination, - f_signal_stack_fault, - f_signal_child, - f_signal_continue, - f_signal_stop, // unblockable - f_signal_keyboard_stop, - f_signal_tty_in, - f_signal_tty_out, - f_signal_urgent, - f_signal_cpu_limit, - f_signal_file_size_limit, - f_signal_virtual_alarm_clock, - f_signal_profile_alarm_clock, - f_signal_window_size_change, - f_signal_pollable_event, - f_signal_power_failure, - f_signal_bad_system_call, - f_signal_reserved_32, - f_signal_reserved_33, - f_signal_reserved_34, - f_signal_reserved_35, - f_signal_reserved_36, - f_signal_reserved_37, - f_signal_reserved_38, - f_signal_reserved_39, - f_signal_reserved_40, - f_signal_reserved_41, - f_signal_reserved_42, - f_signal_reserved_43, - f_signal_reserved_44, - f_signal_reserved_45, - f_signal_reserved_46, - f_signal_reserved_47, - f_signal_reserved_48, - f_signal_reserved_49, - f_signal_reserved_50, - f_signal_reserved_51, - f_signal_reserved_52, - f_signal_reserved_53, - f_signal_reserved_54, - f_signal_reserved_55, - f_signal_reserved_56, - f_signal_reserved_57, - f_signal_reserved_58, - f_signal_reserved_59, - f_signal_reserved_60, - f_signal_reserved_61, - f_signal_reserved_62, - f_signal_reserved_63, - f_signal_reserved_64, - #endif // _di_f_status_signals_ + #ifndef _di_F_status_signals_ + F_signal_hangup = 1, + F_signal_interrupt, + F_signal_quit, + F_signal_illegal, + F_signal_trap, + F_signal_abort, + F_signal_bus_error, + F_signal_floating_point_exception, + F_signal_kill, // unblockable + F_signal_user_1, + F_signal_segmentation_fault, + F_signal_user_2, + F_signal_broken_pipe, + F_signal_alarm_clock, + F_signal_termination, + F_signal_stack_fault, + F_signal_child, + F_signal_continue, + F_signal_stop, // unblockable + F_signal_keyboard_stop, + F_signal_tty_in, + F_signal_tty_out, + F_signal_urgent, + F_signal_cpu_limit, + F_signal_file_size_limit, + F_signal_virtual_alarm_clock, + F_signal_profile_alarm_clock, + F_signal_window_size_change, + F_signal_pollable_event, + F_signal_power_failure, + F_signal_bad_system_call, + F_signal_reserved_32, + F_signal_reserved_33, + F_signal_reserved_34, + F_signal_reserved_35, + F_signal_reserved_36, + F_signal_reserved_37, + F_signal_reserved_38, + F_signal_reserved_39, + F_signal_reserved_40, + F_signal_reserved_41, + F_signal_reserved_42, + F_signal_reserved_43, + F_signal_reserved_44, + F_signal_reserved_45, + F_signal_reserved_46, + F_signal_reserved_47, + F_signal_reserved_48, + F_signal_reserved_49, + F_signal_reserved_50, + F_signal_reserved_51, + F_signal_reserved_52, + F_signal_reserved_53, + F_signal_reserved_54, + F_signal_reserved_55, + F_signal_reserved_56, + F_signal_reserved_57, + F_signal_reserved_58, + F_signal_reserved_59, + F_signal_reserved_60, + F_signal_reserved_61, + F_signal_reserved_62, + F_signal_reserved_63, + F_signal_reserved_64, + #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_block, - f_critical, - f_does_not_exist, - f_dummy, - f_error_input, - f_error_output, - f_error_input_output, - f_failure, - f_incomplete, - f_interrupted, - f_loop, - f_maybe, - f_not_connected, - f_no_data, - f_no_space, - f_out_of_bound, - f_out_of_memory, - f_prohibited, - f_read_only, - f_unknown, - f_unsupported, - f_warn, - f_write_only, - #endif // _di_f_status_basic_ + #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_block, + F_critical, + F_exist_not, + F_dummy, + F_input, + F_output, + F_input_output, + F_failure, + F_incomplete, + F_interrupted, + F_loop, + F_maybe, + F_connected_not, + F_data_not, + F_space_not, + F_bound_out, + F_memory_out, + F_prohibited, + F_read_only, + F_unknown, + F_unsupported, + F_warn, + F_write_only, + F_utf, + F_invalid, + F_name, + F_parameter, + F_syntax, + F_data, + F_file, + F_descriptor, + F_socket, + F_device, + F_link, + F_pipe, + F_address, + F_port, + F_value, + F_process, + F_fork, + F_process_too_many, + #endif // _di_F_status_basic_ - #ifndef _di_f_status_invalid_ - f_invalid, - f_invalid_name, - f_invalid_parameter, - f_invalid_syntax, - f_invalid_data, - f_invalid_file, - f_invalid_directory, - f_invalid_descriptor, - f_invalid_socket, - f_invalid_device, - f_invalid_link, - f_invalid_pipe, - f_invalid_address, - f_invalid_port, - f_invalid_value, - f_invalid_buffer, - f_invalid_process, - f_invalid_utf, - f_invalid_on_eof, - f_invalid_on_eol, - f_invalid_on_eos, - f_invalid_on_stop, - #endif // _di_f_status_invalid_ + #ifndef _di_F_status_busy_ + F_busy, + F_busy_address, + F_busy_buffer, + F_busy_device, + F_busy_pipe, + F_busy_port, + F_busy_process, + F_busy_socket, + #endif // _di_F_status_busy_ - #ifndef _di_f_status_busy_ - f_busy, - f_busy_address, - f_busy_buffer, - f_busy_device, - f_busy_pipe, - 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_buffer, + F_unavailable_device, + F_unavailable_pipe, + F_unavailable_port, + F_unavailable_process, + F_unavailable_socket, + #endif // _di_F_status_unavailable_ - #ifndef _di_f_status_unavailable_ - f_unavailable, - f_unavailable_address, - f_unavailable_buffer, - f_unavailable_device, - f_unavailable_pipe, - f_unavailable_port, - f_unavailable_process, - f_unavailable_socket, - #endif // _di_f_status_unavailable_ + #ifndef _di_F_status_digits_ + 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_digits_ - 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_buffer_ + F_buffer, + F_buffer_too_small, + F_buffer_too_large, + F_eof, + F_eol, + F_eos, + F_stop, + F_incomplete_utf, + F_incomplete_utf_block, + F_incomplete_utf_eof, + F_incomplete_utf_eol, + F_incomplete_utf_eos, + F_incomplete_utf_stop, + F_none_block, + F_none_eof, + F_none_eol, + F_none_eos, + F_none_stop, + F_data_block_no, + F_data_no_eof, + F_data_no_eol, + F_data_no_eos, + F_data_no_stop, + F_string_too_small, + F_string_too_large, + F_unterminated, + F_unterminated_block, + F_unterminated_eof, + F_unterminated_eol, + F_unterminated_eos, + F_unterminated_stop, + F_unterminated_group, + F_unterminated_group_block, + F_unterminated_group_eof, + F_unterminated_group_eol, + F_unterminated_group_eos, + F_unterminated_group_stop, + F_unterminated_nest, + F_unterminated_nest_block, + F_unterminated_nest_eof, + F_unterminated_nest_eol, + F_unterminated_nest_eos, + F_unterminated_nest_stop, + #endif // _di_F_status_buffer_ - #ifndef _di_f_status_buffers_ - f_buffer_too_small, - f_buffer_too_large, - f_error_on_block, - f_error_on_eof, - f_error_on_eol, - f_error_on_eos, - f_error_on_stop, - f_incomplete_utf, - f_incomplete_utf_on_block, - f_incomplete_utf_on_eof, - f_incomplete_utf_on_eol, - f_incomplete_utf_on_eos, - f_incomplete_utf_on_stop, - f_none_on_block, - f_none_on_eof, - f_none_on_eol, - f_none_on_eos, - f_none_on_stop, - f_no_data_on_block, - 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, - f_unterminated_on_block, - f_unterminated_on_eof, - f_unterminated_on_eol, - f_unterminated_on_eos, - f_unterminated_on_stop, - f_unterminated_group, - f_unterminated_group_on_block, - f_unterminated_group_on_eof, - f_unterminated_group_on_eol, - f_unterminated_group_on_eos, - f_unterminated_group_on_stop, - f_unterminated_nest, - f_unterminated_nest_on_block, - 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_memory_ + F_memory_allocation, + F_memory_deallocation, + F_memory_reallocation, + #endif // _di_F_status_memory_ - #ifndef _di_f_status_allocation_ - f_error_allocation, - f_error_deallocation, - f_error_reallocation, - #endif // _di_f_status_allocation_ + #ifndef _di_F_status_file_ + F_file_closed, + F_file_error, + F_file_allocation, + F_file_close, + F_file_deallocation, + F_file_descriptor, + F_file_flush, + F_file_open, + F_file_purge, + F_file_read, + F_file_reallocation, + F_file_seek, + F_file_stat, + F_file_synchronize, + F_file_write, + F_file_empty, + F_file_found, + F_file_type_block, + F_file_type_character, + F_file_type_directory, + F_file_type_file, + F_file_type_link, + F_file_type_pipe, + F_file_type_socket, + F_file_type_unknown, + F_file_found_not, + F_file_open_not, + F_file_type_not_block, + F_file_type_not_character, + F_file_type_not_directory, + F_file_type_not_file, + F_file_type_not_link, + F_file_type_not_pipe, + F_file_type_not_socket, + F_file_type_not_unknown, + F_file_not_utf, + F_file_descriptors_max, + F_file_open_max, + F_file_utf, + #endif // _di_F_status_file_ - #ifndef _di_f_status_fork_ - f_fork_failed, - f_too_many_processes, - #endif // _di_f_status_fork_ + #ifndef _di_F_status_filesystem_ + F_filesystem, + F_filesystem_quota_blocks, + F_filesystem_quota_reached, + #endif // _di_F_status_filesystem_ - #ifndef _di_f_status_file_ - f_file_closed, - 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_empty, - f_file_found, - f_file_is_type_block, - f_file_is_type_character, - f_file_is_type_directory, - f_file_is_type_file, - f_file_is_type_link, - f_file_is_type_pipe, - f_file_is_type_socket, - f_file_is_type_unknown, - f_file_not_found, - f_file_not_open, - f_file_not_type_block, - f_file_not_type_character, - f_file_not_type_directory, - f_file_not_type_file, - f_file_not_type_link, - f_file_not_type_pipe, - f_file_not_type_socket, - f_file_not_type_unknown, - f_file_not_utf, - f_file_max_descriptors, - f_file_max_open, - f_file_utf, - #endif // _di_f_status_file_ + #ifndef _di_F_status_directory_ + F_directory, + F_directory_close, + F_directory_descriptor, + F_directory_flush, + F_directory_link_max, + F_directory_open, + F_directory_purge, + F_directory_read, + F_directory_stream, + F_directory_synchronize, + F_directory_unsupported, + F_directory_write, + F_directory_closed, + F_directory_empty, + F_directory_found, + F_directory_not_found, + F_directory_not_open, + F_directory_utf_not, + F_directory_utf, + #endif // _di_F_status_directory_ - #ifndef _di_f_status_filesystem_ - f_filesystem_error, - f_filesystem_quota_blocks, - f_filesystem_quota_reached, - #endif // _di_f_status_filesystem_ + #ifndef _di_F_status_socket_ + F_socket_connection_client, + F_socket_connection_target, + F_socket_receive, + F_socket_send, + #endif // _di_F_status_socket_ - #ifndef _di_f_status_directory_ - f_directory_error, - f_directory_error_close, - f_directory_error_descriptor, - f_directory_error_flush, - f_directory_error_link_max, - f_directory_error_open, - f_directory_error_purge, - f_directory_error_read, - f_directory_error_stream, - f_directory_error_synchronize, - f_directory_error_unsupported, - f_directory_error_write, - f_directory_closed, - f_directory_empty, - f_directory_found, - f_directory_not_found, - f_directory_not_open, - f_directory_not_utf, - f_directory_utf, - #endif // _di_f_status_directory_ + #ifndef _di_F_status_compare_ + F_than_less, + F_equal_to, + F_equal_to_not, + F_than_greater, + #endif // _di_F_status_compare_ - #ifndef _di_f_status_socket_ - 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_ - f_less_than, - f_equal_to, - f_not_equal_to, - f_greater_than, - #endif // _di_f_status_non_ - - #ifndef _di_f_status_access_denied_ - f_access_denied, - f_access_denied_execute, - f_access_denied_group, - 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, - #endif // _di_f_status_access_denied_ + #ifndef _di_F_status_access_ + F_access_denied, + F_access_denied_execute, + F_access_denied_group, + 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, + #endif // _di_F_status_access_ // Required. - f_status_code_last + F_status_code_last }; // enum -#endif // _di_f_status_codes_ +#endif // _di_F_status_codes_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index 394d3c9..adf6339 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -294,21 +294,21 @@ extern "C" { #define f_macro_string_dynamic_new(status, dynamic, new_length) \ f_macro_string_dynamic_clear(dynamic) \ status = f_memory_new((void **) & dynamic.string, sizeof(f_string), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ dynamic.used = 0; \ } #define f_macro_string_dynamic_delete(status, dynamic) \ status = f_memory_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_macro_string_dynamic_destroy(status, dynamic) \ status = f_memory_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } @@ -325,14 +325,14 @@ extern "C" { #define f_macro_string_dynamic_resize(status, dynamic, new_length) \ status = f_memory_resize((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } #define f_macro_string_dynamic_adjust(status, dynamic, new_length) \ status = f_memory_adjust((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } @@ -378,32 +378,32 @@ extern "C" { #define f_macro_string_dynamics_new(status, dynamics, length) \ f_macro_string_dynamics_clear(dynamics) \ status = f_memory_new((void **) & dynamics.array, sizeof(f_string_dynamic), length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamics.size = length; \ dynamics.used = 0; \ } #define f_macro_string_dynamics_delete(status, dynamics) \ - status = f_none; \ + status = F_none; \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ f_macro_string_dynamic_delete(status, dynamics.array[dynamics.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ - if (status == f_none) dynamics.size = 0; + if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ + if (status == F_none) dynamics.size = 0; #define f_macro_string_dynamics_destroy(status, dynamics) \ - status = f_none; \ + status = F_none; \ dynamics.used = dynamics.size; \ while (dynamics.used > 0) { \ dynamics.used--; \ f_macro_string_dynamic_destroy(status, dynamics.array[dynamics.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ - if (status == f_none) dynamics.size = 0; + if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size); \ + if (status == F_none) dynamics.size = 0; #define f_macro_string_dynamics_delete_simple(dynamics) \ dynamics.used = dynamics.size; \ @@ -430,16 +430,16 @@ extern "C" { } #define f_macro_string_dynamics_resize(status, dynamics, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < dynamics.size) { \ f_string_length i = dynamics.size - new_length; \ for (; i < dynamics.size; i++) { \ f_macro_string_dynamic_delete(status, dynamics.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) { \ if (new_length > dynamics.size) { \ f_string_length i = dynamics.size; \ for (; i < new_length; i++) { \ @@ -451,16 +451,16 @@ extern "C" { } #define f_macro_string_dynamics_adjust(status, dynamics, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < dynamics.size) { \ f_string_length i = dynamics.size - new_length; \ for (; i < dynamics.size; i++) { \ f_macro_string_dynamic_destroy(status, dynamics.array[i], f_string_dynamic); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) { \ if (new_length > dynamics.size) { \ f_string_length i = dynamics.size; \ for (; i < new_length; i++) { \ diff --git a/level_0/f_utf/c/private-utf.c b/level_0/f_utf/c/private-utf.c index 0529a99..d38b3cf 100644 --- a/level_0/f_utf/c/private-utf.c +++ b/level_0/f_utf/c/private-utf.c @@ -10,7 +10,7 @@ extern "C" { // @todo: handle all Unicode "alpha". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_alpha_) || !defined(_di_f_utf_is_alpha_) @@ -19,7 +19,7 @@ extern "C" { // @todo: handle all Unicode "alpha_numeric". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_alpha_numeric_) || !defined(_di_f_utf_is_alpha_numeric_) @@ -28,30 +28,30 @@ extern "C" { if (width == 2) { // Latin-1 Supplement: U+0080 to U+009F. if (character >= 0xc2800000 && character <= 0xc29f0000) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 3) { // @todo these might not be "control characters" and instead be "marking characters" or "combining characters". // Special: U+FFF9 to U+FFFB. if (character >= 0xefbfb900 && character <= 0xefbfbb00) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 4) { // Tags: U+E0001 and U+E007F. if (character == 0xf3a08081 || character == 0xf3a081bf) { - return f_true; + return F_true; } } - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_control_) || !defined(_di_f_utf_is_control_) @@ -59,15 +59,15 @@ extern "C" { f_return_status private_f_utf_character_is_control_picture(const f_utf_character character) { // Control Pictures: U+2400 to U+2426. if (character >= 0xe2908000 && character <= 0xe290a600) { - return f_true; + return F_true; } // Specials: U+FFFC to U+FFFD. if (character == 0xefbfbc00 || character == 0xefbfbd00) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_control_picture_) || !defined(_di_f_utf_is_control_picture_) @@ -76,7 +76,7 @@ extern "C" { // @todo: handle all Unicode "numeric". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_numeric_) || !defined(_di_f_utf_is_numeric_) @@ -90,93 +90,93 @@ extern "C" { if (byte_first < 0xc2 || byte_first > 0xdf) { // Valid UTF-8-2 range = %xC2-DF UTF8-tail. - return f_false; + return F_false; } if (byte_first == 0xcd) { // Greek and Coptic: U+0378, U+0379. if (byte == 0xb8 || byte == 0xb9) { - return f_false; + return F_false; } } else if (byte_first == 0xce) { // Greek and Coptic: U+0380 to U+0383. if (byte >= 0x80 && byte <= 0x83) { - return f_false; + return F_false; } // Greek and Coptic: U+038B, U+038D, U+03A2. if (byte == 0x8b || byte == 0x8d || byte == 0xa2) { - return f_false; + return F_false; } } else if (byte_first == 0xd4) { // Armenian: U+0530. if (byte == 0xb0) { - return f_false; + return F_false; } } else if (byte_first == 0xd5) { // Armenian: U+0557, U+0558, U+0560, U+0588. if (byte == 0x97 || byte == 0x98 || byte == 0xa0 || byte == 0x88) { - return f_false; + return F_false; } } else if (byte_first == 0xd6) { // Armenian: U+058B, U+058C. if (byte == 0x8b || byte == 0x8c) { - return f_false; + return F_false; } // Hebrew: U+0590. if (byte == 0x90) { - return f_false; + return F_false; } } else if (byte_first == 0xd7) { // Hebrew: U+05C8 to U+05CF. if (byte >= 0x88 && byte <= 0x8F) { - return f_false; + return F_false; } // Hebrew: U+05EB to U+05EF. if (byte >= 0xab && byte <= 0xaf) { - return f_false; + return F_false; } // Hebrew: U+05F5 to U+05FF. if (byte >= 0xb5 && byte <= 0xbf) { - return f_false; + return F_false; } } else if (byte_first == 0xd8) { // Arabic: U+061D. if (byte == 0x9d) { - return f_false; + return F_false; } } else if (byte_first == 0xdc) { // Syriac: U+070E. if (byte == 0x8e) { - return f_false; + return F_false; } } else if (byte_first == 0xdd) { // Syriac: U+074B, U+074C. if (byte == 0x8b || byte == 0x8c) { - return f_false; + return F_false; } } else if (byte_first == 0xde) { // Thaana: U+07B2 to U+07BF. if (byte >= 0xb2 && byte <= 0xbf) { - return f_false; + return F_false; } } else if (byte_first == 0xdf) { // NKo: U+07FB to U+07FF. if (byte >= 0xbb && byte <= 0xbf) { - return f_false; + return F_false; } } } @@ -185,7 +185,7 @@ extern "C" { if (byte_first < 0xe0 || byte_first > 0xef) { // Valid UTF-8-3 ranges = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) - return f_false; + return F_false; } if (byte_first == 0xe0) { @@ -194,1044 +194,1044 @@ extern "C" { // Valid UTF-8-3 ranges = %xE0 %xA0-BF UTF8-tail if (byte_second < 0xa0 || byte_second > 0xbf) { - return f_false; + return F_false; } } // Arabic Extended-A: U+08B5, U+08BE to U+08D3. if (bytes == 0xa2b5 || bytes >= 0xa2be && bytes <= 0xa393) { - return f_false; + return F_false; } // Bengali: U+09B3 to U+09B5. if (bytes >= 0xa6b3 && bytes <= 0xa6b5) { - return f_false; + return F_false; } // Bengali: U+09CF to U+09D6. if (bytes >= 0xa78f && bytes <= 0xa796) { - return f_false; + return F_false; } // Bengali: U+09D8 to U+09DB. if (bytes >= 0xa798 && bytes <= 0xa79b) { - return f_false; + return F_false; } // Bengali: U+09FC to U+09FF. if (bytes >= 0xa7bc && bytes <= 0xa7bf) { - return f_false; + return F_false; } // Bengali: U+0984, U+098D, U+098E, U+0991. if (bytes == 0xa684 || bytes == 0xa68d || bytes == 0xa68e || bytes == 0xa691) { - return f_false; + return F_false; } // Bengali: U+0992, U+09A9, U+09B1, U+09BA. if (bytes == 0xa692 || bytes == 0xa6a9 || bytes == 0xa6b1 || bytes == 0xa6ba) { - return f_false; + return F_false; } // Bengali: U+09BB, U+09C5, U+09C6, U+09C9. if (bytes == 0xa6bb || bytes == 0xa785 || bytes == 0xa786 || bytes == 0xa789) { - return f_false; + return F_false; } // Bengali: U+09CA, U+09DE, U+09E4, U+09E5. if (bytes == 0xa78a || bytes == 0xe79e || bytes == 0xa7a4 || bytes == 0xa7a5) { - return f_false; + return F_false; } // Gujarati: U+0AD1 to U+0ADF. if (bytes >= 0xab91 && bytes <= 0xab94) { - return f_false; + return F_false; } // Gujarati: U+0AF2 to U+0AF8. if (bytes >= 0xabb2 && bytes <= 0xabb8) { - return f_false; + return F_false; } // Gujarati: U+0AFA to U+0AFF. if (bytes >= 0xabba && bytes <= 0xabbf) { - return f_false; + return F_false; } // Gujarati: U+0A80, U+0A84, U+0A8E, U+0A92. if (bytes == 0xaa80 || bytes == 0xaa84 || bytes == 0xaa8e || bytes == 0xaa92) { - return f_false; + return F_false; } // Gujarati: U+0AA9, U+0AB1, U+0AB4, U+0ABA. if (bytes == 0xaaa9 || bytes == 0xaab1 || bytes == 0xaab4 || bytes == 0xaaba) { - return f_false; + return F_false; } // Gujarati: U+0ABB, U+0AC6, U+0ACA, U+0ACE. if (bytes == 0xaabb || bytes == 0xab86 || bytes == 0xab8a || bytes == 0xab8e) { - return f_false; + return F_false; } // Gujarati: U+0ACF, U+0AE4, U+0AE5. if (bytes == 0xab8f || bytes == 0xaba4 || bytes == 0xaba5) { - return f_false; + return F_false; } // Gurmukhi: U+0A0B to U+0A0E. if (bytes >= 0xa88b && bytes <= 0xa88e) { - return f_false; + return F_false; } // Gurmukhi: U+0A43 to U+0A46. if (bytes >= 0xa983 && bytes <= 0xa986) { - return f_false; + return F_false; } // Gurmukhi: U+0A4E to U+0A50. if (bytes >= 0xa98e && bytes <= 0xa990) { - return f_false; + return F_false; } // Gurmukhi: U+0A52 to U+0A58. if (bytes >= 0xa992 && bytes <= 0xa998) { - return f_false; + return F_false; } // Gurmukhi: U+0A5F to U+0A65. if (bytes >= 0xa99f && bytes <= 0xa9a5) { - return f_false; + return F_false; } // Gurmukhi: U+0A76 to U+0A7F. if (bytes >= 0xa9b6 && bytes <= 0xa9bf) { - return f_false; + return F_false; } // Gurmukhi: U+0A00, U+0A04, U+0A11, U+0A12. if (bytes == 0xa880 || bytes == 0xa884 || bytes == 0xa891 || bytes == 0xa892) { - return f_false; + return F_false; } // Gurmukhi: U+0A29, U+0A31, U+0A34, U+0A37. if (bytes == 0xa8a9 || bytes == 0xa8b1 || bytes == 0xa8b4 || bytes == 0xa8b7) { - return f_false; + return F_false; } // Gurmukhi: U+0A3A, U+0A3B, U+0A3D, U+0A49. if (bytes == 0xa8ba || bytes == 0xa8bb || bytes == 0xa8bd || bytes == 0xa989) { - return f_false; + return F_false; } // Gurmukhi: U+0A4A, U+0A5D. if (bytes == 0xa98a || bytes == 0xa99d) { - return f_false; + return F_false; } // Kannada: U+0CCE to U+0CD4. if (bytes >= 0xb38e && bytes <= 0xe394) { - return f_false; + return F_false; } // Kannada: U+0CD7 to U+0CDD. if (bytes >= 0xb397 && bytes <= 0xb39d) { - return f_false; + return F_false; } // Kannada: U+0CF3 to U+0CFF. if (bytes >= 0xb3b3 && bytes <= 0xb3bf) { - return f_false; + return F_false; } // Kannada: U+0C84, U+0C8D, U+0C91, U+0CA9. if (bytes == 0xb284 || bytes == 0xb28d || bytes == 0xb291 || bytes == 0xb2a9) { - return f_false; + return F_false; } // Kannada: U+0CB4, U+0CBA, U+0CBB, U+0CC5. if (bytes == 0xb284 || bytes == 0xb2ba || bytes == 0xb2bb || bytes == 0xb385) { - return f_false; + return F_false; } // Kannada: U+0CC9, U+0CDF, U+0CE4, U+0CE5. if (bytes == 0xb389 || bytes == 0xb39f || bytes == 0xb3a4 || bytes == 0xb3a5) { - return f_false; + return F_false; } // Kannada: U+0CF0. if (bytes == 0xb3b0) { - return f_false; + return F_false; } // Lao: U+0E90 to U+0E93. if (bytes >= 0xba90 && bytes <= 0xba93) { - return f_false; + return F_false; } // Lao: U+0EE0 to U+0EFF. if (bytes >= 0xbba0 && bytes <= 0xbbbf) { - return f_false; + return F_false; } // Lao: U+0E80, U+0E83, U+0E85, U+0E86. if (bytes == 0xba80 || bytes == 0xba83 || bytes == 0xba85 || bytes == 0xba86) { - return f_false; + return F_false; } // Lao: U+0E89, U+0E8B, U+0E8C, U+0E8E. if (bytes == 0xba89 || bytes == 0xba8b || bytes == 0xba8c || bytes == 0xba8e) { - return f_false; + return F_false; } // Lao: U+0E8F, U+0E98, U+0EA0, U+0EA4. if (bytes == 0xba8f || bytes == 0xba98 || bytes == 0xbaa0 || bytes == 0xbaa4) { - return f_false; + return F_false; } // Lao: U+0EA6, U+0EA8, U+0EA9, U+0EAC. if (bytes == 0xba86 || bytes == 0xba88 || bytes == 0xbaa9 || bytes == 0xbaac) { - return f_false; + return F_false; } // Lao: U+0EBA, U+0EBE, U+0EBF, U+0EC5. if (bytes == 0xbaba || bytes == 0xbabe || bytes == 0xbabf || bytes == 0xbb85) { - return f_false; + return F_false; } // Lao: U+0EC7, U+0ECE, U+0ECF, U+0EDA. if (bytes == 0xbb87 || bytes == 0xbb8e || bytes == 0xbb8f || bytes == 0xbb9a) { - return f_false; + return F_false; } // Lao: U+0EDB. if (bytes == 0xbb9b) { - return f_false; + return F_false; } // Malayalam: U+0D50 to U+0D53. if (bytes >= 0xb590 && bytes <= 0xb593) { - return f_false; + return F_false; } // Malayalam: U+0D00, U+0D04, U+0D0D, U+0D11. if (bytes == 0xb480 || bytes == 0xb484 || bytes == 0xb48d || bytes == 0xb491) { - return f_false; + return F_false; } // Malayalam: U+0D3B, U+0D3C, U+0D45, U+0D49. if (bytes == 0xb4bb || bytes == 0xb4bc || bytes == 0xb585 || bytes == 0xb589) { - return f_false; + return F_false; } // Malayalam: U+0D64, U+0D65. if (bytes == 0xb5a4 || bytes == 0xb5a5) { - return f_false; + return F_false; } // Mandaic: U+085C, U+085D, U+085F. if (bytes == 0xa19c || bytes == 0xa19d || bytes == 0xa19f) { - return f_false; + return F_false; } // Oriya: U+0B50 to U+0B55. if (bytes >= 0xad90 && bytes <= 0xad95) { - return f_false; + return F_false; } // Oriya: U+0B58 to U+0B5B. if (bytes >= 0xad98 && bytes <= 0xad9b) { - return f_false; + return F_false; } // Oriya: U+0B78 to U+0B7F. if (bytes >= 0xadb8 && bytes <= 0xadbf) { - return f_false; + return F_false; } // Oriya: U+0B00, U+0B04, U+0B0D. if (bytes == 0xac80 || bytes == 0xac84 || bytes == 0xac8d) { - return f_false; + return F_false; } // Oriya: U+0B0E, U+0B11, U+0B29. if (bytes == 0xac8e || bytes == 0xac91 || bytes == 0xaca9) { - return f_false; + return F_false; } // Oriya: U+0B31, U+0B34, U+0B3A. if (bytes == 0xacb1 || bytes == 0xacb4 || bytes == 0xacba) { - return f_false; + return F_false; } // Oriya: U+0B3B, U+0B45, U+0B46. if (bytes == 0xacbb || bytes == 0xad85 || bytes == 0xad86) { - return f_false; + return F_false; } // Oriya: U+0B49, U+0B4A, U+0B4E. if (bytes == 0xad89 || bytes == 0xad8a || bytes == 0xad8e) { - return f_false; + return F_false; } // Oriya: U+0B4F, U+0B5E, U+0B64. if (bytes == 0xad8f || bytes == 0xad9e || bytes == 0xada4) { - return f_false; + return F_false; } // Oriya: U+0B65. if (bytes == 0xada5) { - return f_false; + return F_false; } // Sinhala: U+0D97 to U+0D99. if (bytes >= 0xb697 && bytes <= 0xb699) { - return f_false; + return F_false; } // Sinhala: U+0DC7 to U+0DC9. if (bytes >= 0xb787 && bytes <= 0xb789) { - return f_false; + return F_false; } // Sinhala: U+0DCB to U+0DCE. if (bytes >= 0xb78b && bytes <= 0xb78e) { - return f_false; + return F_false; } // Sinhala: U+0DE0 to U+0DE5. if (bytes >= 0xb7a0 && bytes <= 0xb7a5) { - return f_false; + return F_false; } // Sinhala: U+0DF5 to U+0DFF. if (bytes >= 0xb7b5 && bytes <= 0xb7bf) { - return f_false; + return F_false; } // Sinhala: U+0D80, U+0D81, U+0D84. if (bytes == 0xb680 || bytes == 0xb681 || bytes == 0xb684) { - return f_false; + return F_false; } // Sinhala: U+0DB2, U+0DBC, U+0DBE. if (bytes == 0xb6b2 || bytes == 0xb6bc || bytes == 0xb6be) { - return f_false; + return F_false; } // Sinhala: U+0DBF, U+0DD5, U+0DD7. if (bytes == 0xb6bf || bytes == 0xb795 || bytes == 0xb797) { - return f_false; + return F_false; } // Sinhala: U+0DF0, U+0DF1. if (bytes == 0xb7b0 || bytes == 0xb7b1) { - return f_false; + return F_false; } // Samaritan: U+082E, U+082F, U+083F. if (bytes == 0xa0ae || bytes == 0xa0af || bytes == 0xa0bf) { - return f_false; + return F_false; } // Tamil: U+0B80, U+0B81. if (bytes == 0xae80 || bytes == 0xae81) { - return f_false; + return F_false; } // Tamil: U+0B8B to U+0B8D. if (bytes >= 0xae8b && bytes <= 0xae8d0) { - return f_false; + return F_false; } // Tamil: U+0B96 to U+0B98. if (bytes >= 0xae96 && bytes <= 0xae98) { - return f_false; + return F_false; } // Tamil: U+0BA0 to U+0BA2. if (bytes >= 0xaea0 && bytes <= 0xaea2) { - return f_false; + return F_false; } // Tamil: U+0BA5 to U+0BA7. if (bytes >= 0xaea5 && bytes <= 0xaea7) { - return f_false; + return F_false; } // Tamil: U+0BAB to U+0BAD. if (bytes >= 0xaeab && bytes <= 0xaead) { - return f_false; + return F_false; } // Tamil: U+0BBA to U+0BBD. if (bytes >= 0xaeba && bytes <= 0xaebd) { - return f_false; + return F_false; } // Tamil: U+0BC3 to U+0BC5. if (bytes >= 0xaf83 && bytes <= 0xaf85) { - return f_false; + return F_false; } // Tamil: U+0BCE, U+0BCF. if (bytes == 0xaf8e || bytes == 0xaf8f) { - return f_false; + return F_false; } // Tamil: U+0BD1 to U+0BD6. if (bytes >= 0xaf91 && bytes <= 0xaf96) { - return f_false; + return F_false; } // Tamil: U+0BD8 to U+0BE5. if (bytes >= 0xaf98 && bytes <= 0xaf98) { - return f_false; + return F_false; } // Tamil: U+0BFB to U+0BFF. if (bytes >= 0xafbb && bytes <= 0xafbf) { - return f_false; + return F_false; } // Tamil: U+0B84, U+0B91, U+0BC9. if (bytes == 0xae84 || bytes == 0xae91 || bytes == 0xaf89) { - return f_false; + return F_false; } // Telugu: U+0C3A to U+0C3C. if (bytes >= 0xb0ba && bytes <= 0xb0bc) { - return f_false; + return F_false; } // Telugu: U+0C4E to U+0C54. if (bytes >= 0xb18e && bytes <= 0xb194) { - return f_false; + return F_false; } // Telugu: U+0C5B to U+0C5F. if (bytes >= 0xb19b && bytes <= 0xb19f) { - return f_false; + return F_false; } // Telugu: U+0C64, U+0C65. if (bytes == 0xb1a4 || bytes == 0xb1a5) { - return f_false; + return F_false; } // Telugu: U+0C70 to U+0C77. if (bytes >= 0xb1b0 && bytes <= 0xb1b7) { - return f_false; + return F_false; } // Telugu: U+0C04, U+0C0D, U+0C29. if (bytes == 0xb084 || bytes == 0xb08d || bytes == 0xb0a9) { - return f_false; + return F_false; } // Telugu: U+0C45, U+0C49, U+0C57. if (bytes == 0xb185 || bytes == 0xb189 || bytes == 0xb197) { - return f_false; + return F_false; } // Thai: U+0E5C to U+0E7F. if (bytes >= 0xb99c && bytes <= 0xb9bf) { - return f_false; + return F_false; } // Thai: U+0E3B to U+0E3E. if (bytes >= 0xb8bb && bytes <= 0xb8be) { - return f_false; + return F_false; } // Thai: U+0E00. if (bytes == 0xb880) { - return f_false; + return F_false; } // Tibetan: U+0FDB to U+0FFF. if (bytes >= 0xbf9b && bytes <= 0xbfbf) { - return f_false; + return F_false; } // Tibetan: U+0F6D to U+0F70. if (bytes >= 0xbdad && bytes <= 0xbdb0) { - return f_false; + return F_false; } // Tibetan: U+0F48, U+0F98, U+0FBD, U+0FCD. if (bytes == 0xbd88 || bytes == 0xbe98 || bytes == 0xbebd || bytes == 0xbf8d) { - return f_false; + return F_false; } } else if (byte_first == 0xe1) { // Batak: U+1BF4 to U+1BFB. if (bytes >= 0xafb4 && bytes <= 0xafbb) { - return f_false; + return F_false; } // Buginese: U+1A1C to U+1A1D. if (bytes >= 0xa89c && bytes <= 0xa89d) { - return f_false; + return F_false; } // Buhid: U+1754 to U+175F. if (bytes >= 0x9d94 && bytes <= 0x9d9f) { - return f_false; + return F_false; } // Cherokee: U+13F6, U+13F7, U+13FE, U+13FF. if (bytes == 0x8fb6 || bytes <= 0x8fb7 || bytes <= 0x8fbe || bytes <= 0x8fbf) { - return f_false; + return F_false; } // Combining Diacritical Marks Supplement: U+1ABF to U+1AFF. if (bytes >= 0xaabf && bytes <= 0xabbf) { - return f_false; + return F_false; } // Cyrillic Extended-C: U+1C89 to U+1C8F. if (bytes >= 0xb289 && bytes <= 0xb28f) { - return f_false; + return F_false; } // Ethiopic: U+137D to U+137F. if (bytes >= 0x8dbd && bytes <= 0x8dbf) { - return f_false; + return F_false; } // Ethiopic: U+1249, U+124E, U+124F, U+1257. if (bytes == 0x8989 || bytes == 0x898e || bytes == 0x898f || bytes == 0x8997) { - return f_false; + return F_false; } // Ethiopic: U+1259, U+125E, U+125F, U+1289. if (bytes == 0x8999 || bytes == 0x899e || bytes == 0x899f || bytes == 0x8a89) { - return f_false; + return F_false; } // Ethiopic: U+128E, U+128F, U+12B1, U+12B6. if (bytes == 0x8a8e || bytes == 0x8a8f || bytes == 0x8ab1 || bytes == 0x8ab6) { - return f_false; + return F_false; } // Ethiopic: U+12B7, U+12BF, U+12C1, U+12C6. if (bytes == 0x8ab7 || bytes == 0x8abf || bytes == 0x8b81 || bytes == 0x8b86) { - return f_false; + return F_false; } // Ethiopic: U+12C7, U+12D7, U+1311, U+1316. if (bytes == 0x8b87 || bytes == 0x8b97 || bytes == 0x8c91 || bytes == 0x8c96) { - return f_false; + return F_false; } // Ethiopic: U+1317, U+135B, U+135C. if (bytes == 0x8c97 || bytes == 0x8d9b || bytes == 0x8d9c) { - return f_false; + return F_false; } // Ethiopic Supplement: U+139A to U+139F. if (bytes >= 0x8e9a && bytes <= 0x8e9f) { - return f_false; + return F_false; } // Georgian: U+10C8 to U+10CC. if (bytes >= 0x8388 && bytes <= 0x838c) { - return f_false; + return F_false; } // Georgian: U+10C6, U+10CE, U+10CF. if (bytes == 0x8386 || bytes == 0x838e || bytes == 0x838f) { - return f_false; + return F_false; } // Greek Extended: U+1F16, U+1F17, U+1F1E, U+1F1F. if (bytes == 0xbc96 || bytes == 0xbc97 || bytes == 0xbc9e || bytes == 0xbc9f) { - return f_false; + return F_false; } // Greek Extended: U+1F46, U+1F47, U+1F4E, U+1F4F. if (bytes == 0xbd86 || bytes == 0xbd87 || bytes == 0xbd8e || bytes == 0xbd8f) { - return f_false; + return F_false; } // Greek Extended: U+1F58, U+1F5A, U+1F5C, U+1F5E. if (bytes == 0xbd98 || bytes == 0xbd9a || bytes == 0xbd9c || bytes == 0xbd9e) { - return f_false; + return F_false; } // Greek Extended: U+1F7E, U+1F7F, U+1FB5, U+1FC5. if (bytes == 0xbdbe || bytes == 0xbdbf || bytes == 0xbeb5 || bytes == 0xbf85) { - return f_false; + return F_false; } // Greek Extended: U+1FD4, U+1FD5, U+1FDC, U+1FF0. if (bytes == 0xbf94 || bytes == 0xbf95 || bytes == 0xbf9c || bytes == 0xbfb0) { - return f_false; + return F_false; } // Greek Extended: U+1FF1, U+1FF5, U+1FFF. if (bytes == 0xbfb1 || bytes == 0xbfb5 || bytes == 0xbfbf) { - return f_false; + return F_false; } // Hanunoo: U+1737 to U+173F. if (bytes >= 0x9cb7 && bytes <= 0x9cbf) { - return f_false; + return F_false; } // Khmer: U+17EA to U+17EF. if (bytes >= 0x9faa && bytes <= 0x9faf) { - return f_false; + return F_false; } // Khmer: U+17FA to U+17FF. if (bytes >= 0x9fba && bytes <= 0x9fbf) { - return f_false; + return F_false; } // Khmer: U+17DE, U+17DF. if (bytes == 0x9f9e || bytes == 0x9f9f) { - return f_false; + return F_false; } // Lepcha: U+1C38 to U+1C3A. if (bytes >= 0xb0b8 && bytes <= 0xb0ba) { - return f_false; + return F_false; } // Lepcha: U+1C4A to U+1C4C. if (bytes >= 0xb18a && bytes <= 0xb18c) { - return f_false; + return F_false; } // Limbu: U+192C to U+192F. if (bytes >= 0xa4ac && bytes <= 0xa4af) { - return f_false; + return F_false; } // Limbu: U+193C to U+193F. if (bytes >= 0xa4bc && bytes <= 0xa4bf) { - return f_false; + return F_false; } // Limbu: U+1941 to U+1943. if (bytes >= 0xa581 && bytes <= 0xa583) { - return f_false; + return F_false; } // Limbu: U+191F. if (bytes == 0xa49f) { - return f_false; + return F_false; } // New Tai Lue: U+19AC to U+19AF. if (bytes >= 0xa6ac && bytes <= 0xa6af) { - return f_false; + return F_false; } // New Tai Lue: U+19CA to U+19CF. if (bytes >= 0xa78a && bytes <= 0xa78f) { - return f_false; + return F_false; } // New Tai Lue: U+19DB to U+19DD. if (bytes >= 0xa79b && bytes <= 0xa79d) { - return f_false; + return F_false; } // Ogham: U+169D to U+169F. if (bytes >= 0x9a9d && bytes <= 0x9a9f) { - return f_false; + return F_false; } // Runic: U+16F9 to U+16FF. if (bytes >= 0x9bb9 && bytes <= 0x9bbf) { - return f_false; + return F_false; } // Sundanese Supplement: U+1CC8 to U+1CCF. if (bytes >= 0xb388 && bytes <= 0xb38f) { - return f_false; + return F_false; } // Tagalog: U+1715 to U+171f. if (bytes >= 0x9c95 && bytes <= 0x9c9f) { - return f_false; + return F_false; } // Tagalog: U+170D if (bytes == 0x9c8d) { - return f_false; + return F_false; } // Tagbanwa: U+1774 to U+177f. if (bytes >= 0x9db4 && bytes <= 0x9dbf) { - return f_false; + return F_false; } // Tagbanwa: U+176D, U+1771 if (bytes == 0x9dad || bytes == 0x9db1) { - return f_false; + return F_false; } // Tai Lee: U+196E, U+196F. if (bytes == 0xa5ae || bytes == 0xa5ef) { - return f_false; + return F_false; } // Tai Lee: U+1975 to U+197F. if (bytes >= 0xa5b5 && bytes <= 0xa5bf) { - return f_false; + return F_false; } // Tai Tham: U+1A7D to U+1A7E. if (bytes >= 0xa9bd && bytes <= 0xa9be) { - return f_false; + return F_false; } // Tai Tham: U+1A8A to U+1A8F. if (bytes >= 0xaa8a && bytes <= 0xaa8f) { - return f_false; + return F_false; } // Tai Tham: U+1A9A to U+1A9F. if (bytes >= 0xaa9a && bytes <= 0xaa9f) { - return f_false; + return F_false; } // Tai Tham: U+1AAE to U+1AAF. if (bytes >= 0xaaae && bytes <= 0xaaaf) { - return f_false; + return F_false; } // Tai Tham: U+1A5F. if (bytes == 0xa99f) { - return f_false; + return F_false; } // Unified Canadian Aboriginal Syllabics Extended: U+18F6 to U+18FF. if (bytes >= 0xa3b6 && bytes <= 0xa3bf) { - return f_false; + return F_false; } // Vedic Extensions: U+1CF7 and U+1CFA to U+1CFF. if (bytes == 0xb3b7 || bytes >= 0xb3ba && bytes <= 0xb3bf) { - return f_false; + return F_false; } } else if (byte_first == 0xe2) { // CJK Radicals Supplement: U+2E9A, U+2EF4 to U+2EFF. if (bytes == 0xba9a || bytes >= 0xbbb4 && bytes <= 0xbbbf) { - return f_false; + return F_false; } // Combining Diacritical Marks for Symbols: U+20F1 to U+20FF. if (bytes >= 0x83b1 && bytes <= 0x83bf) { - return f_false; + return F_false; } // Control Pictures: U+2427 to U+243F. if (bytes >= 0x90a7 && bytes <= 0x90bf) { - return f_false; + return F_false; } // Coptic: U+2CF4 to U+2CF8. if (bytes >= 0xb3b4 && bytes <= 0xb3b8) { - return f_false; + return F_false; } // Currency Symbols: U+20BF to U+20CF. if (bytes >= 0x82bf && bytes <= 0x838f) { - return f_false; + return F_false; } // Ethiopic Extended: U+2D97 to U+2D9F. if (bytes >= 0xb697 && bytes <= 0xb69f) { - return f_false; + return F_false; } // Ethiopic Extended: U+2DA7, U+2DAF, U+2DB7, U+2DBF. if (bytes == 0xb6a7 || bytes == 0xb6af || bytes == 0xb6b7 || bytes == 0xb6bf) { - return f_false; + return F_false; } // Ethiopic Extended: U+2DC7, U+2DCF, U+2DD7, U+2DDF. if (bytes == 0xb787 || bytes == 0xb78f || bytes == 0xb797 || bytes == 0xb79f) { - return f_false; + return F_false; } // General Punctuation: U+2065. if (bytes == 0x81a5) { - return f_false; + return F_false; } // Georgian Supplement: U+2D28 to U+2D2C. if (bytes >= 0xb4a8 && bytes <= 0xb4ac) { - return f_false; + return F_false; } // Georgian Supplement: U+2D26, U+2D2E, U+2D2F. if (bytes == 0xb4a6 || bytes == 0xb4ae || bytes == 0xb4af) { - return f_false; + return F_false; } // Glagolitic: U+2C2F, U+2C5F. if (bytes == 0xb0af || bytes == 0xb19f) { - return f_false; + return F_false; } // Ideographic Description Characters: U+2FFC to U+2FFF. if (bytes >= 0xbfbc && bytes <= 0xbfbf) { - return f_false; + return F_false; } // Kangxi Radicals: U+2FD6 to U+2FDF. if (bytes >= 0xbf96 && bytes <= 0xbf9f) { - return f_false; + return F_false; } // Miscellaneous Symbols and Arrows: U+2BBA to U+2BBC. if (bytes >= 0xaeba && bytes <= 0xaebc) { - return f_false; + return F_false; } // Miscellaneous Symbols and Arrows: U+2BD2 to U+2BEB. if (bytes >= 0xaf92 && bytes <= 0xafab) { - return f_false; + return F_false; } // Miscellaneous Symbols and Arrows: U+2BF0 to U+2BFF. if (bytes >= 0xafb0 && bytes <= 0xafbf) { - return f_false; + return F_false; } // Miscellaneous Symbols and Arrows: U+2B74, U+2B75, U+2B96. if (bytes == 0xadb4 || bytes == 0xadb5 || bytes == 0xae96) { - return f_false; + return F_false; } // Miscellaneous Symbols and Arrows: U+2B97, U+2BC9. if (bytes == 0xae97 || bytes == 0xaf89) { - return f_false; + return F_false; } // Miscellaneous Technical: U+23FF. if (bytes == 0x8fbf) { - return f_false; + return F_false; } // Number Forms: U+218C to U+218F. if (bytes >= 0x868c && bytes <= 0x868f) { - return f_false; + return F_false; } // Optical Character Recognition: U+244B to U+245F. if (bytes >= 0x918b && bytes <= 0x919f) { - return f_false; + return F_false; } // Superscripts and Subscripts: U+2072, U+2073, U+208F. if (bytes == 0x81b2 || bytes == 0x81b3 || bytes == 0x828f) { - return f_false; + return F_false; } // Superscripts and Subscripts: U+209D to U+209F. if (bytes >= 0x829d && bytes <= 0x829f) { - return f_false; + return F_false; } // Supplemental Punctuation: U+2E45 to U+2E7F. if (bytes >= 0xb985 && bytes <= 0xb9bf) { - return f_false; + return F_false; } // Tifinagh: U+2D68 to U+2D6E. if (bytes >= 0xb5a8 && bytes <= 0xb5ae) { - return f_false; + return F_false; } // Tifinagh: U+2D71 to U+2D7E. if (bytes >= 0xb5b1 && bytes <= 0xb5be) { - return f_false; + return F_false; } } else if (byte_first == 0xe3) { // Bopomofo: U+3100 to U+3104. if (bytes >= 0x8480 && bytes <= 0x8484) { - return f_false; + return F_false; } // Bopomofo: U+312E, U+312F. if (bytes == 0x84ae || bytes == 0x84af) { - return f_false; + return F_false; } // Bopomofo Extended: U+31BB to U+31BF. if (bytes >= 0x86bb && bytes <= 0x86bf) { - return f_false; + return F_false; } // CJK Strokes: U+31E4 to U+31EF. if (bytes >= 0x87a4 && bytes <= 0x87af) { - return f_false; + return F_false; } // Enclosed CJK Letters and Months: U+321F, U+32FF. if (bytes == 0x889f || bytes == 0x8bbf) { - return f_false; + return F_false; } // Hangul Compatibility Jamo: U+3130, U+318F. if (bytes == 0x84b0 || bytes == 0x868f) { - return f_false; + return F_false; } // Hiragana: U+3040, U+3097, U+3098. if (bytes == 0x8180 || bytes == 0x8297 || bytes == 0x8298) { - return f_false; + return F_false; } } else if (byte_first == 0xe4) { // CJK Unified Ideographs Extension A: U+4DB6, U+4DBF. if (bytes >= 0xb6b6 && bytes <= 0xb6bf) { - return f_false; + return F_false; } } else if (byte_first == 0xe9) { // CJK Unified Ideographs: U+9FD6, U+9FFF. if (bytes >= 0xbf96 && bytes <= 0xbfbf) { - return f_false; + return F_false; } } else if (byte_first == 0xea) { // Balinese: U+1B4C to U+1B4F. if (bytes >= 0xad8c && bytes <= 0xad8f) { - return f_false; + return F_false; } // Balinese: U+1B7D to U+1B7F. if (bytes >= 0xadbd && bytes <= 0xadbf) { - return f_false; + return F_false; } // Bamum: U+A6F8 to U+A6FF. if (bytes >= 0x9bb8 && bytes <= 0x9bbf) { - return f_false; + return F_false; } // Cham: U+AA37 to U+AA3F. if (bytes >= 0xa8b7 && bytes <= 0xa8bf) { - return f_false; + return F_false; } // Cham: U+AA4E, U+AA4F, U+AA5A, U+AA5B. if (bytes == 0xa98e || bytes == 0xa98f || bytes == 0xa99a || bytes == 0xa99b) { - return f_false; + return F_false; } // Common Indic Number Forms: U+A83A, U+A83F. if (bytes == 0xa0ba || bytes == 0xa0bf) { - return f_false; + return F_false; } // Ethiopic Extended-A: U+AB17 to U+AB1F. if (bytes >= 0xac97 && bytes <= 0xac9f) { - return f_false; + return F_false; } // Ethiopic Extended-A: U+AB00, U+AB07, U+AB08, U+AB0F. if (bytes == 0xac80 || bytes == 0xac87 || bytes == 0xac88 || bytes == 0xac8f) { - return f_false; + return F_false; } // Ethiopic Extended-A: U+AB10, U+AB27, U+AB2F. if (bytes == 0xac90 || bytes == 0xaca7 || bytes == 0xacaf) { - return f_false; + return F_false; } // Hangul Jamo Extended-A: U+A97D to U+A97F. if (bytes >= 0xa5bd && bytes <= 0xa5bf) { - return f_false; + return F_false; } // Javanese: U+A9CE, U+A9DA to U+A9DD. if (bytes == 0xa78e || bytes >= 0xa79a && bytes <= 0xa79d) { - return f_false; + return F_false; } // Latin Extended-D: U+A7AF, U+A7B8 to U+A7F6. if (bytes == 0x9eaf || bytes >= 0x9eb8 && bytes <= 0x9fb6) { - return f_false; + return F_false; } // Latin Extended-E: U+AB66 to U+AB6F. if (bytes >= 0xada6 && bytes <= 0xadaf) { - return f_false; + return F_false; } // Meetei Mayek: U+ABFA to U+ABFF. if (bytes >= 0xafba && bytes <= 0xafbf) { - return f_false; + return F_false; } // Meetei Mayek: U+ABEE, U+ABEF. if (bytes == 0xafae || bytes == 0xafaf) { - return f_false; + return F_false; } // Meetei Mayek Extensions: U+AAF7 to U+AAFF. if (bytes >= 0xabb7 && bytes <= 0xabbf) { - return f_false; + return F_false; } // Myanmar Extended-B: U+A9FF. if (bytes == 0xa7bf) { - return f_false; + return F_false; } // Phags-pa: U+A878, U+A87F. if (bytes >= 0xa1b8 && bytes <= 0xa1bf) { - return f_false; + return F_false; } // Rejang: U+A954 to U+A95E. if (bytes >= 0xa594 && bytes <= 0xa59e) { - return f_false; + return F_false; } // Syloti Nagri: U+A82C to U+A82F. if (bytes >= 0xa0ac && bytes <= 0xa0af) { - return f_false; + return F_false; } // Saurashtra: U+A8C6 to U+A8CD. if (bytes >= 0xa386 && bytes <= 0xa38d) { - return f_false; + return F_false; } // Saurashtra: U+A8DA to U+A8DF. if (bytes >= 0xa39a && bytes <= 0xa39f) { - return f_false; + return F_false; } // Tai Viet: U+AAC3 to U+AADA. if (bytes >= 0xab83 && bytes <= 0xab9a) { - return f_false; + return F_false; } // Vai: U+A62C to U+A63F. if (bytes >= 0x98ac && bytes <= 0x98bf) { - return f_false; + return F_false; } // Yi Radicals: U+A4C7 to U+A4CF. if (bytes >= 0x9387 && bytes <= 0x938f) { - return f_false; + return F_false; } // Yi Syllables: U+A48D to U+A48F. if (bytes >= 0x928d && bytes <= 0x928f) { - return f_false; + return F_false; } } else if (byte_first == 0xed) { @@ -1240,152 +1240,152 @@ extern "C" { // Valid UTF-8-3 ranges = %xED %x80-9F UTF8-tail if (byte_second < 0x80 || byte_second > 0x9f) { - return f_false; + return F_false; } } // Hangul Jamo Extended-B: U+D7C7 to U+D7CA. if (bytes >= 0x9f87 && bytes <= 0x9f8a) { - return f_false; + return F_false; } // Hangul Jamo Extended-B: U+D7FC to U+D7FF. if (bytes >= 0x9fbc && bytes <= 0x9fbf) { - return f_false; + return F_false; } // Hangul Syllables: U+D7A4 to U+D7AF. if (bytes >= 0x9ea4 && bytes <= 0x9eaf) { - return f_false; + return F_false; } // Low Surrogates: U+DC00 to U+DFFF. if (bytes >= 0xbfb0 && bytes <= 0xbfbf) { - return f_false; + return F_false; } // High Surrogates: U+D800 to U+DB7F. if (bytes >= 0xa080 && bytes <= 0xadbf) { - return f_false; + return F_false; } // High Private Use Surrogates: U+DB80 to U+DBFF. if (bytes >= 0xae80 && bytes <= 0xafbf) { - return f_false; + return F_false; } } else if (byte_first == 0xee) { // @todo update this range to only 0xee. // consider all private use codes as valid, U+E000 to U+F8FF. if (character >= 0xee808000 && character <= 0xefa3bf00) { - return f_true; + return F_true; } } else if (byte_first == 0xef) { // @todo update this range to only 0xef // consider all private use codes as valid, U+E000 to U+F8FF. if (character >= 0xee808000 && character <= 0xefa3bf00) { - return f_true; + return F_true; } // Alphabetic Presentation Forms: U+FB07 to U+FB12. if (bytes >= 0xac87 && bytes <= 0xac92) { - return f_false; + return F_false; } // Alphabetic Presentation Forms: U+FB18 to U+FB1C. if (bytes >= 0xac98 && bytes <= 0xac9c) { - return f_false; + return F_false; } // Arabic Presentation Forms: U+FB37, U+FB3D, U+FB3F. if (bytes == 0xacb7 || bytes == 0xacbd || bytes == 0xacbf) { - return f_false; + return F_false; } // Arabic Presentation Forms: U+FB42, U+FB45. if (bytes == 0xad82 || bytes == 0xad85) { - return f_false; + return F_false; } // Arabic Presentation Forms-A: U+FBC2 to U+FBD2. if (bytes >= 0xaf82 && bytes <= 0xaf92) { - return f_false; + return F_false; } // Arabic Presentation Forms-A: U+FD40 to U+FD4F. if (bytes >= 0xb580 && bytes <= 0xb58f) { - return f_false; + return F_false; } // Arabic Presentation Forms-A: U+FDC8 to U+FDEF. if (bytes >= 0xb788 && bytes <= 0xb7af) { - return f_false; + return F_false; } // Arabic Presentation Forms-A: U+FD90, U+FD91, U+FDFE, U+FDFF. if (bytes == 0xb690 || bytes == 0xb691 || bytes == 0xb7be || bytes == 0xb7bf) { - return f_false; + return F_false; } // Arabic Presentation Forms-B: U+FE75, U+FEFD, U+FEFE. if (bytes == 0xb9b5 || bytes == 0xbbbd || bytes == 0xbbbe) { - return f_false; + return F_false; } // CJK Compatibility Ideographs: U+FADA to U+FAFF. if (bytes >= 0xab9a && bytes <= 0xabbf) { - return f_false; + return F_false; } // CJK Compatibility Ideographs: U+FA6E, U+FA6F. if (bytes == 0xa9ae || bytes == 0xa9af) { - return f_false; + return F_false; } // Halfwidth and Fullwidth Forms: U+FFDD to U+FFDF. if (bytes >= 0xbf9d && bytes <= 0xbf9f) { - return f_false; + return F_false; } // Halfwidth and Fullwidth Forms: U+FF00, U+FFBF, U+FFC0, U+FFC1. if (bytes == 0xbc80 || bytes == 0xbebf || bytes == 0xbf80 || bytes == 0xbf81) { - return f_false; + return F_false; } // Halfwidth and Fullwidth Forms: U+FFC8, U+FFC9, U+FFD0, U+FFD1. if (bytes == 0xbf88 || bytes == 0xbf89 || bytes == 0xbf90 || bytes == 0xbf91) { - return f_false; + return F_false; } // Halfwidth and Fullwidth Forms: U+FFD8, U+FFD9, U+FFE7, U+FFEF. if (bytes == 0xbf98 || bytes == 0xbf99 || bytes == 0xbfa7 || bytes == 0xbfaf) { - return f_false; + return F_false; } // Small Form Variants: U+FE6C to U+FE6F. if (bytes >= 0xb9ac && bytes <= 0xb9af) { - return f_false; + return F_false; } // Small Form Variants: U+FE53, U+FE67. if (bytes == 0xb993 || bytes == 0xb9a7) { - return f_false; + return F_false; } // Vertical Forms: U+FE10 to U+FE1F. if (bytes >= 0xb890 && bytes <= 0xb89f) { - return f_false; + return F_false; } // Specials: U+FFF0 to U+FFF8. if (bytes >= 0xbfb0 && bytes <= 0xbfb8) { - return f_false; + return F_false; } // Specials: U+FFFE to U+FFFF. if (bytes >= 0xbfbe && bytes <= 0xbfbf) { - return f_false; + return F_false; } } } @@ -1397,1015 +1397,1015 @@ extern "C" { if (byte_second == 0x90) { // Aegean Numbers: U+10103 to U+10106. if (bytes >= 0x8483 && bytes <= 0x8486) { - return f_false; + return F_false; } // Aegean Numbers: U+10134 to U+10136. if (bytes >= 0x84b4 && bytes <= 0x84b6) { - return f_false; + return F_false; } // Ancient Greek Numbers: U+1018F. if (bytes == 0x868f) { - return f_false; + return F_false; } // Ancient Symbols: U+1019C to U+1019F. if (bytes >= 0x869c && bytes <= 0x869f) { - return f_false; + return F_false; } // Ancient Symbols: U+101A1 to U+101CF. if (bytes >= 0x86a1 && bytes <= 0x878f) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE3C to U+1EE41. if (bytes >= 0xb8bc && bytes <= 0xb981) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE43 to U+1EE46. if (bytes >= 0xb983 && bytes <= 0xb986) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE9C to U+1EE9F. if (bytes >= 0xba9c && bytes <= 0xba9f) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EEBC to U+1EEEF. if (bytes >= 0xbabc && bytes <= 0xbbaf) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EEF2 to U+1EEFF. if (bytes >= 0xbbb2 && bytes <= 0xbbbf) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE04, U+1EE20, U+1EE23, U+1EE25. if (bytes == 0xb884 || bytes == 0xb8a0 || bytes == 0xb8a3 || bytes == 0xb8a5) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE26, U+1EE28, U+1EE33, U+1EE38. if (bytes == 0xb8a6 || bytes == 0xb8a8 || bytes == 0xb8b3 || bytes == 0xb8b8) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE3A, U+1EE48, U+1EE4A, U+1EE4C. if (bytes == 0xb8ba || bytes == 0xb988 || bytes == 0xb98a || bytes == 0xb98c) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE50, U+1EE53, U+1EE55, U+1EE56. if (bytes == 0xb990 || bytes == 0xb993 || bytes == 0xb995 || bytes == 0xb996) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE58, U+1EE5A, U+1EE5C, U+1EE5E. if (bytes == 0xb998 || bytes == 0xb99a || bytes == 0xb99c || bytes == 0xb99e) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE60, U+1EE63, U+1EE65, U+1EE66. if (bytes == 0xb9a0 || bytes == 0xb9a3 || bytes == 0xb9a5 || bytes == 0xb9a6) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE6B, U+1EE73, U+1EE78, U+1EE7D. if (bytes == 0xb9ab || bytes == 0xb9b3 || bytes == 0xb9b8 || bytes == 0xb9bd) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EE7F, U+1EE8A, U+1EEA0, U+1EEA4. if (bytes == 0xb9bf || bytes == 0xba8a || bytes == 0xbaa0 || bytes == 0xbaa4) { - return f_false; + return F_false; } // Arabic Mathematical Alphabetic Symbols: U+1EEAA. if (bytes == 0xbaaa) { - return f_false; + return F_false; } // Avestan: U+10B36 to U+10B38. if (bytes >= 0xacb6 && bytes <= 0xacb8) { - return f_false; + return F_false; } // Carian: U+102D1 to U+102DF. if (bytes >= 0x8b91 && bytes <= 0x8b9f) { - return f_false; + return F_false; } // Caucasian Albanian: U+10564 to U+1056E. if (bytes >= 0x95a4 && bytes <= 0x95ae) { - return f_false; + return F_false; } // Coptic Epact Numbers: U+102FC to U+102FF. if (bytes >= 0x8bbc && bytes <= 0x8bbf) { - return f_false; + return F_false; } // Cypriot Syllabary: U+10839 to U+1083B. if (bytes >= 0xa0b9 && bytes <= 0xa0bb) { - return f_false; + return F_false; } // Cypriot Syllabary: U+10806, U+10807, U+10809. if (bytes == 0xa086 || bytes == 0xa087 || bytes == 0xa089) { - return f_false; + return F_false; } // Cypriot Syllabary: U+10836, U+1083D, U+1083E. if (bytes == 0xa0b6 || bytes == 0xa0bd || bytes == 0xa0be) { - return f_false; + return F_false; } // Elbasan: U+10528 to U+1052F. if (bytes >= 0x94a8 && bytes <= 0x94af) { - return f_false; + return F_false; } // Gothic: U+1034B to U+1034F. if (bytes >= 0x8d8b && bytes <= 0x8d8f) { - return f_false; + return F_false; } // Hatran: U+108F3. if (bytes == 0xa3b3) { - return f_false; + return F_false; } // Hatran: U+108F6 to U+108FA. if (bytes >= 0xa3b6 && bytes <= 0xa3ba) { - return f_false; + return F_false; } // Imperial Aramaic: U+10856. if (bytes == 0xa196) { - return f_false; + return F_false; } // Inscriptional Pahlavi: U+10B73 to U+10B77. if (bytes >= 0xadb3 && bytes <= 0xadb7) { - return f_false; + return F_false; } // Inscriptional Parthian: U+10B56 to U+10B57. if (bytes >= 0xad96 && bytes <= 0xad97) { - return f_false; + return F_false; } // Kharoshthi: U+10A07 to U+10A0B. if (bytes >= 0xa887 && bytes <= 0xa88b) { - return f_false; + return F_false; } // Kharoshthi: U+10A34 to U+10A37. if (bytes >= 0xa8b4 && bytes <= 0xa8b7) { - return f_false; + return F_false; } // Kharoshthi: U+10A3B to U+10A3E. if (bytes >= 0xa8bb && bytes <= 0xa8be) { - return f_false; + return F_false; } // Kharoshthi: U+10A48 to U+10A4F. if (bytes >= 0xa988 && bytes <= 0xa98f) { - return f_false; + return F_false; } // Kharoshthi: U+10A59 to U+10A5F. if (bytes >= 0xa999 && bytes <= 0xa99f) { - return f_false; + return F_false; } // Kharoshthi: U+10A04, U+10A14, U+10A18. if (bytes == 0xa884 || bytes == 0xa894 || bytes == 0xa898) { - return f_false; + return F_false; } // Linear A: U+10737 to U+1073F. if (bytes >= 0x9cb7 && bytes <= 0x9cbf) { - return f_false; + return F_false; } // Linear A: U+10756 to U+1075F. if (bytes >= 0x9d96 && bytes <= 0x9d9f) { - return f_false; + return F_false; } // Linear A: U+10768 to U+1077F. if (bytes >= 0x9da8 && bytes <= 0x9dbf) { - return f_false; + return F_false; } // Linear B Ideograms: U+100FB to U+100FF. if (bytes >= 0x83bb && bytes <= 0x83bf) { - return f_false; + return F_false; } // Linear B Syllabary: U+1005E to U+1007F. if (bytes >= 0x819e && bytes <= 0x81bf) { - return f_false; + return F_false; } // Linear B Syllabary: U+1000C, U+10027, U+1003B. if (bytes == 0x808c || bytes == 0x80a7 || bytes == 0x80bb) { - return f_false; + return F_false; } // Linear B Syllabary: U+1003E, U+1004E, U+1004F. if (bytes == 0x80be || bytes == 0x818e || bytes == 0x818f) { - return f_false; + return F_false; } // Lycian: U+1029D to U+1029F. if (bytes >= 0x8a9d && bytes <= 0x8a9f) { - return f_false; + return F_false; } // Lydian: U+1093A to U+1093E. if (bytes >= 0xa4ba && bytes <= 0xa4be) { - return f_false; + return F_false; } // Manichaean: U+10AE7 to U+10AEA. if (bytes >= 0xaba7 && bytes <= 0xabaa) { - return f_false; + return F_false; } // Manichaean: U+10AF7 to U+10AFF. if (bytes >= 0xabb7 && bytes <= 0xabbf) { - return f_false; + return F_false; } // Meroitic Cursive: U+109B8 to U+109BB. if (bytes >= 0xa6b8 && bytes <= 0xa6bb) { - return f_false; + return F_false; } // Meroitic Cursive: U+109D0, U+109D1. if (bytes == 0xa790 || bytes == 0xa791) { - return f_false; + return F_false; } // Nabataean: U+1089F to U+108A6. if (bytes >= 0xa29f && bytes <= 0xa2a6) { - return f_false; + return F_false; } // Old Hungarian: U+10CB3 to U+10CBF. if (bytes >= 0xb2b3 && bytes <= 0xb2bf) { - return f_false; + return F_false; } // Old Hungarian: U+10CF3 to U+10CF9. if (bytes >= 0xb3b3 && bytes <= 0xb3b9) { - return f_false; + return F_false; } // Old Italic: U+10324 to U+1032F. if (bytes >= 0x8ca4 && bytes <= 0x8caf) { - return f_false; + return F_false; } // Old Permic: U+1037B to U+1037F. if (bytes >= 0x8dbb && bytes <= 0x8dbf) { - return f_false; + return F_false; } // Old Persian: U+103C4 to U+103C7. if (bytes >= 0x8f84 && bytes <= 0x8f87) { - return f_false; + return F_false; } // Old Persian: U+103D6 to U+103DF. if (bytes >= 0x8f96 && bytes <= 0x8f9f) { - return f_false; + return F_false; } // Old Turkic: U+10C49 to U+10C4F. if (bytes >= 0xb189 && bytes <= 0xb18f) { - return f_false; + return F_false; } // Osage: U+104D4 to U+104D7. if (bytes >= 0x9394 && bytes <= 0x9397) { - return f_false; + return F_false; } // Osage: U+104FC to U+104FF. if (bytes >= 0x93bc && bytes <= 0x93bf) { - return f_false; + return F_false; } // Osmanya: U+104AA to U+104AF. if (bytes >= 0x92aa && bytes <= 0x92af) { - return f_false; + return F_false; } // Osmanya: U+1049E to U+1049F. if (bytes == 0x929e || bytes == 0x929f) { - return f_false; + return F_false; } // Phaistos Disc: U+101FE, U+101FF. if (bytes == 0x87be || bytes == 0x87bf) { - return f_false; + return F_false; } // Phoenician: U+1091C to U+1091E. if (bytes >= 0xa49c && bytes <= 0xa49e) { - return f_false; + return F_false; } // Psalter Pahlavi: U+10B92 to U+10B98. if (bytes >= 0xae92 && bytes <= 0xae98) { - return f_false; + return F_false; } // Psalter Pahlavi: U+10B9D to U+10BA8. if (bytes >= 0xae9d && bytes <= 0xaea8) { - return f_false; + return F_false; } // Rumi Numeral Symbols: U+10E7F. if (bytes == 0xb9bf) { - return f_false; + return F_false; } // Ugaritic: U+1039E. if (bytes == 0x8e9e) { - return f_false; + return F_false; } } else if (byte_second == 0x91) { // Ahom: U+1172C to U+1172F. if (bytes >= 0x9cac && bytes <= 0x9caf) { - return f_false; + return F_false; } // Ahom: U+1171A to U+1171C. if (bytes >= 0x9c9a && bytes <= 0x9c9c) { - return f_false; + return F_false; } // Bhaiksuki: U+11C46 to U+11C4F. if (bytes >= 0xb186 && bytes <= 0xb18f) { - return f_false; + return F_false; } // Bhaiksuki: U+11C6D to U+11C6F. if (bytes >= 0xb1ad && bytes <= 0xb1af) { - return f_false; + return F_false; } // Bhaiksuki: U+11C09, U+11C37. if (bytes == 0xb089 || bytes == 0xb0b7) { - return f_false; + return F_false; } // Brahmi: U+1104E to U+11051. if (bytes >= 0x818e && bytes <= 0x8191) { - return f_false; + return F_false; } // Brahmi: U+11070 to U+1107E. if (bytes >= 0x81b0 && bytes <= 0x81be) { - return f_false; + return F_false; } // Chakma: U+11135, U+11144 to U+1114F. if (bytes == 0x84b5 || bytes >= 0x8584 && bytes <= 0x858f) { - return f_false; + return F_false; } // Grantha: U+11351 to U+11356. if (bytes >= 0x8d91 && bytes <= 0x8d96) { - return f_false; + return F_false; } // Grantha: U+11358 to U+1135C. if (bytes >= 0x8d98 && bytes <= 0x8d9c) { - return f_false; + return F_false; } // Grantha: U+1136D to U+1136F. if (bytes >= 0x8dad && bytes <= 0x8daf) { - return f_false; + return F_false; } // Grantha: U+11375 to U+1137F. if (bytes >= 0x8db5 && bytes <= 0x8dbf) { - return f_false; + return F_false; } // Grantha: U+11304, U+1130D, U+1130E, U+11311. if (bytes == 0x8c84 || bytes == 0x8c8d || bytes == 0x8c8e || bytes == 0x8c91) { - return f_false; + return F_false; } // Grantha: U+11312, U+11329, U+11331, U+11334. if (bytes == 0x8c92 || bytes == 0x8ca9 || bytes == 0x8cb1 || bytes == 0x8cb4) { - return f_false; + return F_false; } // Grantha: U+1133A, U+1133B, U+11345, U+11346. if (bytes == 0x8cba || bytes == 0x8cbb || bytes == 0x8d85 || bytes == 0x8d86) { - return f_false; + return F_false; } // Grantha: U+11349, U+1134A, U+1134E, U+1134F. if (bytes == 0x8d89 || bytes == 0x8d8a || bytes == 0x8d8e || bytes == 0x8d8f) { - return f_false; + return F_false; } // Grantha: U+11364, U+11365. if (bytes == 0x8da4 || bytes == 0x8da5) { - return f_false; + return F_false; } // Kaithi: U+110C2 to U+110CF. if (bytes >= 0x8382 && bytes <= 0x838f) { - return f_false; + return F_false; } // Khojki: U+1123F to U+1124F. if (bytes >= 0x88bf && bytes <= 0x898f) { - return f_false; + return F_false; } // Khojki: U+11212. if (bytes == 0x8892) { - return f_false; + return F_false; } // Khudawadi: U+112EB to U+112EF. if (bytes >= 0x8bab && bytes <= 0x8baf) { - return f_false; + return F_false; } // Khudawadi: U+112FA to U+112FF. if (bytes >= 0x8bba && bytes <= 0x8bbf) { - return f_false; + return F_false; } // Mahajani: U+11177 to U+1117F. if (bytes >= 0x85b7 && bytes <= 0x85bf) { - return f_false; + return F_false; } // Marchen: U+11CB7 to U+11CBF. if (bytes >= 0xb2b7 && bytes <= 0xb2bf) { - return f_false; + return F_false; } // Marchen: U+11C90, U+11C91, U+11CA8. if (bytes == 0xb290 || bytes == 0xb291 || bytes == 0xb2a8) { - return f_false; + return F_false; } // Modi: U+11645 to U+1164F. if (bytes >= 0x9985 && bytes <= 0x998f) { - return f_false; + return F_false; } // Modi: U+1165A to U+1165F. if (bytes >= 0x999a && bytes <= 0x999f) { - return f_false; + return F_false; } // Mongolian Supplement: U+1166D to U+1167F. if (bytes >= 0x99ad && bytes <= 0x99bf) { - return f_false; + return F_false; } // Multani: U+112AA to U+112AF. if (bytes >= 0x8aaa && bytes <= 0x8aaf) { - return f_false; + return F_false; } // Multani: U+11287, U+11289, U+1128E, U+1129E. if (bytes == 0x8a87 || bytes == 0x8a89 || bytes == 0x8a8e || bytes == 0x8a9e) { - return f_false; + return F_false; } // Newa: U+1145E to U+1147F. if (bytes >= 0x919e && bytes <= 0x91bf) { - return f_false; + return F_false; } // Newa: U+1145A, U+1145C. if (bytes == 0x919a || bytes == 0x919c) { - return f_false; + return F_false; } // Pau Cin Hau: U+11AF9, U+11AFF. if (bytes >= 0xabbf && bytes <= 0xabbf) { - return f_false; + return F_false; } // Sharada: U+111CE, U+111CF. if (bytes == 0x878e || bytes == 0x878f) { - return f_false; + return F_false; } // Siddham: U+115DE to U+115FF. if (bytes >= 0x979e && bytes <= 0x97bf) { - return f_false; + return F_false; } // Siddham: U+115B6, U+115B7. if (bytes == 0x96b6 || bytes == 0x96b7) { - return f_false; + return F_false; } // Sinhala Archaic Numbers: U+111F5 to U+111FF. if (bytes >= 0x87b5 && bytes <= 0x87bf) { - return f_false; + return F_false; } // Sinhala Archaic Numbers: U+1F93F. if (bytes == 0x87a0) { - return f_false; + return F_false; } // Sora Sompeng: U+110E9 to U+110EF. if (bytes >= 0x83a9 && bytes <= 0x83af) { - return f_false; + return F_false; } // Sora Sompeng: U+110FA to U+110FF. if (bytes >= 0x83ba && bytes <= 0x83bf) { - return f_false; + return F_false; } // Takri: U+116B8 to U+116BF. if (bytes >= 0x9ab8 && bytes <= 0x9abf) { - return f_false; + return F_false; } // Takri: U+116CA to U+116CF. if (bytes >= 0x9b8a && bytes <= 0x9b8f) { - return f_false; + return F_false; } // Tirhuta: U+114C8 to U+114CF. if (bytes >= 0x9388 && bytes <= 0x938f) { - return f_false; + return F_false; } // Tirhuta: U+114DA to U+114DF. if (bytes >= 0x939a && bytes <= 0x939f) { - return f_false; + return F_false; } // Warang Citi: U+118F3 to U+118FE. if (bytes >= 0xa3b3 && bytes <= 0xa3be) { - return f_false; + return F_false; } } else if (byte_second == 0x92) { // Cuneiform: U+1239A to U+123FF. if (bytes >= 0x8e9a && bytes <= 0x8fbf) { - return f_false; + return F_false; } // Cuneiform Numbers and Punctuation: U+1246F, U+12475 to U+1247F. if (bytes == 0x91af || bytes >= 0x91b5 && bytes <= 0x91bf) { - return f_false; + return F_false; } // Early Dynastic Cuneiform: U+12544 to U+1254F. if (bytes >= 0x9584 && bytes <= 0x958f) { - return f_false; + return F_false; } } else if (byte_second == 0x93) { // Egyptian Hieroglyphs: U+1342F. if (bytes == 0x90af) { - return f_false; + return F_false; } } else if (byte_second == 0x94) { // Anatolian Hieroglyphs: U+14647 to U+1467F. if (bytes >= 0x9987 && bytes <= 0x99bf) { - return f_false; + return F_false; } } else if (byte_second == 0x96) { // Bamum Supplement: U+16A39 to U+16A3F. if (bytes >= 0xa8b9 && bytes <= 0xa8bf) { - return f_false; + return F_false; } // Bassa Vah: U+16AF6 to U+16AFF. if (bytes >= 0xabb6 && bytes <= 0xabbf) { - return f_false; + return F_false; } // Bassa Vah: U+16AEE, U+16AEF. if (bytes == 0xabae || bytes == 0xabaf) { - return f_false; + return F_false; } // Ideographic Symbols and Punctuation: U+16FE1 to U+16FFF. if (bytes >= 0xbfa1 && bytes <= 0xbfbf) { - return f_false; + return F_false; } // Miao: U+16F45 to U+16F4F. if (bytes >= 0xbd85 && bytes <= 0xbd8f) { - return f_false; + return F_false; } // Miao: U+16F7F to U+16F8E. if (bytes >= 0xbdbf && bytes <= 0xbe8e) { - return f_false; + return F_false; } // Mro: U+16A6A to U+16A6D. if (bytes >= 0xa9aa && bytes <= 0xa9ad) { - return f_false; + return F_false; } // Mro: U+16A5F. if (bytes == 0xa99f) { - return f_false; + return F_false; } // Pahawh Hmong: U+16B46 to U+16B4F. if (bytes >= 0xad86 && bytes <= 0xad8f) { - return f_false; + return F_false; } // Pahawh Hmong: U+16B78 to U+16B7C. if (bytes >= 0xadb8 && bytes <= 0xadbc) { - return f_false; + return F_false; } // Pahawh Hmong: U+16B5A, U+16B62. if (bytes == 0xad9a || bytes == 0xada2) { - return f_false; + return F_false; } } else if (byte_second == 0x9b) { // Duployan: U+1BC6B to U+1BC6F. if (bytes >= 0xb1ab && bytes <= 0xb1af) { - return f_false; + return F_false; } // Duployan: U+1BC7D to U+1BC7F. if (bytes >= 0xb1bd && bytes <= 0xb1bf) { - return f_false; + return F_false; } // Duployan: U+1BC89 to U+1BC8F. if (bytes >= 0xb289 && bytes <= 0xb28f) { - return f_false; + return F_false; } // Duployan: U+1BC9A to U+1BC9B. if (bytes == 0xb29a || bytes == 0xb29b) { - return f_false; + return F_false; } // Kana Supplement: U+1B002 to U+1B0FF. if (bytes >= 0x8082 && bytes <= 0x83bf) { - return f_false; + return F_false; } // Shorthand Format Controls: U+1BCA4 to U+1BCAF. if (bytes >= 0xb2a4 && bytes <= 0xb2af) { - return f_false; + return F_false; } } else if (byte_second == 0x9d) { // Ancient Greek Musical Notation: U+1D246 to U+1D24F. if (bytes >= 0x8986 && bytes <= 0x898f) { - return f_false; + return F_false; } // Byzantine Musical Symbols: U+1D0F6 to U+1D0FF. if (bytes >= 0x83b6 && bytes <= 0x83bf) { - return f_false; + return F_false; } // Counting Rod Numerals: U+1D372 to U+1D37F. if (bytes >= 0x8db2 && bytes <= 0x8dbf) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D547 to U+1D549. if (bytes >= 0x9587 && bytes <= 0x9589) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D455, U+1D49D, U+1D4A0, U+1D4A1. if (bytes == 0x9195 || bytes == 0x929d || bytes == 0x92a0 || bytes == 0x92a1) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D4A3, U+1D4A4, U+1D4A7, U+1D4A8. if (bytes == 0x92a3 || bytes == 0x92a4 || bytes == 0x92a7 || bytes == 0x92a8) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D4AD, U+1D4BA, U+1D4BC, U+1D4C4. if (bytes == 0x92ad || bytes == 0x92ba || bytes == 0x92bc || bytes == 0x9384) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D506, U+1D50B, U+1D50C, U+1D515. if (bytes == 0x9486 || bytes == 0x948b || bytes == 0x948c || bytes == 0x9495) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D51D, U+1D53A, U+1D53F, U+1D545. if (bytes == 0x949d || bytes == 0x94ba || bytes == 0x94bf || bytes == 0x9585) { - return f_false; + return F_false; } // Mathematical Alphanumeric Symbols: U+1D551, U+1D6A6, U+1D7CC, U+1D7CD. if (bytes == 0x9591 || bytes == 0x9aa6 || bytes == 0x9aa7 || bytes == 0x9f8c || bytes == 0x9f8d) { - return f_false; + return F_false; } // Musical Symbols: U+1D1E9 to U+1D1FF. if (bytes >= 0x87a9 && bytes <= 0x87bf) { - return f_false; + return F_false; } // Musical Symbols: U+1D127, U+1D128. if (bytes == 0x84a7 || bytes == 0x84a8) { - return f_false; + return F_false; } // Sutton SignWriting: U+1DA8C to U+1DA9A. if (bytes >= 0xaa8c && bytes <= 0xaa9a) { - return f_false; + return F_false; } // Tai Xuan Jing Symbols: U+1D357 to U+1D35F. if (bytes >= 0x8d97 && bytes <= 0x8d9f) { - return f_false; + return F_false; } } else if (byte_second == 0x9e) { // Adlam: U+1E94B to U+1E94F. if (bytes >= 0xa58b && bytes <= 0xa58f) { - return f_false; + return F_false; } // Adlam: U+1E95A to U+1E95D. if (bytes >= 0xa59a && bytes <= 0xa59d) { - return f_false; + return F_false; } // Glagolitic Supplement: U+1E02B to U+1E02F. if (bytes >= 0x80ab && bytes <= 0x80af) { - return f_false; + return F_false; } // Glagolitic Supplement: U+1E007, U+1E019, U+1E01A. if (bytes == 0x8087 || bytes == 0x8099 || bytes == 0x809a) { - return f_false; + return F_false; } // Glagolitic Supplement: U+1E022, U+1E025. if (bytes == 0x80a2 || bytes == 0x80a5) { - return f_false; + return F_false; } // Mende Kikakui: U+1E8D7 to U+1E8DF. if (bytes >= 0xa397 && bytes <= 0xa39f) { - return f_false; + return F_false; } // Mende Kikakui: U+1E8C5, U+1E8C6. if (bytes == 0xa385 || bytes == 0xa386) { - return f_false; + return F_false; } } else if (byte_second == 0x9f) { // Alchemical Symbols: U+1F774 to U+1F77F. if (bytes >= 0x9db4 && bytes <= 0x9dbf) { - return f_false; + return F_false; } // Domino Tiles: U+1F094 to U+1F09F. if (bytes >= 0x8294 && bytes <= 0x829f) { - return f_false; + return F_false; } // Enclosed Alphanumeric Supplement: U+1F10D to U+1F10F. if (bytes >= 0x848d && bytes <= 0x848f) { - return f_false; + return F_false; } // Enclosed Alphanumeric Supplement: U+1F16C to U+1F16F. if (bytes >= 0x85ac && bytes <= 0x85af) { - return f_false; + return F_false; } // Enclosed Alphanumeric Supplement: U+1F1AD to U+1F1E5. if (bytes >= 0x86ad && bytes <= 0x87a5) { - return f_false; + return F_false; } // Enclosed Alphanumeric Supplement: U+1F12F. if (bytes == 0x84af) { - return f_false; + return F_false; } // Enclosed Ideographic Supplement: U+1F203 to U+1F20F. if (bytes >= 0x8883 && bytes <= 0x888f) { - return f_false; + return F_false; } // Enclosed Ideographic Supplement: U+1F23C to U+1F23F. if (bytes >= 0x88bc && bytes <= 0x88bf) { - return f_false; + return F_false; } // Enclosed Ideographic Supplement: U+1F249 to U+1F24F. if (bytes >= 0x8989 && bytes <= 0x898f) { - return f_false; + return F_false; } // Enclosed Ideographic Supplement: U+1F252 to U+1F2FF. if (bytes >= 0x8992 && bytes <= 0x8bbf) { - return f_false; + return F_false; } // Geometric Shapes Extended: U+1F7D5 to U+1F7FF. if (bytes >= 0x9f95 && bytes <= 0x9fbf) { - return f_false; + return F_false; } // Mahjong Tiles: U+1F02C to U+1F02F. if (bytes >= 0x80ac && bytes <= 0x80af) { - return f_false; + return F_false; } // Playing Cards: U+1F0AF, U+1F0C0, U+1F0D0. if (bytes == 0x82af || bytes == 0x8380 || bytes == 0x8390) { - return f_false; + return F_false; } // Playing Cards: U+1F0F6 to U+1F0FF. if (bytes >= 0x83b6 && bytes <= 0x83bf) { - return f_false; + return F_false; } // Supplemental Arrows-C: U+1F80C to U+1F80F. if (bytes >= 0xa08c && bytes <= 0xa08f) { - return f_false; + return F_false; } // Supplemental Arrows-C: U+1F848 to U+1F84F. if (bytes >= 0xa188 && bytes <= 0xa18f) { - return f_false; + return F_false; } // Supplemental Arrows-C: U+1F85A to U+1F85F. if (bytes >= 0xa19a && bytes <= 0xa19f) { - return f_false; + return F_false; } // Supplemental Arrows-C: U+1F8AE to U+1F8FF. if (bytes >= 0xa2ae && bytes <= 0xa3bf) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F900 to U+1F90F. if (bytes >= 0xa480 && bytes <= 0xa48f) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F928 to U+1F92F. if (bytes >= 0xa4a8 && bytes <= 0xa4af) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F94C to U+1F94F. if (bytes >= 0xa58c && bytes <= 0xa58f) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F960 to U+1F97F. if (bytes >= 0xa5a0 && bytes <= 0xa5bf) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F992 to U+1F9BF. if (bytes >= 0xa692 && bytes <= 0xa6bf) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F9C1 to U+1F9FF. if (bytes >= 0xa781 && bytes <= 0xa7bf) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F91F, U+1F931, U+1F932. if (bytes == 0xa49f || bytes == 0xa4b1 || bytes == 0xa4b2) { - return f_false; + return F_false; } // Supplemental Symbols and Pictographs: U+1F93F, U+1F95F. if (bytes == 0xa4bf || bytes == 0xa59f) { - return f_false; + return F_false; } // Transport and Map Symbols: U+1F6D3 to U+1F6DF. if (bytes >= 0x9b93 && bytes <= 0x9b9f) { - return f_false; + return F_false; } // Transport and Map Symbols: U+1F6ED to U+1F6EF. if (bytes >= 0x9bad && bytes <= 0x9baf) { - return f_false; + return F_false; } // Transport and Map Symbols: U+1F6F7 to U+1F6FF. if (bytes >= 0x9bb7 && bytes <= 0x9bbf) { - return f_false; + return F_false; } } else if (byte_second == 0x98) { // Tangut: U+187ED to U+187FF. if (bytes >= 0x9fad && bytes <= 0x9fbf) { - return f_false; + return F_false; } // Tangut Components: U+18AF3 to U+18AFF. if (bytes >= 0xabb3 && bytes <= 0xabbf) { - return f_false; + return F_false; } } else if (byte_second == 0xaa) { // CJK Unified Ideographs Extension B: U+2A6D7 to U+2A6DF. if (bytes >= 0x9b97 && bytes <= 0x9b9f) { - return f_false; + return F_false; } } else if (byte_second == 0xab) { // CJK Unified Ideographs Extension C: U+2B735 to U+2B73F. if (bytes >= 0x9cb5 && bytes <= 0x9cbf) { - return f_false; + return F_false; } // CJK Unified Ideographs Extension D: U+2B81E to U+2B81F. if (bytes >= 0xa09e && bytes <= 0xa09f) { - return f_false; + return F_false; } } else if (byte_second == 0xac) { // CJK Unified Ideographs Extension E: U+2CF92 to U+2CF9F. if (bytes >= 0xbe92 && bytes <= 0xbe9f) { - return f_false; + return F_false; } } else if (byte_second == 0xaf) { // CJK Compatibility Ideographs Supplement: U+2FA1E to U+2FA1F. if (bytes >= 0xa89e && bytes <= 0xa89f) { - return f_false; + return F_false; } } } else if (byte_first == 0xf3) { // Consider all private use codes as valid, U+F0000 to U+FFFFF. if (bytes >= 0x8080 && bytes <= 0xbfbf) { - return f_true; + return F_true; } // Tags: U+E0000, U+E0002 to U+E001F. if (bytes == 0x8080 || bytes >= 0x8082 && bytes <= 0x81bf) { - return f_false; + return F_false; } } else if (byte_first == 0xf4) { // Consider all private use codes as valid, U+100000 to U+10FFFF. if (bytes >= 0x8080 && bytes <= 0xbfbf) { - return f_true; + return F_true; } } else { // Unicode (and therefore UTF-8) does not support representing any character greater than this (U+10FFFF). if (character > 0xf48fbfbf) { - return f_false; + return F_false; } } } - return f_true; + return F_true; } #endif // !defined(_di_f_utf_character_is_valid_) || !defined(_di_f_utf_is_valid_) @@ -2417,38 +2417,38 @@ extern "C" { if (byte_first == 0xc2) { // Latin-1 Supplement: U+00A0, U+0085. if (character == 0xc2a00000 || 0xc2850000) { - return f_true; + return F_true; } } else if (byte_first == 0xe2) { // General Punctuation: U+2000, U+2001, U+2002, U+2003. if (character == 0xe2808000 || character == 0xe2808100 || character == 0xe2808200 || character == 0xe2808300) { - return f_true; + return F_true; } // General Punctuation: U+2004, U+2005, U+2006, U+2007. if (character == 0xe2808400 || character == 0xe2808500 || character == 0xe2808600 || character == 0xe2808700) { - return f_true; + return F_true; } // General Punctuation: U+2008, U+2009, U+200A, U+2028. if (character == 0xe2808800 || character == 0xe2808900 || character == 0xe2808a00 || character == 0xe280a800) { - return f_true; + return F_true; } // General Punctuation: U+2029, U+202F, U+205F. if (character == 0xe280a900 || character == 0xe2819f00 || character == 0xe280af00) { - return f_true; + return F_true; } } else if (byte_first == 0xe3) { // CJK Symbols and Punctuation: U+3000. if (character == 0xe3808000) { - return f_true; + return F_true; } } - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_whitespace_) || !defined(_di_f_utf_is_whitespace_) @@ -2457,7 +2457,7 @@ extern "C" { // @todo: handle all Unicode "word". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_word_) || !defined(_di_f_utf_is_word_) @@ -2466,7 +2466,7 @@ extern "C" { // @todo: handle all Unicode "word_dash". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_word_dash_) || !defined(_di_f_utf_is_word_dash_) @@ -2475,7 +2475,7 @@ extern "C" { // @todo: handle all Unicode "word_dash_plus". - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_word_dash_plus_) || !defined(_di_f_utf_is_word_dash_plus_) @@ -2487,23 +2487,23 @@ extern "C" { if (byte_first == 0xe1) { // Mongolian: U+180E. if (character == 0xe1a08e00) { - return f_true; + return F_true; } } else if (byte_first == 0xe2) { // General Punctuation: U+200B, U+200C, U+200D, U+2060. if (character == 0xe2808b00 || character == 0xe2808c00 || character == 0xe2808d00 || character == 0xe281a000) { - return f_true; + return F_true; } } else if (byte_first == 0xef) { // Arabic Presentation Forms-B: U+FEFF. if (character == 0xefbbbf00) { - return f_true; + return F_true; } } - return f_false; + return F_false; } #endif // !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_) diff --git a/level_0/f_utf/c/private-utf.h b/level_0/f_utf/c/private-utf.h index 8a2afb4..de4f7a8 100644 --- a/level_0/f_utf/c/private-utf.h +++ b/level_0/f_utf/c/private-utf.h @@ -28,9 +28,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_alpha() @@ -51,9 +51,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_control() @@ -74,9 +74,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_control() @@ -95,9 +95,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 control picture character. - * f_false if not a UTF-8 control picture character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control picture character. + * F_false if not a UTF-8 control picture character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_control_picture() * @see f_utf_is_control_picture() @@ -117,9 +117,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_numeric() @@ -140,9 +140,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_valid() * @see f_utf_is_valid() @@ -160,9 +160,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 whitespace. - * f_false if not a UTF-8 whitespace. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 whitespace. + * F_false if not a UTF-8 whitespace. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_whitespace() * @see f_utf_is_whitespace() @@ -182,9 +182,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_word() @@ -205,9 +205,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_word_dash() @@ -228,9 +228,9 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_character_is_word_dash() @@ -249,9 +249,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 non-printing or zero-width character. - * f_false if not a UTF-8 non-printing or zero-width character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 non-printing or zero-width character. + * F_false if not a UTF-8 non-printing or zero-width character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_zero_width() * @see f_utf_is_zero_width() diff --git a/level_0/f_utf/c/utf.c b/level_0/f_utf/c/utf.c index 3e82b6c..8b63011 100644 --- a/level_0/f_utf/c/utf.c +++ b/level_0/f_utf/c/utf.c @@ -10,14 +10,14 @@ extern "C" { unsigned short width = f_macro_utf_character_width_is(character); if (width == 0) { - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } - return f_true; + return F_true; } #endif // _di_f_utf_character_is_ @@ -27,14 +27,14 @@ extern "C" { if (width == 0) { if (isalpha(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_alpha(character, width); @@ -47,14 +47,14 @@ extern "C" { if (width == 0) { if (isalnum(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_alpha_numeric(character, width); @@ -67,14 +67,14 @@ extern "C" { if (width == 0) { if (iscntrl(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_control(character, width); @@ -87,15 +87,15 @@ extern "C" { if (width == 0) { // There are no control picture characters in ASCII. - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } if (width != 3) { - return f_false; + return F_false; } return private_f_utf_character_is_control_picture(character); @@ -106,9 +106,9 @@ extern "C" { f_return_status f_utf_character_is_fragment(const f_utf_character character) { unsigned short width = f_macro_utf_character_width_is(character); - if (width == 1) return f_true; + if (width == 1) return F_true; - return f_false; + return F_false; } #endif // _di_f_utf_character_is_fragment_ @@ -118,30 +118,30 @@ extern "C" { if (width == 0) { if (isgraph(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } - if (private_f_utf_character_is_control(character, width) == f_true) { - return f_false; + if (private_f_utf_character_is_control(character, width) == F_true) { + return F_false; } - if (private_f_utf_character_is_whitespace(character) == f_true) { - return f_false; + if (private_f_utf_character_is_whitespace(character) == F_true) { + return F_false; } // This test is in isolation so zero-width characters must be treated as a non-graph. - if (private_f_utf_character_is_zero_width(character) == f_true) { - return f_false; + if (private_f_utf_character_is_zero_width(character) == F_true) { + return F_false; } - return f_true; + return F_true; } #endif // _di_f_utf_character_is_graph_ @@ -151,14 +151,14 @@ extern "C" { if (width == 0) { if (isdigit(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_numeric(character, width); @@ -170,7 +170,7 @@ extern "C" { unsigned short width = f_macro_utf_character_width_is(character); if (width == 0 || width == 1) { - return f_false; + return F_false; } return private_f_utf_character_is_valid(character, width); @@ -183,14 +183,14 @@ extern "C" { if (width == 0) { if (isspace(f_macro_utf_character_to_char_1(character))) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_whitespace(character); @@ -203,14 +203,14 @@ extern "C" { if (width == 0) { if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_word(character, width); @@ -223,14 +223,14 @@ extern "C" { if (width == 0) { if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_' || character == '-') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_word_dash(character, width); @@ -243,14 +243,14 @@ extern "C" { if (width == 0) { if (isalnum(f_macro_utf_character_to_char_1(character)) || character == '_' || character == '-' || character == '+') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_word_dash_plus(character, width); @@ -260,7 +260,7 @@ extern "C" { #ifndef _di_f_utf_character_is_zero_width_ f_return_status f_utf_character_is_zero_width(const f_utf_character character) { if (f_macro_utf_character_width_is(character) == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } return private_f_utf_character_is_zero_width(character); @@ -270,29 +270,29 @@ extern "C" { #ifndef _di_f_utf_character_to_char_ f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max) { #ifndef _di_level_0_parameter_checking_ - if (utf_character == 0) return f_status_set_error(f_invalid_parameter); - if (width_max == 0 && *character != 0) return f_status_set_error(f_invalid_parameter); - if (width_max != 0 && *character == 0) return f_status_set_error(f_invalid_parameter); - if (width_max != 0 && *width_max > 4) return f_status_set_error(f_invalid_parameter); + if (utf_character == 0) return F_status_set_error(F_parameter); + if (width_max == 0 && *character != 0) return F_status_set_error(F_parameter); + if (width_max != 0 && *character == 0) return F_status_set_error(F_parameter); + if (width_max != 0 && *width_max > 4) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; unsigned short width = f_macro_utf_character_width_is(utf_character); if (width_max == 0) { f_macro_string_new(status, *character, width); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; width = 1; *width_max = 1; } else if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } else if (width > *width_max) { - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } *width_max = width; @@ -319,7 +319,7 @@ extern "C" { memcpy(*character, &utf, width); } - return f_none; + return F_none; } #endif // _di_f_utf_character_to_char_ @@ -329,51 +329,51 @@ extern "C" { int8_t test_char[2] = {0x01, 0x02}; if (!memcmp(&test_int, test_char, 2)) { - return f_true; + return F_true; } - return f_false; + return F_false; } #endif // _di_f_utf_is_big_endian_ #ifndef _di_f_utf_is_ f_return_status f_utf_is(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } - return f_true; + return F_true; } #endif // _di_f_utf_is_ #ifndef _di_f_utf_is_alpha_ f_return_status f_utf_is_alpha(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isalpha(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -383,7 +383,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_alpha(character_utf, width); @@ -393,21 +393,21 @@ extern "C" { #ifndef _di_f_utf_is_alpha_numeric_ f_return_status f_utf_is_alpha_numeric(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isalnum(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -417,7 +417,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_alpha_numeric(character_utf, width); @@ -427,21 +427,21 @@ extern "C" { #ifndef _di_f_utf_is_control_ f_return_status f_utf_is_control(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (iscntrl(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -451,7 +451,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_control(character_utf, width); @@ -461,18 +461,18 @@ extern "C" { #ifndef _di_f_utf_is_control_picture_ f_return_status f_utf_is_control_picture(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); // There are not ASCII control pictures. if (width == 0) { - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -482,7 +482,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_control_picture(character_utf); @@ -492,21 +492,21 @@ extern "C" { #ifndef _di_f_utf_is_graph_ f_return_status f_utf_is_graph(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isgraph(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -516,44 +516,44 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } - if (private_f_utf_character_is_control(character_utf, width) == f_true) { - return f_false; + if (private_f_utf_character_is_control(character_utf, width) == F_true) { + return F_false; } - if (private_f_utf_character_is_whitespace(character_utf) == f_true) { - return f_false; + if (private_f_utf_character_is_whitespace(character_utf) == F_true) { + return F_false; } // This test is in isolation so zero-width characters must be treated as a non-graph. - if (private_f_utf_character_is_zero_width(character_utf) == f_true) { - return f_false; + if (private_f_utf_character_is_zero_width(character_utf) == F_true) { + return F_false; } - return f_true; + return F_true; } #endif // _di_f_utf_is_graph_ #ifndef _di_f_utf_is_numeric_ f_return_status f_utf_is_numeric(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isdigit(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -563,7 +563,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_numeric(character_utf, width); @@ -573,13 +573,13 @@ extern "C" { #ifndef _di_f_utf_is_valid_ f_return_status f_utf_is_valid(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0 || width == 1) { - return f_false; + return F_false; } f_utf_character character_utf = 0; @@ -589,7 +589,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_valid(character_utf, width); @@ -599,21 +599,21 @@ extern "C" { #ifndef _di_f_utf_is_whitespace_ f_return_status f_utf_is_whitespace(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isspace(*character)) { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -623,7 +623,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return f_utf_character_is_whitespace(character_utf); @@ -633,21 +633,21 @@ extern "C" { #ifndef _di_f_utf_is_word_ f_return_status f_utf_is_word(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isalnum(*character) || *character == '_') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -657,7 +657,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_word(character_utf, width); @@ -667,21 +667,21 @@ extern "C" { #ifndef _di_f_utf_is_word_dash_ f_return_status f_utf_is_word_dash(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isalnum(*character) || *character == '_' || *character == '-') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -691,7 +691,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_word_dash(character_utf, width); @@ -701,21 +701,21 @@ extern "C" { #ifndef _di_f_utf_is_word_dash_plus_ f_return_status f_utf_is_word_dash_plus(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { if (isalnum(*character) || *character == '_' || *character == '-' || *character == '+') { - return f_true; + return F_true; } - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -725,7 +725,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_word_dash_plus(character_utf, width); @@ -735,18 +735,18 @@ extern "C" { #ifndef _di_f_utf_is_zero_width_ f_return_status f_utf_is_zero_width(const f_string character, const f_string_length width_max) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { // There are no zero-width spaces in ASCII. - return f_false; + return F_false; } if (width == 1) { - return f_status_is_error(f_incomplete_utf); + return F_status_is_error(F_incomplete_utf); } f_utf_character character_utf = 0; @@ -756,7 +756,7 @@ extern "C" { status = f_utf_char_to_character(character, width_max, &character_utf); - if (status != f_none) return status; + if (status != F_none) return status; } return private_f_utf_character_is_zero_width(character_utf); @@ -766,45 +766,45 @@ extern "C" { #ifndef _di_f_utf_char_to_character_ f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf) { #ifndef _di_level_0_parameter_checking_ - if (width_max < 1) return f_status_set_error(f_invalid_parameter); - if (character_utf == 0) return f_status_set_error(f_invalid_parameter); + if (width_max < 1) return F_status_set_error(F_parameter); + if (character_utf == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { *character_utf = f_macro_utf_character_from_char_1(character[0]); - return f_none; + return F_none; } else if (width == 1) { - return f_status_is_error(f_invalid_utf); + return F_status_is_error(F_utf); } if (width > width_max) { - return f_status_set_error(f_failure); + return F_status_set_error(F_failure); } *character_utf = f_macro_utf_character_from_char_1(character[0]); if (width < 2) { - return f_none; + return F_none; } *character_utf |= f_macro_utf_character_from_char_2(character[1]); if (width == 2) { - return f_none; + return F_none; } *character_utf |= f_macro_utf_character_from_char_3(character[2]); if (width == 3) { - return f_none; + return F_none; } *character_utf |= f_macro_utf_character_from_char_4(character[3]); - return f_none; + return F_none; } #endif // _di_f_utf_char_to_character_ diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 000ddf2..390b867 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -351,35 +351,35 @@ extern "C" { #define f_macro_utf_string_dynamic_new(status, dynamic, new_length) \ f_clear_utf_string_dynamic(dynamic) \ status = f_memory_new((void **) & dynamic.string, sizeof(f_utf_string), new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_delete(status, dynamic) \ status = f_memory_delete((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_destroy(status, dynamic) \ status = f_memory_destroy((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = 0; \ dynamic.used = 0; \ } #define f_macro_utf_string_dynamic_resize(status, dynamic, new_length) \ status = f_memory_resize((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } #define f_macro_utf_string_dynamic_adjust(status, dynamic, new_length) \ status = f_memory_adjust((void **) & dynamic.string, sizeof(f_utf_string), dynamic.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamic.size = new_length; \ if (dynamic.used > dynamic.size) dynamic.used = new_length; \ } @@ -411,42 +411,42 @@ extern "C" { dynamics.size = 0; \ dynamics.used = 0; \ status = f_memory_new((void **) & dynamics.array, sizeof(f_utf_string_dynamic), length); \ - if (status == f_none) { \ + if (status == F_none) { \ dynamics.size = length; \ dynamics.used = 0; \ } #define f_macro_utf_string_dynamics_delete(status, dynamics) \ - status = f_none; \ + status = F_none; \ while (dynamics.size > 0) { \ --dynamics.size; \ f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ - if (status == f_none) dynamics.used = 0; + if (status == F_none) status = f_memory_delete((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ + if (status == F_none) dynamics.used = 0; #define f_macro_utf_string_dynamics_destroy(status, dynamics) \ - status = f_none; \ + status = F_none; \ while (dynamics.size > 0) { \ --dynamics.size; \ f_macro_utf_string_dynamic_destroy(status, dynamics.array[dynamics.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ - if (status == f_none) dynamics.used = 0; + if (status == F_none) status = f_memory_destroy((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size); \ + if (status == F_none) dynamics.used = 0; #define f_macro_utf_string_dynamics_resize(status, dynamics, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < dynamics.size) { \ f_utf_string_length i = dynamics.size - new_length; \ for (; i < dynamics.size; i++) { \ f_macro_utf_string_dynamic_destroy(status, dynamics.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) { \ if (new_length > dynamics.size) { \ f_utf_string_length i = dynamics.size; \ for (; i < new_length; i++) { \ @@ -458,16 +458,16 @@ extern "C" { } #define f_macro_utf_string_dynamics_adjust(status, dynamics, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < dynamics.size) { \ f_utf_string_length i = dynamics.size - new_length; \ for (; i < dynamics.size; i++) { \ f_macro_utf_string_dynamic_destroy(status, dynamics.array[i], f_utf_string_dynamic); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & dynamics.array, sizeof(f_utf_string_dynamic), dynamics.size, new_length); \ + if (status == F_none) { \ if (new_length > dynamics.size) { \ f_utf_string_length i = dynamics.size; \ for (; i < new_length; i++) { \ @@ -578,9 +578,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is_valid() * @see f_utf_is() @@ -598,9 +598,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 alphabet character. - * f_false if not a UTF-8 alphabet character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 alphabet character. + * F_false if not a UTF-8 alphabet character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_alpha() @@ -618,9 +618,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 alpha-numeric character. - * f_false if not a UTF-8 alpha-numeric character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 alpha-numeric character. + * F_false if not a UTF-8 alpha-numeric character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_alphanumeric() @@ -636,9 +636,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_control() @@ -656,9 +656,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 control picture character. - * f_false if not a UTF-8 control picture character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 control picture character. + * F_false if not a UTF-8 control picture character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_control_picture() */ @@ -678,9 +678,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is() * @see f_utf_character_is_valid() @@ -697,9 +697,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 graph. - * f_false if not a UTF-8 graph. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 graph. + * F_false if not a UTF-8 graph. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see isgraph() * @see f_utf_is_graph() @@ -717,9 +717,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 numeric character. - * f_false if not a UTF-8 numeric character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 numeric character. + * F_false if not a UTF-8 numeric character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_numeric() @@ -742,9 +742,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_character_is() * @see f_utf_character_is_fragment() @@ -764,9 +764,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 whitespace. - * f_false if not a UTF-8 whitespace. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 whitespace. + * F_false if not a UTF-8 whitespace. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_whitespace() */ @@ -785,9 +785,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 word character. - * f_false if not a UTF-8 word character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 word character. + * F_false if not a UTF-8 word character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_word() @@ -807,9 +807,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 word or dash character. - * f_false if not a UTF-8 word or dash character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 word or dash character. + * F_false if not a UTF-8 word or dash character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_word_dash() @@ -829,9 +829,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 word or dash character. - * f_false if not a UTF-8 word or dash character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 word or dash character. + * F_false if not a UTF-8 word or dash character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_word_dash() @@ -849,9 +849,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 non-printing or zero-width character. - * f_false if not a UTF-8 non-printing or zero-width character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 non-printing or zero-width character. + * F_false if not a UTF-8 non-printing or zero-width character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see f_utf_is_zero_width() */ @@ -870,9 +870,9 @@ extern "C" { * The character to validate. * * @return - * f_true if a UTF-8 alpha character. - * f_false if not a UTF-8 alpha character. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. + * F_true if a UTF-8 alpha character. + * F_false if not a UTF-8 alpha character. + * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() * @see f_utf_is_word() @@ -898,12 +898,12 @@ extern "C" { * If this is greater than 0, and the utf_character width is larger than this size, then an error is returned. * * @return - * f_none if conversion was successful. - * 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_error_allocation (with error bit) on memory allocation error. - * f_failure (with error bit) if width is not long enough to convert. + * F_none if conversion was successful. + * F_failure (with error bit) if width is not long enough to convert. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_failure (with error bit) if width is not long enough to convert. */ #ifndef _di_f_utf_character_to_char_ extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, f_string_length *width_max); @@ -915,8 +915,8 @@ extern "C" { * @todo relocate this outside of f_utf into a more general path, perhaps f_memory (f_memory_is_big_endian). * * @return - * f_true if the system is big-endian. - * f_false if the system is little-endian. + * F_true if the system is big-endian. + * F_false if the system is little-endian. */ #ifndef _di_f_utf_is_big_endian_ extern f_return_status f_utf_is_big_endian(); @@ -935,10 +935,10 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_utf_is_valid() * @see f_utf_character_is() @@ -960,9 +960,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 alphabet character. - * f_false if not a UTF-8 alphabet character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 alphabet character. + * F_false if not a UTF-8 alphabet character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_alpha() @@ -984,9 +984,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 alpha-numeric character. - * f_false if not a UTF-8 alpha-numeric character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 alpha-numeric character. + * F_false if not a UTF-8 alpha-numeric character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_alpha_numeric() @@ -1006,9 +1006,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 control character. - * f_false if not a UTF-8 control character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 control character. + * F_false if not a UTF-8 control character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_control() @@ -1030,9 +1030,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 control picture character. - * f_false if not a UTF-8 control picture character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 control picture character. + * F_false if not a UTF-8 control picture character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see f_utf_character_is_control_picture() */ @@ -1067,8 +1067,8 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 character. - * f_false if not a UTF-8 character. + * F_true if a UTF-8 character. + * F_false if not a UTF-8 character. * * @see f_utf_character_is() * @see f_utf_character_is_valid() @@ -1089,11 +1089,11 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 graph. - * f_false if not a UTF-8 graph. - * f_maybe (with error bit) if this could be a graph but width is not long enough. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if a UTF-8 graph. + * F_false if not a UTF-8 graph. + * F_maybe (with error bit) if this could be a graph but width is not long enough. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_parameter (with error bit) if a parameter is invalid. * * @see isgraph() * @see iscntrl() @@ -1116,9 +1116,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 numeric character. - * f_false if not a UTF-8 numeric character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 numeric character. + * F_false if not a UTF-8 numeric character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_numeric() @@ -1144,10 +1144,10 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a valid UTF-8 character. - * f_false if not a valid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if a valid UTF-8 character. + * F_false if not a valid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_parameter (with error bit) if a parameter is invalid. * * @see f_utf_is() * @see f_utf_is_fragment() @@ -1168,11 +1168,11 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 whitespace. - * f_false if not a UTF-8 whitespace. - * f_maybe (with error bit) if this could be a whitespace but width is not long enough. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if a UTF-8 whitespace. + * F_false if not a UTF-8 whitespace. + * F_maybe (with error bit) if this could be a whitespace but width is not long enough. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_parameter (with error bit) if a parameter is invalid. * * @see isspace() * @see iscntrl() @@ -1197,9 +1197,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 word character. - * f_false if not a UTF-8 word character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 word character. + * F_false if not a UTF-8 word character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_word() @@ -1223,9 +1223,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 word or dash character. - * f_false if not a UTF-8 word or dash character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 word or dash character. + * F_false if not a UTF-8 word or dash character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_word_dash() @@ -1249,9 +1249,9 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 word or dash character. - * f_false if not a UTF-8 word or dash character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_true if a UTF-8 word or dash character. + * F_false if not a UTF-8 word or dash character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. * * @see iscntrl() * @see f_utf_character_is_word_dash_plus() @@ -1273,11 +1273,11 @@ extern "C" { * Can be anything greater than 0. * * @return - * f_true if a UTF-8 whitespace. - * f_false if not a UTF-8 whitespace. - * f_maybe (with error bit) if this could be a whitespace but width is not long enough. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if a UTF-8 whitespace. + * F_false if not a UTF-8 whitespace. + * F_maybe (with error bit) if this could be a whitespace but width is not long enough. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_parameter (with error bit) if a parameter is invalid. * * @see isspace() * @see iscntrl() @@ -1301,10 +1301,10 @@ extern "C" { * This value may be cleared, even on error. * * @return - * f_none if conversion was successful. - * 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_none if conversion was successful. + * F_failure (with error bit) if width is not long enough to convert. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_utf_char_to_character_ extern f_return_status f_utf_char_to_character(const f_string character, const f_string_length width_max, f_utf_character *character_utf); diff --git a/level_1/fl_color/c/color.c b/level_1/fl_color/c/color.c index 51930e5..82dc943 100644 --- a/level_1/fl_color/c/color.c +++ b/level_1/fl_color/c/color.c @@ -7,13 +7,13 @@ extern "C" { #ifndef _di_fl_color_set_ f_return_status fl_color_set(FILE *file, 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) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (color1 == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); + if (color1 == 0) return F_status_set_error(F_parameter); // make sure all data is in the proper order - if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_status_set_error(f_invalid_parameter); - if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_status_set_error(f_invalid_parameter); - if (color4 == 0 && color5 != 0) return f_status_set_error(f_invalid_parameter); + if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return F_status_set_error(F_parameter); + if (color3 == 0 && (color4 != 0 || color5 != 0)) return F_status_set_error(F_parameter); + if (color4 == 0 && color5 != 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (color2 == 0) fprintf(file, "%s%s%s", format.begin, color1, format.end); @@ -22,20 +22,20 @@ extern "C" { else if (color5 == 0) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end); else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end); - return f_none; + return F_none; } #endif // _di_fl_color_set_ #ifndef _di_fl_color_save_ 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) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (color1 == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (color1 == 0) return F_status_set_error(F_parameter); // make sure all data is in the proper order - if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_status_set_error(f_invalid_parameter); - if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_status_set_error(f_invalid_parameter); - if (color4 == 0 && color5 != 0) return f_status_set_error(f_invalid_parameter); + if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return F_status_set_error(F_parameter); + if (color3 == 0 && (color4 != 0 || color5 != 0)) return F_status_set_error(F_parameter); + if (color4 == 0 && color5 != 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ f_string_length string_size = strnlen(format.begin, f_color_max_size) + strnlen(format.end, f_color_max_size) + 1; @@ -48,11 +48,11 @@ extern "C" { // make sure there is enough allocated space, if not, then allocate some more if (buffer->size - buffer->used - 1 < string_size) { - f_status status = f_none; + f_status status = F_none; f_macro_string_dynamic_resize(status, (*buffer), buffer->used + string_size + 1); // the additional 1 is the EOS - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -109,21 +109,21 @@ extern "C" { // do not forget the EOS buffer->string[buffer->used] = 0; - return f_none; + return F_none; } #endif // _di_fl_color_save_ #ifndef _di_fl_color_print_ f_return_status fl_color_print(FILE *file, const f_string_static start_color, const f_string_static end_color, const int8_t *string, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { f_status status = f_print_string_dynamic(file, start_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } va_list ap; @@ -137,28 +137,28 @@ extern "C" { if (end_color.used != 0) { f_status status = f_print_string_dynamic(file, end_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } - return f_none; + return F_none; } #endif // _di_fl_color_print_ #ifndef _di_fl_color_print2_ f_return_status fl_color_print2(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { f_status status = f_print_string_dynamic(file, start_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = f_print_string_dynamic(file, extra_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } va_list ap; @@ -172,24 +172,24 @@ extern "C" { if (end_color.used != 0) { f_status status = f_print_string_dynamic(file, end_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } - return f_none; + return F_none; } #endif // _di_fl_color_print2_ #ifndef _di_fl_color_print_line_ f_return_status fl_color_print_line(FILE *file, const f_string_static start_color, const f_string_static end_color, const int8_t *string, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { f_status status = f_print_string_dynamic(file, start_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } va_list ap; @@ -203,31 +203,31 @@ extern "C" { if (end_color.used != 0) { f_status status = f_print_string_dynamic(file, end_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // now print the trailing newline, this is done _after_ ending the colors to avoid color wrapping issues that can happen when a color code follows a newline fprintf(file, "%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fl_color_print_line_ #ifndef _di_fl_color_print2_line_ f_return_status fl_color_print2_line(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (file == 0) return F_status_set_error(F_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ if (start_color.used != 0) { f_status status = f_print_string_dynamic(file, start_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = f_print_string_dynamic(file, extra_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } va_list ap; @@ -241,13 +241,13 @@ extern "C" { if (end_color.used != 0) { f_status status = f_print_string_dynamic(file, end_color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // now print the trailing newline, this is done _after_ ending the colors to avoid color wrapping issues that can happen when a color code follows a newline fprintf(file, "%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fl_color_print2_line_ @@ -256,20 +256,20 @@ extern "C" { if (color.used != 0) { f_status status = f_print_string_dynamic(file, color); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } - return f_none; + return F_none; } #endif // _di_fl_color_print_code_ #ifndef _di_fl_color_load_context_ f_return_status fl_color_load_context(fl_color_context *context, const bool use_light_colors) { #ifndef _di_level_1_parameter_checking_ - if (context == 0) return f_status_set_error(f_invalid_parameter); + if (context == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // switch to the appropriate terminal color mode { @@ -287,24 +287,24 @@ extern "C" { if (use_light_colors) { status = fl_macro_color_save_1(&context->reset, context->color_format, context->color_list.reset); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); - if (f_status_is_not_error(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); - if (f_status_is_not_error(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.blue); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->important, context->color_format, context->color_list.blue); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.purple); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); + if (F_status_is_not_error(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); + if (F_status_is_not_error(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.blue); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->important, context->color_format, context->color_list.blue); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.purple); context->mode = f_color_mode_light; } else { status = fl_macro_color_save_1(&context->reset, context->color_format, context->color_list.reset); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); - if (f_status_is_not_error(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); - if (f_status_is_not_error(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.yellow); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); - if (f_status_is_not_error(status)) status = fl_macro_color_save_2(&context->important, context->color_format, context->color_list.bold, context->color_list.green); - if (f_status_is_not_error(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.green); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); + if (F_status_is_not_error(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); + if (F_status_is_not_error(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.yellow); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); + if (F_status_is_not_error(status)) status = fl_macro_color_save_2(&context->important, context->color_format, context->color_list.bold, context->color_list.green); + if (F_status_is_not_error(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.green); context->mode = f_color_mode_dark; } diff --git a/level_1/fl_color/c/color.h b/level_1/fl_color/c/color.h index 88ee4f7..d2d4145 100644 --- a/level_1/fl_color/c/color.h +++ b/level_1/fl_color/c/color.h @@ -47,36 +47,36 @@ extern "C" { #define fl_macro_color_context_new(status, color_context) \ f_macro_string_dynamic_new(status, color_context.reset, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); #define fl_macro_color_context_delete(status, color_context) \ f_macro_string_dynamic_delete(status, color_context.reset); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.warning); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.error); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.title); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.notable); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.important); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.standout); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal_reset); + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.warning); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.error); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.title); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.notable); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.important); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.standout); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_delete(status, color_context.normal_reset); #define fl_macro_color_context_destroy(status, color_context, size) \ f_macro_string_dynamic_destroy(status, color_context.reset); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.warning, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.error, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.title, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.notable, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.important, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.standout, size); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal_reset); + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.warning, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.error, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.title, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.notable, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.important, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.standout, size); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_destroy(status, color_context.normal_reset); #define fl_macro_color_context_delete_simple(color_context) \ f_macro_string_dynamic_delete_simple(color_context.reset); \ @@ -102,25 +102,25 @@ extern "C" { #define fl_macro_color_context_resize(status, color_context) \ f_macro_string_dynamic_resize(status, color_context.reset, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); #define fl_macro_color_context_adjust(status, color_context) \ f_macro_string_dynamic_adjust(status, color_context.reset, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ - if (f_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.warning, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.error, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.title, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.notable, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.important, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.standout, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal, f_color_max_size + 1); \ + if (F_status_is_not_error(status)) f_macro_string_dynamic_resize(status, color_context.normal_reset, f_color_max_size + 1); #endif // _di_fl_color_context_ /** @@ -144,8 +144,8 @@ extern "C" { * A color to assign, set to 0 to disable. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_set_ extern f_return_status fl_color_set(FILE *file, 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); @@ -178,9 +178,9 @@ extern "C" { * A color to assign, set to 0 to disable. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_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); @@ -211,9 +211,9 @@ extern "C" { * Variable arguments, processed in the same way fprintf() processes them. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_output (with error bit) on output error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_output (with error bit) on output error. */ #ifndef _di_fl_color_print_ extern f_return_status fl_color_print(FILE *file, const f_string_static start_color, const f_string_static end_color, const int8_t *string, ...); @@ -243,9 +243,9 @@ extern "C" { * Variable arguments, processed in the same way fprintf() processes them. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_output (with error bit) on output error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_output (with error bit) on output error. */ #ifndef _di_fl_color_print2_ extern f_return_status fl_color_print2(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...); @@ -270,9 +270,9 @@ extern "C" { * Variable arguments, processed in the same way fprintf() processes them. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_output (with error bit) on output error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_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_static start_color, const f_string_static end_color, const int8_t *string, ...); @@ -302,9 +302,9 @@ extern "C" { * Variable arguments, processed in the same way fprintf() processes them. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_output (with error bit) on output error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_output (with error bit) on output error. */ #ifndef _di_fl_color_print2_line_ extern f_return_status fl_color_print2_line(FILE *file, const f_string_static start_color, const f_string_static extra_color, const f_string_static end_color, const int8_t *string, ...); @@ -321,9 +321,9 @@ extern "C" { * The color code to print. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_output (with error bit) on output error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_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_static color); @@ -338,13 +338,13 @@ extern "C" { * @param context * The color context the load the color codes into. * @param use_light_colors - * Set to f_true to use colors for light backgrounds. - * Set to f_false to use colors forr dark backgrounds. + * Set to F_true to use colors for light backgrounds. + * Set to F_false to use colors forr dark backgrounds. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_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.c b/level_1/fl_console/c/console.c index 08a0e99..de61f9a 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -6,12 +6,12 @@ extern "C" { #ifndef _fl_console_parameter_to_string_dynamic_directory_ f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string argument, f_string_dynamic *directory) { - f_status status = f_none; + f_status status = F_none; f_string_length length = strlen(argument); if (length == 0) { directory->used = 0; - return f_none; + return F_none; } if (length > 1) { @@ -32,7 +32,7 @@ extern "C" { length += 2; f_macro_string_dynamic_new(status, (*directory), length); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string + 1, argument + begin, length - 2); @@ -43,7 +43,7 @@ extern "C" { } else { f_macro_string_dynamic_new(status, (*directory), 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; directory->used = 1; directory->size = 1; @@ -63,7 +63,7 @@ extern "C" { length += 4; f_macro_string_dynamic_new(status, (*directory), length); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string + 3, argument + begin, length - 4); @@ -76,7 +76,7 @@ extern "C" { } else { f_macro_string_dynamic_new(status, (*directory), 3); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; directory->used = 3; directory->size = 3; @@ -98,7 +98,7 @@ extern "C" { length += 3; f_macro_string_dynamic_new(status, (*directory), length); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string + 2, argument + begin, length - 3); @@ -110,7 +110,7 @@ extern "C" { } else { f_macro_string_dynamic_new(status, (*directory), 2); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; directory->used = 2; directory->size = 2; @@ -122,7 +122,7 @@ extern "C" { length++; f_macro_string_dynamic_new(status, (*directory), length); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string, argument, length - 1); @@ -133,7 +133,7 @@ extern "C" { } else if (argument[0] != '/') { f_macro_string_dynamic_new(status, (*directory), 2); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 2); @@ -143,7 +143,7 @@ extern "C" { } else { f_macro_string_dynamic_new(status, (*directory), 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(directory->string, argument, 1); @@ -151,18 +151,18 @@ extern "C" { directory->size = 1; } - return f_none; + return F_none; } #endif // _fl_console_parameter_to_string_dynamic_directory_ #ifndef _fl_console_parameter_to_number_signed_ f_return_status fl_console_parameter_to_number_signed(const f_string argument, f_number_signed *number) { #ifndef _di_level_0_parameter_checking_ - if (argument == 0) return f_status_set_error(f_invalid_parameter); + if (argument == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f if (argument[0] == '\0') { - return f_status_set_error(f_no_data); + return F_status_set_error(F_data_not); } f_string_range range = f_string_range_initialize; @@ -176,11 +176,11 @@ extern "C" { #ifndef _fl_console_parameter_to_number_unsigned_ f_return_status fl_console_parameter_to_number_unsigned(const f_string argument, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ - if (argument == 0) return f_status_set_error(f_invalid_parameter); + if (argument == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_f if (argument[0] == '\0') { - return f_status_set_error(f_no_data); + return F_status_set_error(F_data_not); } f_string_range range = f_string_range_initialize; diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index 57aac4f..ff26b88 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -50,8 +50,8 @@ extern "C" { * The dynamically allocated processed directory string. * * @return - * f_none on success. - * f_error_allocation (with error bit) on allocation error. + * F_none on success. + * F_memory_allocation (with error bit) on allocation error. */ #ifndef _fl_console_parameter_to_string_dynamic_directory_ extern f_return_status fl_console_parameter_to_string_dynamic_directory(const f_string argument, f_string_dynamic *directory); @@ -78,13 +78,13 @@ extern "C" { * This only gets modified on success. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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() */ @@ -113,13 +113,13 @@ extern "C" { * This only gets modified on success. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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 b600d5f..452d35a 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -7,15 +7,15 @@ extern "C" { #ifndef _di_f_directory_copy_ f_return_status f_directory_copy(const f_string source, const f_string destination, const mode_t mode, const f_number_unsigned size_block, const bool exclusive) { - f_status status = f_none; + f_status status = F_none; /* @todo status = f_directory_exists(source); - if (f_status_is_error(status)) return status; - if (status == f_false) return f_status_set_error(f_invalid_directory); + if (F_status_is_error(status)) return status; + if (status == F_false) return F_status_set_error(F_directory); status = f_directory_exists(destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; if (exclusive) { } @@ -24,14 +24,14 @@ extern "C" { status = private_fl_directory_list(source, 0, 0, listing);*/ - return f_none; + return F_none; } #endif // _di_f_directory_copy_ #ifndef _di_fl_directory_list_ f_return_status fl_directory_list(const f_string path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), f_directory_listing *listing) { #ifndef _di_level_2_parameter_checking_ - if (listing == 0) return f_status_set_error(f_invalid_parameter); + if (listing == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ return private_fl_directory_list(path, filter, sort, listing); diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 8caffe0..d57f45f 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -63,26 +63,26 @@ extern "C" { * If FALSE, will not fail if parent directory already exists (existing directory will be updated). * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. - * f_file_error_read (with error bit) on file read error. - * f_file_error_write (with error bit) on file write error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_read (with error bit) on file read error. + * F_file_write (with error bit) on file write error. * @see f_directory_create() * @see f_file_copy() @@ -119,26 +119,26 @@ extern "C" { * (In both cases the file mode is copied.) * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_access_denied (with error bit) on access denied. - * f_loop (with error bit) on loop error. - * f_file_found (with error bit) if a file was found while exclusive is TRUE. - * f_out_of_memory (with error bit) if out of memory. - * f_prohibited (with error bit) if filesystem does not allow for removing. - * f_read_only (with error bit) if file is read-only. - * f_failure (with error bit) for any other (mkdir()) error. - * f_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. - * f_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. - * f_file_found (with error bit) of a directory aleady exists at the path. - * f_invalid_name (with error bit) on path name error. - * f_invalid_directory (with error bit) if a supposed directory in path is not actually a directory. - * f_number_overflow (with error bit) on overflow error. - * f_interrupted (with error bit) when program received an interrupt signal, halting create. - * f_file_max_open (with error bit) when system-wide max open files is reached. - * f_busy (with error bit) if filesystem is too busy to perforrm write. - * f_file_error_read (with error bit) on file read error. - * f_file_error_write (with error bit) on file write error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_access_denied (with error bit) on access denied. + * F_loop (with error bit) on loop error. + * F_file_found (with error bit) if a file was found while exclusive is TRUE. + * F_memory_out (with error bit) if out of memory. + * F_prohibited (with error bit) if filesystem does not allow for removing. + * F_read_only (with error bit) if file is read-only. + * F_failure (with error bit) for any other (mkdir()) error. + * F_filesystem_quota_blocks (with error bit) if filesystem's disk blocks or inodes are exhausted. + * F_filesystem_quota_reached (with error bit) quota reached of filesystem is out of space. + * F_file_found (with error bit) of a directory aleady exists at the path. + * F_name (with error bit) on path name error. + * F_directory (with error bit) if a supposed directory in path is not actually a directory. + * F_number_overflow (with error bit) on overflow error. + * F_interrupted (with error bit) when program received an interrupt signal, halting create. + * F_file_open_max (with error bit) when system-wide max open files is reached. + * F_busy (with error bit) if filesystem is too busy to perforrm write. + * F_file_read (with error bit) on file read error. + * F_file_write (with error bit) on file write error. * * @see f_directory_create() * @see f_file_clone() @@ -166,17 +166,17 @@ extern "C" { * Will be populated with the names of all top-level paths found within the given directory. * * @return - * f_none on success. - * 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_error_reallocation (with error bit) on memory reallocation error. - * f_directory_error_open (with error bit) on directory open error. - * f_directory_error_descriptor (with error bit) on directory file descriptor error. - * f_directory_error_stream (with error bit) on directory stream error. - * f_directory_error_unsupported (with error bit) on directory file descriptor not supported. - * f_file_max_descriptors (with error bit) if max file descriptors was reached. - * f_file_max_open (with error bit) too many open files. + * F_none on success. + * F_data_not 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_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. + * F_directory_open (with error bit) on directory open error. + * F_directory_descriptor (with error bit) on directory file descriptor error. + * F_directory_stream (with error bit) on directory stream error. + * F_directory_unsupported (with error bit) on directory file descriptor not supported. + * F_file_descriptors_max (with error bit) if max file descriptors was reached. + * F_file_open_max (with error bit) too many open files. * * @see alphasort() * @see opendir() diff --git a/level_1/fl_directory/c/private-directory.c b/level_1/fl_directory/c/private-directory.c index ac93ccb..9dc7080 100644 --- a/level_1/fl_directory/c/private-directory.c +++ b/level_1/fl_directory/c/private-directory.c @@ -7,32 +7,32 @@ extern "C" { #ifndef _di_f_directory_copy_ f_return_status private_f_directory_copy(const f_string source, const f_string destination, const f_directory_mode mode, const f_number_unsigned size_block, const bool exclusive) { - f_status status = f_none; + f_status status = F_none; status = f_directory_exists(source); - if (f_status_is_error(status)) return status; - if (status == f_false) return f_status_set_error(f_invalid_directory); + if (F_status_is_error(status)) return status; + if (status == F_false) return F_status_set_error(F_directory); status = f_directory_exists(destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if (status == f_true) { + if (status == F_true) { if (exclusive) { - return f_status_set_error(f_directory_found); + return F_status_set_error(F_directory_found); } - status = f_file_change_mode(destination, mode.directory, f_false); - if (f_status_is_error(status)) return status; + status = f_file_change_mode(destination, mode.directory, F_false); + if (F_status_is_error(status)) return status; } else { status = f_directory_create(destination, mode.directory); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } f_directory_listing listing = f_directory_listing_initialize; status = private_fl_directory_list(source, 0, 0, &listing); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_directory_listing_delete_simple(listing); return status; } @@ -88,7 +88,7 @@ extern "C" { } // for f_macro_string_dynamics_delete_simple(listing.directory); - return f_none; + return F_none; } #endif // _di_f_directory_copy_ @@ -97,34 +97,34 @@ extern "C" { struct dirent **entity = 0; f_string_length size = 0; - f_status status = f_none; + f_status status = F_none; DIR *parent = opendir(path); if (parent == 0) { if (errno == ENOMEM) { - return f_status_set_error(f_out_of_memory); + return F_status_set_error(F_memory_out); } else if (errno == ENOMEM) { - return f_status_set_error(f_out_of_memory); + return F_status_set_error(F_memory_out); } else if (errno == EMFILE) { - return f_status_set_error(f_file_max_descriptors); + return F_status_set_error(F_file_descriptors_max); } else if (errno == ENFILE) { - return f_status_set_error(f_file_max_open); + return F_status_set_error(F_file_open_max); } else if (errno == ENOTDIR) { - return f_status_set_error(f_invalid_directory); + return F_status_set_error(F_directory); } else if (errno == ENOENT) { - return f_status_set_error(f_directory_not_found); + return F_status_set_error(F_directory_not_found); } else if (errno == EACCES) { - return f_status_set_error(f_access_denied); + return F_status_set_error(F_access_denied); } - return f_status_set_error(f_directory_error_open); + return F_status_set_error(F_directory_open); } int parent_fd = dirfd(parent); @@ -133,13 +133,13 @@ extern "C" { closedir(parent); if (errno == EINVAL) { - return f_status_set_error(f_directory_error_stream); + return F_status_set_error(F_directory_stream); } else if (errno == ENOTSUP) { - return f_status_set_error(f_directory_error_unsupported); + return F_status_set_error(F_directory_unsupported); } - return f_status_set_error(f_directory_error_descriptor); + return F_status_set_error(F_directory_descriptor); } const size_t length = scandir(path, &entity, filter, sort); @@ -147,8 +147,8 @@ extern "C" { if (length == -1) { closedir(parent); - if (errno == ENOMEM) return f_status_set_error(f_error_allocation); - else return f_status_set_error(f_failure); + if (errno == ENOMEM) return F_status_set_error(F_memory_allocation); + else return F_status_set_error(F_failure); } f_string_dynamics *names = 0; @@ -169,7 +169,7 @@ extern "C" { memset(&file_stat, 0, sizeof(struct stat)); status = f_file_stat_at(parent_fd, entity[i]->d_name, 0, &file_stat); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; mode = f_macro_file_type_get(file_stat.st_mode); @@ -200,24 +200,24 @@ extern "C" { if (names->used >= names->size) { f_macro_string_dynamics_resize(status, (*names), names->size + f_directory_default_allocation_step); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } f_macro_string_dynamic_new(status, names->array[names->used], size); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; if (names->array[names->used].used > 0 && names->array[names->used].string[names->array[names->used].used - 1] != 0) { if (names->array[names->used].used + 1 > f_string_length_size) { - status = f_status_set_error(f_string_too_large); + status = F_status_set_error(F_string_too_large); break; } total = names->array[names->used].used + 1; if (total > names->array[names->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_string_dynamics_resize(status, (*names), total); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } names->array[names->used].string[names->array[names->used].used] = 0; @@ -239,10 +239,10 @@ extern "C" { f_memory_delete((void **) & entity, sizeof(struct dirent *), 1); - if (f_status_is_error(status)) return status; - if (length == 0) return f_no_data; + if (F_status_is_error(status)) return status; + if (length == 0) return F_data_not; - return f_none; + return F_none; } #endif // !defined(_di_fl_directory_list_) diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index c319940..9029496 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -54,17 +54,17 @@ extern "C" { * Will be populated with the names of all top-level paths found within the given directory. * * @return - * f_none on success. - * 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_error_reallocation (with error bit) on memory reallocation error. - * f_directory_error_open (with error bit) on directory open error. - * f_directory_error_descriptor (with error bit) on directory file descriptor error. - * f_directory_error_stream (with error bit) on directory stream error. - * f_directory_error_unsupported (with error bit) on directory file descriptor not supported. - * f_file_max_descriptors (with error bit) if max file descriptors was reached. - * f_file_max_open (with error bit) too many open files. + * F_none on success. + * F_data_not 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_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. + * F_directory_open (with error bit) on directory open error. + * F_directory_descriptor (with error bit) on directory file descriptor error. + * F_directory_stream (with error bit) on directory stream error. + * F_directory_unsupported (with error bit) on directory file descriptor not supported. + * F_file_descriptors_max (with error bit) if max file descriptors was reached. + * F_file_open_max (with error bit) too many open files. * * @see fl_directory_list() */ diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index 13ed5b0..c6d2926 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -7,14 +7,14 @@ extern "C" { #ifndef _di_fl_fss_decrement_buffer_ f_return_status fl_fss_decrement_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer.used) return f_status_set_error(f_invalid_parameter); - if (step < 1) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (location->start >= buffer.used) return F_status_set_error(F_parameter); + if (step < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (location->start < 1) return f_none_on_eos; + if (location->start < 1) return F_none_eos; f_string_length i = 0; unsigned short width = 0; @@ -24,32 +24,32 @@ extern "C" { if (width > location->start) { if (width > 1) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } - return f_none_on_eos; + return F_none_eos; } i++; location->start -= width; } while (i < step); - return f_none; + return F_none; } #endif // _di_fl_fss_decrement_buffer_ #ifndef _di_fl_fss_identify_ f_return_status fl_fss_identify(const f_string_static buffer, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ - if (header == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); + if (header == 0) return F_status_set_error(F_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = 0; if (buffer.used < 10) { // "# fss-0000" is always 10 characters. - return fl_fss_no_header; + return FL_fss_header_not; } // If this correctly follows the FSS specification, then this should be all that needs to be done (as well as atoh for ascii to hex). @@ -72,16 +72,16 @@ extern "C" { if (buffer.string[i] == f_fss_type_header_part5) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; f_string_range length = f_string_range_initialize; @@ -97,14 +97,14 @@ extern "C" { i++; header->length = i; - return f_none; + return F_none; } else { // if "# fss-0000" is there, regardless of whats next, we can guess this to be of fss-0000, even if its fss-00001 (this is a guess afterall) i++; header->length = i; - return f_status_is_warning(fl_fss_invalid_but_accepted); + return F_status_is_warning(FL_fss_accepted_invalid); } } } @@ -128,16 +128,16 @@ extern "C" { if (buffer.string[i] == f_fss_type_header_part5) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == f_true) { + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { i++; f_string_range length = f_string_range_initialize; @@ -149,7 +149,7 @@ extern "C" { header->length = i + 1; - return f_status_is_warning(fl_fss_invalid_but_accepted); + return F_status_is_warning(FL_fss_accepted_invalid); } } } @@ -163,34 +163,34 @@ extern "C" { // TODO: At some point add checksum and compressions checks here, but the above statements will have to be adjusted accordingly // 3: eventually this will be processing the checksum and 4: will be processing the compression - return fl_fss_no_header; + return FL_fss_header_not; } #endif // _di_fl_fss_identify_ #ifndef _di_fl_fss_identify_file_ f_return_status fl_fss_identify_file(f_file *file, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ - if (file == 0) return f_status_set_error(f_invalid_parameter); - if (header == 0) return f_status_set_error(f_invalid_parameter); - if (file->id == 0) return f_status_set_error(f_file_not_open); - if (file->id < 0) return f_status_set_error(f_file_error); + if (file == 0) return F_status_set_error(F_parameter); + if (header == 0) return F_status_set_error(F_parameter); + if (file->id == 0) return F_status_set_error(F_file_open_not); + if (file->id < 0) return F_status_set_error(F_file_error); #endif // _di_level_1_parameter_checking_ { f_string_length seeked = 0; - if (f_status_is_error(f_file_seek(file->id, SEEK_SET, 0, &seeked))) { - return f_status_set_error(f_file_error_seek); + if (F_status_is_error(f_file_seek(file->id, SEEK_SET, 0, &seeked))) { + return F_status_set_error(F_file_seek); } } - f_status status = f_none; + f_status status = F_none; f_string_dynamic buffer = f_string_dynamic_initialize; f_macro_string_dynamic_resize(status, buffer, f_fss_max_header_length + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = f_file_read_until(*file, &buffer, f_fss_max_header_length + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; return fl_fss_identify(buffer, header); } @@ -199,11 +199,11 @@ extern "C" { #ifndef _di_fl_fss_increment_buffer_ f_return_status fl_fss_increment_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer.used) return f_status_set_error(f_invalid_parameter); - if (step < 1) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (location->start >= buffer.used) return F_status_set_error(F_parameter); + if (step < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ f_string_length i = 0; @@ -214,36 +214,36 @@ extern "C" { if (location->start + width > location->stop) { if (width > 1) { - return f_status_set_error(f_incomplete_utf_on_stop); + return F_status_set_error(F_incomplete_utf_stop); } location->start += width; - return f_none_on_stop; + return F_none_stop; } else if (location->start + width >= buffer.used) { if (width > 1) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } location->start += width; - return f_none_on_eos; + return F_none_eos; } i++; location->start += width; } while (i < step); - return f_none; + return F_none; } #endif // _di_fl_fss_increment_buffer_ #ifndef _di_fl_fss_is_graph_ f_return_status fl_fss_is_graph(const f_string_static buffer, const f_string_range range) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ f_string_length width_max = (range.stop - range.start) + 1; @@ -260,10 +260,10 @@ extern "C" { #ifndef _di_fl_fss_is_space_ f_return_status fl_fss_is_space(const f_string_static buffer, const f_string_range range) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ f_string_length width_max = (range.stop - range.start) + 1; @@ -280,14 +280,14 @@ extern "C" { #ifndef _di_fl_fss_skip_past_space_ f_return_status fl_fss_skip_past_space(const f_string_static buffer, f_string_range *range) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (range->start < 0) return f_status_set_error(f_invalid_parameter); - if (range->stop < range->start) return f_status_set_error(f_invalid_parameter); - if (range->start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (range->start < 0) return F_status_set_error(F_parameter); + if (range->stop < range->start) return F_status_set_error(F_parameter); + if (range->start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; @@ -300,59 +300,59 @@ extern "C" { if (buffer.string[range->start] != f_string_placeholder) { status = f_utf_is_whitespace(buffer.string + range->start, width_max); - if (status == f_false) { + if (status == F_false) { status = f_utf_is_control(buffer.string + range->start, width_max); - if (status == f_false) { + if (status == F_false) { status = f_utf_is_zero_width(buffer.string + range->start, width_max); - if (status == f_true) { + if (status == F_true) { f_string_length next_width_max = 0; for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { next_width_max = (range->stop - next) + 1; status = f_utf_is_whitespace(buffer.string + next, width_max); - if (status == f_true) { + if (status == F_true) { // treat zero-width before a space like a space. break; } - else if (status == f_false) { + else if (status == F_false) { status = f_utf_is_control(buffer.string + next, width_max); - if (status == f_true) { + if (status == F_true) { // treat zero-width before a control character like a space. break; } - else if (status == f_false) { + else if (status == F_false) { status = f_utf_is_zero_width(buffer.string + next, width_max); - if (status == f_true) { + if (status == F_true) { // seek until a non-zero-width is reached. continue; } - else if (status == f_false) { + else if (status == F_false) { // treat zero-width as a non-whitespace non-control character when preceding a non-whitespace non-control character. - return f_none; + return F_none; } } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } // for } - else if (status == f_false) { + else if (status == F_false) { // treat zero-width as a graph when preceding a non-whitespace non-control (that is not a zero-width). - return f_none; + return F_none; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - if (buffer.string[range->start] == f_string_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_string_eol) return F_none_eol; width = f_macro_utf_byte_width_is(buffer.string[range->start]); @@ -361,17 +361,17 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; @@ -380,25 +380,25 @@ extern "C" { } } // for - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_fss_skip_past_space_ #ifndef _di_fl_fss_skip_past_non_graph_ f_return_status fl_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (range->start < 0) return f_status_set_error(f_invalid_parameter); - if (range->stop < range->start) return f_status_set_error(f_invalid_parameter); - if (range->start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (range->start < 0) return F_status_set_error(F_parameter); + if (range->stop < range->start) return F_status_set_error(F_parameter); + if (range->start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; @@ -411,50 +411,50 @@ extern "C" { if (buffer.string[range->start] != f_string_placeholder) { status = f_utf_is_graph(buffer.string + range->start, width_max); - if (status == f_true) { + if (status == F_true) { // stop at a graph. break; } - else if (status == f_false) { + else if (status == F_false) { status = f_utf_is_zero_width(buffer.string + range->start, width_max); - if (status == f_true) { + if (status == F_true) { f_string_length next_width_max = 0; for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { next_width_max = (range->stop - next) + 1; status = f_utf_is_graph(buffer.string + next, width_max); - if (status == f_true) { + if (status == F_true) { // treat zero-width as a graph when preceding a graph. - return f_none; + return F_none; } - else if (status == f_false) { + else if (status == F_false) { status = f_utf_is_zero_width(buffer.string + next, width_max); - if (status == f_true) { + if (status == F_true) { // seek until a non-zero-width is reached. continue; } - else if (status == f_false) { + else if (status == F_false) { // treat zero-width as a non-graph when preceding a non-graph (that is not a zero-width). break; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } // for } - else if (status == f_false) { + else if (status == F_false) { // continue on when non-graph and non-zero-width. break; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - else if (f_status_is_error(status)) return status; + else if (F_status_is_error(status)) return status; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; width = f_macro_utf_byte_width_is(buffer.string[range->start]); @@ -463,17 +463,17 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; @@ -482,21 +482,21 @@ extern "C" { } } // for - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_fss_skip_past_non_graph_ #ifndef _di_fl_fss_shift_delimiters_ f_return_status fl_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range) { #ifndef _di_level_1_parameter_checking_ - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ f_string_length position = 0; @@ -520,7 +520,7 @@ extern "C" { if (utf_width > 1) { // not enough space in buffer or in range range to process UTF-8 character. if (position + utf_width >= buffer->used || position + utf_width > range.stop) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } if (distance > 0) { @@ -548,7 +548,7 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_fl_fss_shift_delimiters_ diff --git a/level_1/fl_fss/c/fss.h b/level_1/fl_fss/c/fss.h index f24dd03..08a40b0 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -46,12 +46,12 @@ extern "C" { * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). * * @return - * f_none on success. - * f_none_on_stop if the stop range is reached before all steps are completed. - * f_none_on_eos if the end of buffer is reached before all steps are completed. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_incomplete_utf_on_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. - * 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_none on success. + * F_none_stop if the stop range is reached before all steps are completed. + * F_none_eos if the end of buffer is reached before all steps are completed. + * F_parameter (with error bit) if a parameter is invalid. + * F_incomplete_utf_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. */ #ifndef _di_fl_fss_decrement_buffer_ extern f_return_status fl_fss_decrement_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); @@ -66,9 +66,9 @@ extern "C" { * The header data to populate with results of this function. * * @return - * fl_fss_no_header if no header is found. - * fl_fss_no_header (with error bit) if the an error occurred prior to identifying a valid header. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_header_not if no header is found. + * FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_identify_ extern f_return_status fl_fss_identify(const f_string_static buffer, f_fss_header *header); @@ -83,12 +83,12 @@ extern "C" { * The header data to populate with results of this function. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. * * Errors from (with error bit): f_file_read_until(). * Errors from (with error bit): fl_fss_identify() - * File errors (with error bit): f_file_error_seek, f_file_not_open. + * File errors (with error bit): F_file_seek, F_file_open_not. * * @see f_file_read_until() * @see fl_fss_identify() @@ -115,12 +115,12 @@ extern "C" { * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). * * @return - * f_none on success. - * f_none_on_stop if the stop range is reached before all steps are completed. - * f_none_on_eos if the end of buffer is reached before all steps are completed. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_incomplete_utf_on_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. - * 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_none on success. + * F_none_stop if the stop range is reached before all steps are completed. + * F_none_eos if the end of buffer is reached before all steps are completed. + * F_parameter (with error bit) if a parameter is invalid. + * F_incomplete_utf_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed. */ #ifndef _di_fl_fss_increment_buffer_ extern f_return_status fl_fss_increment_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); @@ -137,11 +137,11 @@ extern "C" { * The header data to populate with results of this function. * * @return - * f_true if the character in the buffer is a graph character. - * f_false if the character in the buffer is not a graph character. - * f_maybe (with error bit) if the character width is outside the stop position. - * f_failure (with error bit) if the buffer is not wide enough or the width is outside the stop position. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if the character in the buffer is a graph character. + * F_false if the character in the buffer is not a graph character. + * F_maybe (with error bit) if the character width is outside the stop position. + * F_failure (with error bit) if the buffer is not wide enough or the width is outside the stop position. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_is_graph_ extern f_return_status fl_fss_is_graph(const f_string_static buffer, const f_string_range range); @@ -158,11 +158,11 @@ extern "C" { * The header data to populate with results of this function. * * @return - * f_true if the character in the buffer is a space character. - * f_false if the character in the buffer is not a space character. - * f_maybe (with error bit) if the character width is outside the stop position. - * f_failure (with error bit) if the buffer is not wide enough or the width is outside the stop position. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_true if the character in the buffer is a space character. + * F_false if the character in the buffer is not a space character. + * F_maybe (with error bit) if the character width is outside the stop position. + * F_failure (with error bit) if the buffer is not wide enough or the width is outside the stop position. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_is_space_ extern f_return_status fl_fss_is_space(const f_string_static buffer, const f_string_range range); @@ -181,9 +181,9 @@ extern "C" { * A restriction on where within the buffer the shifting happens. * * @return - * f_none on success. - * f_invalid_utf (with error bit) if UTF-8 cannot be fully processed (buffer or range range not long enough). - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_utf (with error bit) if UTF-8 cannot be fully processed (buffer or range range not long enough). + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_shift_delimiters_ extern f_return_status fl_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range); @@ -202,8 +202,8 @@ extern "C" { * This increments range->start. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_skip_past_space_ extern f_return_status fl_fss_skip_past_space(const f_string_static buffer, f_string_range *range); @@ -222,8 +222,8 @@ extern "C" { * This increments range->start. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_skip_past_non_graph_ extern f_return_status fl_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range); diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 4efa1a7..9beea91 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -7,46 +7,46 @@ extern "C" { #ifndef _di_fl_fss_basic_object_read_ f_return_status fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_basic_close) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // when handling delimits, the only time they should be applied is when a valid object would exist // however, the delimits will appear before a valid object, so remember their positions and only apply them after a would be valid object is confirmed - bool has_delimit = f_false; + bool has_delimit = F_false; // begin the search found->start = location->start; // ignore all comment lines if (buffer->string[location->start] == f_fss_comment) { - fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // handle quote support @@ -57,27 +57,27 @@ extern "C" { f_string_length last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } else { status = fl_fss_is_graph(*buffer, *location); - if (status == f_false) { + if (status == F_false) { found->stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } else if (buffer->string[location->start] != f_fss_delimit_slash) { @@ -88,16 +88,16 @@ extern "C" { last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -107,47 +107,47 @@ extern "C" { delimits.used++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->start = location->start; } // identify where the object ends if (quoted == 0) { - status = f_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_space(*buffer, *location)) == f_false) { + status = F_none; + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_space(*buffer, *location)) == F_false) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_is_space(*buffer, *location); - if (status == f_true) { + if (status == F_true) { found->stop = location->start - 1; fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); if (buffer->string[location->start] == f_string_eol) { location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } } @@ -158,14 +158,14 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -176,10 +176,10 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) if (buffer->string[location->start] == quoted) { f_string_length length = location->start; @@ -190,7 +190,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -208,38 +208,38 @@ extern "C" { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length + 1; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) - if ((status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) f_macro_string_lengths_delete_simple(delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -249,7 +249,7 @@ extern "C" { found->stop = length - 1; location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -257,15 +257,15 @@ extern "C" { found->stop = length - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } else { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -282,7 +282,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length; @@ -293,105 +293,105 @@ extern "C" { found->stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_string_eol) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) f_macro_string_lengths_delete_simple(delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else if (buffer->string[location->start] == f_string_eol) { f_macro_string_lengths_delete_simple(delimits); location->start++; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) } // seek to the end of the line when no valid object is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) f_macro_string_lengths_delete_simple(delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } #endif // _di_fl_fss_basic_object_read_ #ifndef _di_fl_fss_basic_content_read_ f_return_status fl_fss_basic_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_string_eol) { location->start++; - return fl_fss_found_no_content; + return FL_fss_found_content_not; } fl_macro_fss_allocate_content_if_necessary((*found), delimits); @@ -400,32 +400,32 @@ extern "C" { // search for valid content do { fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_fss_basic_close) break; location->start++; - } while (f_true); + } while (F_true); // Save the stop length found->array[found->used].stop = location->start - 1; found->used++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_content; + return FL_fss_found_content; } #endif // _di_fl_fss_basic_content_read_ #ifndef _di_fl_fss_basic_object_write_ f_return_status fl_fss_basic_object_write(f_string_dynamic *buffer, const f_string_static object, f_string_range *location) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; - bool quoted = f_false; + f_status status = F_none; + bool quoted = F_false; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -434,10 +434,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(object, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= object.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -448,7 +448,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -458,7 +458,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -470,7 +470,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (object.string[location->start] == f_fss_delimit_single_quote || object.string[location->start] == f_fss_delimit_double_quote) { @@ -479,7 +479,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -487,7 +487,7 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (object.string[location->start] == f_fss_delimit_single_quote || object.string[location->start] == f_fss_delimit_double_quote) { @@ -496,7 +496,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -504,16 +504,16 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else if (object.string[location->start] == f_fss_comment) { - quoted = f_true; + quoted = F_true; } while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -526,15 +526,15 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_basic_open; buffer->used = buffer_position.stop + 1; - return f_none_on_eol; + return F_none_eol; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true || quoted) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true || quoted) { pre_allocate_size++; if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // restart the loop searching for f_fss_delimit_double_quote. @@ -547,7 +547,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -557,7 +557,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -572,7 +572,7 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; fl_macro_fss_skip_past_delimit_placeholders(object, (*location)); @@ -587,7 +587,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } break; @@ -596,7 +596,7 @@ extern "C" { slash_count = 0; break; } - } while (f_true); + } while (F_true); while (slash_count > 0) { buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -613,13 +613,13 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_basic_open; buffer->used = buffer_position.stop + 1; - return f_none_on_eol; + return F_none_eol; } buffer->string[buffer_position.stop] = object.string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; buffer_position.stop++; } // while @@ -629,14 +629,14 @@ extern "C" { buffer->used = buffer_position.stop + 2; break; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } buffer->string[buffer_position.stop] = object.string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; buffer_position.stop++; } // while @@ -647,23 +647,23 @@ extern "C" { } if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= object.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_basic_object_write_ #ifndef _di_fl_fss_basic_content_write_ f_return_status fl_fss_basic_content_write(f_string_dynamic *buffer, const f_string_static content, f_string_range *location) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_range input_position = f_string_range_initialize; f_string_range buffer_position = f_string_range_initialize; @@ -678,14 +678,14 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_string_eol) { buffer->string[buffer_position.stop] = f_string_eol; buffer->used = buffer_position.stop + 1; - return f_none_on_eos; + return F_none_eos; } if (content.string[location->start] != f_fss_delimit_placeholder) { @@ -694,20 +694,20 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = f_string_eol; buffer->used = buffer_position.stop + 1; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= content.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_basic_content_write_ diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index ba9f9fe..888c31a 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -49,18 +49,18 @@ extern "C" { * A set of all locations where a valid object was found. * * @return - * fl_fss_found_object on success and object was found (start location is at end of object). - * fl_fss_found_no_object on success and no object was found (start location is after character designating this is not an object). - * f_none_on_stop on success after reaching stopping point (a valid object is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no objects found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_object on success and object was found (start location is at end of object). + * FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object). + * F_none_stop on success after reaching stopping point (a valid object is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no objects found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_object_read_ extern f_return_status fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -84,18 +84,18 @@ extern "C" { * A set of all locations where a valid content was found. * * @return - * fl_fss_found_content on success and content was found (start location is at end of content). - * fl_fss_found_no_content on success and no content was found (start location is after character designating this is not a content). - * f_none_on_stop on success after reaching stopping point (a valid content is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no content found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_content on success and content was found (start location is at end of content). + * FL_fss_found_content_not on success and no content was found (start location is after character designating this is not a content). + * F_none_stop on success after reaching stopping point (a valid content is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no content found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_content_read_ extern f_return_status fl_fss_basic_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -117,15 +117,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_object_write_ extern f_return_status fl_fss_basic_object_write(f_string_dynamic *buffer, const f_string_static object, f_string_range *location); @@ -146,15 +146,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_content_write_ extern f_return_status fl_fss_basic_content_write(f_string_dynamic *buffer, const f_string_static content, f_string_range *location); diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index a1a8499..f631589 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -7,27 +7,27 @@ extern "C" { #ifndef _di_fl_fss_basic_list_object_read_ f_return_status fl_fss_basic_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) // return found nothing if this line only contains whitespace and delimit placeholders. if (buffer->string[location->start] == f_string_eol) { location->start++; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // begin the search. @@ -35,12 +35,12 @@ extern "C" { // ignore all comment lines. if (buffer->string[location->start] == f_fss_comment) { - fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // identify where the object ends. @@ -50,7 +50,7 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { if (buffer->string[location->start] == f_fss_delimit_slash) { @@ -58,29 +58,29 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) if (buffer->string[location->start] == f_fss_basic_list_open) { f_string_length stop_point = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) if (buffer->string[location->start] == f_string_eol) { f_string_length start = location->start; @@ -90,7 +90,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -108,7 +108,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -116,11 +116,11 @@ extern "C" { found->stop = stop_point; location->start = start + 1; - return fl_fss_found_object; + return FL_fss_found_object; } location->start = start + 1; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } } @@ -130,20 +130,20 @@ extern "C" { f_string_length stop_point = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_string_eol) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -151,69 +151,69 @@ extern "C" { found->stop = stop_point; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } continue; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while // seek to the end of the line when no valid object is found. while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } #endif // _di_fl_fss_basic_list_object_read_ #ifndef _di_fl_fss_basic_list_content_read_ f_return_status fl_fss_basic_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) fl_macro_fss_allocate_content_if_necessary((*found), delimits); found->array[found->used].start = location->start; f_string_length last_newline = location->start; - bool found_newline = f_false; + bool found_newline = F_false; // identify where the content ends. while (location->start < buffer->used && location->start <= location->stop) { if (buffer->string[location->start] == f_string_eol) { - found_newline = f_true; + found_newline = F_true; last_newline = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) continue; } @@ -223,7 +223,7 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { if (buffer->string[location->start] == f_fss_delimit_slash) { @@ -231,38 +231,38 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (found_newline) { - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else { - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) } if (buffer->string[location->start] == f_fss_basic_list_open) { f_string_length stop_point = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (found_newline) { - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else { - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) } if (buffer->string[location->start] == f_string_eol) { @@ -278,16 +278,16 @@ extern "C" { location->start = last_newline + 1; found->used++; - return fl_fss_found_content; + return FL_fss_found_content; } - return fl_fss_found_no_content; + return FL_fss_found_content_not; } if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -304,10 +304,10 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - found_newline = f_true; + found_newline = F_true; location->start = start + 1; } } @@ -316,24 +316,24 @@ extern "C" { } else if (buffer->string[location->start] == f_fss_basic_list_open) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (found_newline) { - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else { - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) } if (buffer->string[location->start] == f_string_eol) { @@ -344,21 +344,21 @@ extern "C" { location->start = last_newline + 1; found->used++; - return fl_fss_found_content; + return FL_fss_found_content; } if (!found_newline) { location->start = last_newline; } - return fl_fss_found_no_content; + return FL_fss_found_content_not; } continue; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (found_newline) { @@ -368,24 +368,24 @@ extern "C" { location->start = last_newline + 1; found->used++; - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) - return fl_fss_found_content; + return FL_fss_found_content; } - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) - return fl_fss_found_no_content; + return FL_fss_found_content_not; } #endif // _di_fl_fss_basic_list_content_read_ #ifndef _di_fl_fss_basic_list_object_write_ f_return_status fl_fss_basic_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -395,10 +395,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(object, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= object.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -409,7 +409,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -418,12 +418,12 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_comment) { // comments are not allowed and this format has no way of "wrapping" a comment. - return f_status_set_error(fl_fss_found_comment); + return F_status_set_error(FL_fss_found_comment); } - else if ((status = fl_fss_is_graph(object, *location)) == f_true) { + else if ((status = fl_fss_is_graph(object, *location)) == F_true) { break; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } @@ -433,7 +433,7 @@ extern "C" { } status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while while (location->start <= location->stop && location->start < object.used) { @@ -444,12 +444,12 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } else if (object.string[location->start] != f_fss_delimit_slash) { @@ -460,7 +460,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; slash_count++; } // while @@ -471,7 +471,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (slash_count > 0) { @@ -485,7 +485,7 @@ extern "C" { } else if (object.string[location->start] == f_string_eol) { if (buffer_position.stop == buffer_position.start) { - return f_no_data_on_eol; + return F_data_no_eol; } break; @@ -497,7 +497,7 @@ extern "C" { } status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = f_fss_basic_list_open; @@ -505,25 +505,25 @@ extern "C" { buffer->used = buffer_position.stop + 2; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= object.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_basic_list_object_write_ #ifndef _di_fl_fss_basic_list_content_write_ f_return_status fl_fss_basic_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; - bool is_comment = f_false; - bool has_graph = f_false; + f_status status = F_none; + bool is_comment = F_false; + bool has_graph = F_false; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -532,10 +532,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(content, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= content.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -546,7 +546,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -559,14 +559,14 @@ extern "C" { buffer->string[buffer_position.stop] = content.string[location->start]; buffer_position.stop++; - has_graph = f_true; + has_graph = F_true; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -578,7 +578,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; slash_count++; } // while @@ -587,17 +587,17 @@ extern "C" { f_string_length start = location->start; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == f_true) { + if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (content.string[location->start] == f_string_eol || location->start >= content.used || location->start > location->stop) { @@ -606,7 +606,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (slash_count > 0) { @@ -617,8 +617,8 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } buffer->string[buffer_position.stop] = f_fss_basic_list_open; @@ -630,20 +630,20 @@ extern "C" { else if (content.string[location->start] == f_fss_basic_list_open && !is_comment) { f_string_length start = location->start; - has_graph = f_true; + has_graph = F_true; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == f_true) { + if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (content.string[location->start] == f_string_eol || location->start >= content.used || location->start > location->stop) { @@ -652,13 +652,13 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } buffer->string[buffer_position.stop] = f_fss_basic_list_open; @@ -667,24 +667,24 @@ extern "C" { continue; } else if (content.string[location->start] == f_fss_comment && !has_graph) { - is_comment = f_true; + is_comment = F_true; } else if (content.string[location->start] == f_string_eol) { - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } - else if ((status = fl_fss_is_graph(content, *location)) == f_true) { - has_graph = f_true; + else if ((status = fl_fss_is_graph(content, *location)) == F_true) { + has_graph = F_true; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -696,20 +696,20 @@ extern "C" { } status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = f_string_eol; buffer->used = buffer_position.stop + 1; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= content.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_basic_list_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 3687321..cf4d12b 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -50,18 +50,18 @@ extern "C" { * A set of all locations where a valid object was found. * * @return - * fl_fss_found_object on success and object was found (start location is at end of object). - * fl_fss_found_no_object on success and no object was found (start location is after character designating this is not an object). - * f_none_on_stop on success after reaching stopping point (a valid object is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no objects found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_object on success and object was found (start location is at end of object). + * FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object). + * F_none_stop on success after reaching stopping point (a valid object is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no objects found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_object_read_ extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -85,18 +85,18 @@ extern "C" { * A set of all locations where a valid content was found. * * @return - * fl_fss_found_content on success and content was found (start location is at end of content). - * fl_fss_found_no_content on success and no content was found (start location is after character designating this is not a content). - * f_none_on_stop on success after reaching stopping point (a valid content is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no content found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_content on success and content was found (start location is at end of content). + * FL_fss_found_content_not on success and no content was found (start location is after character designating this is not a content). + * F_none_stop on success after reaching stopping point (a valid content is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no content found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_content_read_ extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -118,16 +118,16 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_object_write_ extern f_return_status fl_fss_basic_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -148,15 +148,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_basic_list_content_write_ extern f_return_status fl_fss_basic_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 6593be7..4ff5d68 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -7,46 +7,46 @@ extern "C" { #ifndef _di_fl_fss_extended_object_read_ f_return_status fl_fss_extended_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_extended_close) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // when handling delimits, the only time they should be applied is when a valid object would exist // however, the delimits will appear before a valid object, so remember their positions and only apply them after a would be valid object is confirmed - bool has_delimit = f_false; + bool has_delimit = F_false; // begin the search found->start = location->start; // ignore all comment lines if (buffer->string[location->start] == f_fss_comment) { - fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // handle quote support @@ -57,32 +57,32 @@ extern "C" { f_string_length last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { found->stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -94,16 +94,16 @@ extern "C" { last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -113,46 +113,46 @@ extern "C" { delimits.used++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->start = location->start; } // identify where the object ends if (quoted == 0) { - status = f_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + status = F_none; + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { found->stop = location->start - 1; fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); if (buffer->string[location->start] == f_string_eol) { location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } } @@ -163,12 +163,12 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -179,10 +179,10 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) if (buffer->string[location->start] == quoted) { f_string_length length = location->start; @@ -192,7 +192,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -210,36 +210,36 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length + 1; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) - if ((status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -249,7 +249,7 @@ extern "C" { found->stop = length - 1; location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -257,15 +257,15 @@ extern "C" { found->stop = length - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } else { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -282,7 +282,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length; @@ -293,105 +293,105 @@ extern "C" { found->stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_string_eol) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); location->start++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else if (buffer->string[location->start] == f_string_eol) { location->start++; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) } // seek to the end of the line when no valid object is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } #endif // _di_fl_fss_extended_object_read_ #ifndef _di_fl_fss_extended_content_read_ f_return_status fl_fss_extended_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_extended_close) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_content; + return FL_fss_found_content_not; } - bool has_delimit = f_false; + bool has_delimit = F_false; int8_t quoted = 0; - bool continue_main_loop = f_false; + bool continue_main_loop = F_false; f_string_length length = 0; f_array_length already_used = found->used; @@ -402,7 +402,7 @@ extern "C" { if (found->used >= found->size) { f_macro_fss_content_resize(status, (*found), found->size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; @@ -418,42 +418,42 @@ extern "C" { f_string_length last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { found->array[found->used].stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->used++; if (buffer->string[location->start] == f_string_eol) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); - return fl_fss_found_content; + return FL_fss_found_content; } - continue_main_loop = f_true; + continue_main_loop = F_true; break; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -465,21 +465,21 @@ extern "C" { last_slash = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (continue_main_loop) { - continue_main_loop = f_false; + continue_main_loop = F_false; continue; } - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { if (delimits.used >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -489,31 +489,31 @@ extern "C" { delimits.used++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->array[found->used].start = location->start; } // identify where the content ends if (quoted == 0) { - status = f_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + status = F_none; + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { found->array[found->used].stop = location->start - 1; found->used++; @@ -521,15 +521,15 @@ extern "C" { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); location->start++; - return fl_fss_found_content; + return FL_fss_found_content; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } } @@ -540,12 +540,12 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -556,10 +556,10 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) if (buffer->string[location->start] == quoted) { length = location->start; @@ -569,7 +569,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -586,36 +586,36 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length + 1; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) - if ((status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_status_is_warning(f_unterminated_group); + return F_status_is_warning(F_unterminated_group); } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -627,13 +627,13 @@ extern "C" { location->start++; found->used++; - return fl_fss_found_content; + return FL_fss_found_content; } found->array[found->used].stop = length - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->used++; continue; @@ -642,7 +642,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -659,7 +659,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while location->start = length; @@ -669,7 +669,7 @@ extern "C" { else if (buffer->string[location->start] == quoted) { found->array[found->used].stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { @@ -678,48 +678,48 @@ extern "C" { location->start++; found->used++; - return fl_fss_found_content; + return FL_fss_found_content; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->used++; - continue_main_loop = f_true; + continue_main_loop = F_true; break; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_status_is_warning(f_unterminated_group); + return F_status_is_warning(F_unterminated_group); } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (continue_main_loop) { break; } - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) } else if (buffer->string[location->start] == f_string_eol) { if (found->used == already_used) { location->start++; - return fl_fss_found_no_content; + return FL_fss_found_content_not; } else { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -727,63 +727,63 @@ extern "C" { found->array[found->used].stop = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; found->used++; - return fl_fss_found_content; + return FL_fss_found_content; } } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, f_status_is_warning(f_unterminated_group_on_eos), f_status_is_warning(f_unterminated_group_on_stop)) + fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) } if (continue_main_loop) { - continue_main_loop = f_false; + continue_main_loop = F_false; continue; } break; } // while - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) // seek to the end of the line when no valid content is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (found->used == already_used) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_content; + return FL_fss_found_content_not; } fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_content; + return FL_fss_found_content; } #endif // _di_fl_fss_extended_content_read_ #ifndef _di_fl_fss_extended_object_write_ f_return_status fl_fss_extended_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; - bool quoted = f_false; + f_status status = F_none; + bool quoted = F_false; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -792,10 +792,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(object, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= object.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -806,7 +806,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -816,7 +816,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } else if (object.string[location->start] != f_fss_delimit_slash) { @@ -827,7 +827,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (object.string[location->start] == f_fss_delimit_single_quote || object.string[location->start] == f_fss_delimit_double_quote) { @@ -836,7 +836,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -844,7 +844,7 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (object.string[location->start] == f_fss_delimit_single_quote || object.string[location->start] == f_fss_delimit_double_quote) { @@ -853,7 +853,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -861,16 +861,16 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else if (object.string[location->start] == f_fss_comment) { - quoted = f_true; + quoted = F_true; } while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -883,18 +883,18 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_basic_open; buffer->used = buffer_position.stop + 1; - return f_none_on_eol; + return F_none_eol; } - else if ((status = fl_fss_is_space(*buffer, *location)) == f_true || quoted) { + else if ((status = fl_fss_is_space(*buffer, *location)) == F_true || quoted) { f_string_length first_space = location->start; if (!quoted) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used && isspace(object.string[location->start])) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (location->start > location->stop || location->start >= object.used) { @@ -909,7 +909,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // restart the loop searching for f_fss_delimit_double_quote. @@ -922,7 +922,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -932,7 +932,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -947,7 +947,7 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; fl_macro_fss_skip_past_delimit_placeholders(object, (*location)); @@ -962,7 +962,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } break; @@ -971,7 +971,7 @@ extern "C" { slash_count = 0; break; } - } while (f_true); + } while (F_true); while (slash_count > 0) { buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -988,13 +988,13 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_basic_open; buffer->used = buffer_position.stop + 1; - return f_none_on_eol; + return F_none_eol; } buffer->string[buffer_position.stop] = object.string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; buffer_position.stop++; } // while @@ -1004,14 +1004,14 @@ extern "C" { buffer->used = buffer_position.stop + 2; break; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } buffer->string[buffer_position.stop] = object.string[location->start]; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; buffer_position.stop++; } // while @@ -1022,23 +1022,23 @@ extern "C" { } if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= object.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_extended_object_write_ #ifndef _di_fl_fss_extended_content_write_ f_return_status fl_fss_extended_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; int8_t quoted = 0; f_string_range buffer_position = f_string_range_initialize; @@ -1054,16 +1054,16 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } fl_macro_fss_skip_past_delimit_placeholders(content, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= content.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -1074,12 +1074,12 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -1092,18 +1092,18 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (location->start > location->stop) { buffer->string[buffer_position.stop] = ' '; buffer->used = buffer_position.stop + 1; - return f_none_on_stop; + return F_none_stop; } else if (location->start >= content.used) { buffer->string[buffer_position.stop] = ' '; buffer->used = buffer_position.stop + 1; - return f_none_on_eos; + return F_none_eos; } if (content.string[location->start] == f_fss_delimit_single_quote || content.string[location->start] == f_fss_delimit_double_quote) { @@ -1112,7 +1112,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -1120,7 +1120,7 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } } else if (content.string[location->start] == f_fss_delimit_single_quote || content.string[location->start] == f_fss_delimit_double_quote) { @@ -1129,7 +1129,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -1137,17 +1137,17 @@ extern "C" { buffer_position.stop += 2; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_string_eol) { buffer->string[buffer_position.stop] = ' '; buffer->used = buffer_position.stop + 1; - return f_none_on_eol; + return F_none_eol; } - if (content.string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == f_true) { + if (content.string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_true) { quoted = f_fss_delimit_double_quote; pre_allocate_size += 2; @@ -1155,7 +1155,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } location->start = start_position; @@ -1164,7 +1164,7 @@ extern "C" { buffer_position.stop++; break; } - else if (f_status_is_error(status)) { + else if (F_status_is_error(status)) { return status; } @@ -1172,7 +1172,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (quoted != 0) { @@ -1184,12 +1184,12 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -1203,7 +1203,7 @@ extern "C" { slash_count++; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (content.string[location->start] == quoted || location->start > location->stop || location->start >= content.used) { @@ -1212,7 +1212,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (slash_count > 0) { @@ -1240,7 +1240,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; @@ -1251,7 +1251,7 @@ extern "C" { buffer->string[buffer_position.stop] = quoted; buffer->string[buffer_position.stop + 1] = ' '; buffer->used = buffer_position.stop + 2; - return f_none_on_eol; + return F_none_eol; } else if (content.string[location->start] != f_fss_delimit_placeholder) { buffer->string[buffer_position.stop] = content.string[location->start]; @@ -1259,7 +1259,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = quoted; @@ -1270,13 +1270,13 @@ extern "C" { buffer->used = buffer_position.stop + 1; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= content.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_extended_content_write_ diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index 9dd46cf..3017981 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -49,18 +49,18 @@ extern "C" { * A set of all locations where a valid object was found. * * @return - * fl_fss_found_object on success and object was found (start location is at end of object). - * fl_fss_found_no_object on success and no object was found (start location is after character designating this is not an object). - * f_none_on_stop on success after reaching stopping point (a valid object is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no objects found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_object on success and object was found (start location is at end of object). + * FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object). + * F_none_stop on success after reaching stopping point (a valid object is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no objects found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_object_read_ extern f_return_status fl_fss_extended_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -84,18 +84,18 @@ extern "C" { * A set of all locations where a valid content was found. * * @return - * fl_fss_found_content on success and content was found (start location is at end of content). - * fl_fss_found_no_content on success and no content was found (start location is after character designating this is not a content). - * f_none_on_stop on success after reaching stopping point (a valid content is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no content found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_content on success and content was found (start location is at end of content). + * FL_fss_found_content_not on success and no content was found (start location is after character designating this is not a content). + * F_none_stop on success after reaching stopping point (a valid content is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid content is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no content found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_content_read_ extern f_return_status fl_fss_extended_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -117,15 +117,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_object_write_ extern f_return_status fl_fss_extended_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -146,15 +146,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_content_write_ extern f_return_status fl_fss_extended_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index ed8c62f..930865a 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -7,29 +7,29 @@ extern "C" { #ifndef _di_fl_fss_extended_list_object_read_ f_return_status fl_fss_extended_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; fl_fss_skip_past_space(*buffer, location); - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) // return found nothing if this line only contains whitespace and delimit placeholders. if (buffer->string[location->start] == f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // begin the search. @@ -37,12 +37,12 @@ extern "C" { // ignore all comment lines. if (buffer->string[location->start] == f_fss_comment) { - fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } // identify where the object ends. @@ -52,7 +52,7 @@ extern "C" { f_string_length slash_count = 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { if (buffer->string[location->start] == f_fss_delimit_slash) { @@ -60,29 +60,29 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) if (buffer->string[location->start] == f_fss_extended_list_open) { f_string_length stop_point = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) if (buffer->string[location->start] == f_string_eol) { f_string_length start = location->start; @@ -92,7 +92,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -110,7 +110,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -118,11 +118,11 @@ extern "C" { found->stop = stop_point; location->start = start + 1; - return fl_fss_found_object; + return FL_fss_found_object; } location->start = start + 1; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } } @@ -132,20 +132,20 @@ extern "C" { f_string_length stop_point = location->start - 1; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == f_true) { + if (buffer->string[location->start] == f_string_eol || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, f_none_on_eos, f_none_on_stop) + fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (buffer->string[location->start] == f_string_eol) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -153,46 +153,46 @@ extern "C" { found->stop = stop_point; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_object; + return FL_fss_found_object; } continue; } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while // seek to the end of the line when no valid object is found. while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while - fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_no_eos, F_data_no_stop) status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return fl_fss_found_no_object; + return FL_fss_found_object_not; } #endif // _di_fl_fss_extended_list_object_read_ #ifndef _di_fl_fss_extended_list_content_read_ f_return_status fl_fss_extended_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_nest *found) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (found == 0) return f_status_set_error(f_invalid_parameter); - if (location->start < 0) return f_status_set_error(f_invalid_parameter); - if (location->stop < location->start) return f_status_set_error(f_invalid_parameter); - if (buffer->used <= 0) return f_status_set_error(f_invalid_parameter); - if (location->start >= buffer->used) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (found == 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (location->start >= buffer->used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; @@ -200,12 +200,12 @@ extern "C" { f_fss_objects objects = f_fss_objects_initialize; fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), positions_start, delimits, objects, f_none_on_eos, f_none_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), positions_start, delimits, objects, F_none_eos, F_none_stop) if (found->used + 1 >= found->size) { f_macro_fss_nest_resize(status, (*found), found->size + f_fss_default_allocation_step + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } @@ -217,14 +217,14 @@ extern "C" { f_string_length last_newline = location->start; f_macro_string_lengths_new(status, positions_start, f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); return status; } f_macro_fss_objects_new(status, objects, f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(positions_start); f_macro_string_lengths_delete_simple(delimits); @@ -243,10 +243,10 @@ extern "C" { location->start++; if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_none_on_eos, f_none_on_stop) + fl_macro_fss_nest_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_none_eos, F_none_stop) } line_start = location->start; @@ -260,7 +260,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -277,7 +277,7 @@ extern "C" { } status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -287,10 +287,10 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } // All slashes for an open are delimited (because it could represent a slash in the object name). @@ -306,10 +306,10 @@ extern "C" { } else if (buffer->string[location->start] == f_fss_extended_list_open || buffer->string[location->start] == f_fss_extended_list_close) { f_string_length before_list_open = position_previous; - bool is_open = f_false; + bool is_open = F_false; if (buffer->string[location->start] == f_fss_extended_list_open) { - is_open = f_true; + is_open = F_true; } position_previous = location->start; @@ -322,11 +322,11 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == f_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { break; } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -336,7 +336,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -346,10 +346,10 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } // this is a valid object open/close that has been delimited, save the slash delimit positions. @@ -358,10 +358,10 @@ extern "C" { line_start = location->start + 1; if (is_open) { - bool is_object = f_false; + bool is_object = F_false; if (slash_count % 2 == 0) { - is_object = f_true; + is_object = F_true; } location->start = slash_first; @@ -369,7 +369,7 @@ extern "C" { if (delimits.used + (slash_count / 2) >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + (slash_count / 2) + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { location->start = last_newline; f_macro_string_lengths_delete_simple(delimits); @@ -403,7 +403,7 @@ extern "C" { if (depth > positions_start.size) { f_macro_string_lengths_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { location->start = last_newline; f_macro_string_lengths_delete_simple(delimits); @@ -428,7 +428,7 @@ extern "C" { if (delimits.used + 1 >= delimits.size) { f_macro_string_lengths_resize(status, delimits, delimits.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { location->start = last_newline; f_macro_string_lengths_delete_simple(delimits); @@ -452,7 +452,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -466,11 +466,11 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == f_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { break; } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -480,7 +480,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -490,10 +490,10 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } if (buffer->string[location->start] == f_string_eol) { @@ -502,7 +502,7 @@ extern "C" { if (depth >= positions_start.size) { f_macro_string_lengths_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -512,7 +512,7 @@ extern "C" { f_macro_fss_objects_resize(status, objects, objects.size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -544,7 +544,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -554,10 +554,10 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } } } @@ -565,7 +565,7 @@ extern "C" { while (location->start < buffer->used && location->start <= location->stop) { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -577,11 +577,11 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == f_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { break; } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -591,17 +591,17 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } if (buffer->string[location->start] == f_string_eol) { if (depth + 1 >= found->size) { f_macro_fss_nest_resize(status, (*found), found->size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -613,7 +613,7 @@ extern "C" { if (found->depth[depth].used >= found->depth[depth].size) { f_macro_fss_items_resize(status, found->depth[depth], found->depth[depth].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -627,7 +627,7 @@ extern "C" { if (found->depth[depth].array[position].content.size != 1) { f_macro_fss_content_resize(status, found->depth[depth].array[position].content, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -659,7 +659,7 @@ extern "C" { if (depth == 0) { status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -668,13 +668,13 @@ extern "C" { } fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); - fl_macro_fss_nest_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_none_on_eos, f_none_on_stop) + fl_macro_fss_nest_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_none_eos, F_none_stop) f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); - return fl_fss_found_content; + return FL_fss_found_content; } depth--; @@ -690,7 +690,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -700,17 +700,17 @@ extern "C" { } // while if (depth > 0) { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_unterminated_nest_on_eos, f_unterminated_nest_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_unterminated_nest_eos, F_unterminated_nest_stop) } else { - fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, f_no_data_on_eos, f_no_data_on_stop) + fl_macro_fss_nest_return_on_overflow((*buffer), (*location), (*found), delimits, positions_start, objects, F_data_no_eos, F_data_no_stop) } } } else if (buffer->string[location->start] != f_string_eol) { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -727,7 +727,7 @@ extern "C" { position_previous = location->start; status = fl_fss_increment_buffer(*buffer, location, 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); f_macro_fss_objects_delete_simple(objects); @@ -742,27 +742,27 @@ extern "C" { if (location->start > location->stop) { if (depth == 0) { - return f_status_set_error(f_unterminated_on_stop); + return F_status_set_error(F_unterminated_stop); } - return f_status_set_error(f_unterminated_nest_on_stop); + return F_status_set_error(F_unterminated_nest_stop); } if (depth == 0) { - return f_status_set_error(f_unterminated_on_eos); + return F_status_set_error(F_unterminated_eos); } - return f_status_set_error(f_unterminated_nest_on_eos); + return F_status_set_error(F_unterminated_nest_eos); } #endif // _di_fl_fss_extended_list_content_read_ #ifndef _di_fl_fss_extended_list_object_write_ f_return_status fl_fss_extended_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -772,10 +772,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(object, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= object.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -786,7 +786,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -795,20 +795,20 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_comment) { // comments are not allowed and this format has no way of "wrapping" a comment. - return f_status_set_error(fl_fss_found_comment); + return F_status_set_error(FL_fss_found_comment); } - else if ((status = fl_fss_is_graph(object, *location)) == f_true) { + else if ((status = fl_fss_is_graph(object, *location)) == F_true) { break; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -820,7 +820,7 @@ extern "C" { } status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while while (location->start <= location->stop && location->start < object.used) { @@ -831,12 +831,12 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } else if (object.string[location->start] != f_fss_delimit_slash) { @@ -847,7 +847,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; slash_count++; } // while @@ -858,7 +858,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (slash_count > 0) { @@ -872,7 +872,7 @@ extern "C" { } else if (object.string[location->start] == f_string_eol) { if (buffer_position.stop == buffer_position.start) { - return f_no_data_on_eol; + return F_data_no_eol; } break; @@ -884,7 +884,7 @@ extern "C" { } status = fl_fss_increment_buffer(object, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = f_fss_extended_list_open; @@ -892,27 +892,27 @@ extern "C" { buffer->used = buffer_position.stop + 2; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= object.used) { - return f_none_on_eos; + return F_none_eos; } - return f_none; + return F_none; } #endif // _di_fl_fss_extended_list_object_write_ #ifndef _di_fl_fss_extended_list_content_write_ f_return_status fl_fss_extended_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ // @todo /* - f_status status = f_none; - bool is_comment = f_false; - bool has_graph = f_false; + f_status status = F_none; + bool is_comment = F_false; + bool has_graph = F_false; f_string_range buffer_position = f_string_range_initialize; f_string_length start_position = f_string_initialize; @@ -921,10 +921,10 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders(content, (*location)) if (location->start > location->stop) { - return f_no_data_on_stop; + return F_data_no_stop; } else if (location->start >= content.used) { - return f_no_data_on_eos; + return F_data_no_eos; } start_position = location->start; @@ -935,7 +935,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer_position.start = buffer->used; @@ -948,14 +948,14 @@ extern "C" { buffer->string[buffer_position.stop] = content.string[location->start]; buffer_position.stop++; - has_graph = f_true; + has_graph = F_true; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; continue; } @@ -967,7 +967,7 @@ extern "C" { buffer_position.stop++; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; slash_count++; } // while @@ -976,17 +976,17 @@ extern "C" { f_string_length start = location->start; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == f_true) { + if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (content.string[location->start] == f_string_eol || location->start >= content.used || location->start > location->stop) { @@ -995,7 +995,7 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } while (slash_count > 0) { @@ -1006,8 +1006,8 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } buffer->string[buffer_position.stop] = f_fss_extended_list_open; @@ -1019,20 +1019,20 @@ extern "C" { else if (content.string[location->start] == f_fss_extended_list_open && !is_comment) { f_string_length start = location->start; - has_graph = f_true; + has_graph = F_true; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == f_true) { + if (content.string[location->start] == f_string_eol || (status = fl_fss_is_graph(content, *location)) == F_true) { break; } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while if (content.string[location->start] == f_string_eol || location->start >= content.used || location->start > location->stop) { @@ -1041,13 +1041,13 @@ extern "C" { if (pre_allocate_size > buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), pre_allocate_size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } buffer->string[buffer_position.stop] = f_fss_extended_list_open; @@ -1056,24 +1056,24 @@ extern "C" { continue; } else if (content.string[location->start] == f_fss_comment && !has_graph) { - is_comment = f_true; + is_comment = F_true; } else if (content.string[location->start] == f_string_eol) { - has_graph = f_false; - is_comment = f_false; + has_graph = F_false; + is_comment = F_false; } - else if ((status = fl_fss_is_graph(content, *location)) == f_true) { - has_graph = f_true; + else if ((status = fl_fss_is_graph(content, *location)) == F_true) { + has_graph = F_true; } - else if (f_status_is_error(status)) { - f_status status2 = f_status_set_fine(status); + else if (F_status_is_error(status)) { + f_status status2 = F_status_set_fine(status); - if (status2 == f_failure) { - return f_status_set_error(f_invalid_utf); + if (status2 == F_failure) { + return F_status_set_error(F_utf); } - if (status2 == f_failure) { - return f_status_set_error(f_incomplete_utf); + if (status2 == F_failure) { + return F_status_set_error(F_incomplete_utf); } return status; @@ -1085,21 +1085,21 @@ extern "C" { } status = fl_fss_increment_buffer(content, location, 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // while buffer->string[buffer_position.stop] = f_string_eol; buffer->used = buffer_position.stop + 1; if (location->start > location->stop) { - return f_none_on_stop; + return F_none_stop; } else if (location->start >= content.used) { - return f_none_on_eos; + return F_none_eos; } */ - return f_none; + return F_none; } #endif // _di_fl_fss_extended_list_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 bef89aa..5e5f701 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -50,18 +50,18 @@ extern "C" { * A set of all locations where a valid object was found. * * @return - * fl_fss_found_object on success and object was found (start location is at end of object). - * fl_fss_found_no_object on success and no object was found (start location is after character designating this is not an object). - * f_none_on_stop on success after reaching stopping point (a valid object is not yet confirmed). - * f_none_on_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). - * f_no_data_on_stop no data found after reaching stopping point (essentially only comments are found). - * f_no_data_on_eos no objects found after reaching the end of the buffer (essentially only comments are found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_object on success and object was found (start location is at end of object). + * FL_fss_found_object_not on success and no object was found (start location is after character designating this is not an object). + * F_none_stop on success after reaching stopping point (a valid object is not yet confirmed). + * F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed). + * F_data_no_stop no data found after reaching stopping point (essentially only comments are found). + * F_data_no_eos no objects found after reaching the end of the buffer (essentially only comments are found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_object_read_ extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -89,18 +89,18 @@ extern "C" { * A set of all locations where a valid content was found. * * @return - * fl_fss_found_content on success and content was found (start location is at end of content). - * fl_fss_found_no_content on success and no content was found (start location is after character designating this is not a content). - * f_unterminated_on_eos (with error bit) if end of buffer is reached before a closing bracket is found. - * f_unterminated_on_stop (with error bit) if stop location is reached before a closing bracket is found. - * f_unterminated_nest_on_eos (with error bit) if end of buffer is reached while inside a nested list before a closing bracket is found. - * f_unterminated_nest_on_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found. - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * FL_fss_found_content on success and content was found (start location is at end of content). + * FL_fss_found_content_not on success and no content was found (start location is after character designating this is not a content). + * F_unterminated_eos (with error bit) if end of buffer is reached before a closing bracket is found. + * F_unterminated_stop (with error bit) if stop location is reached before a closing bracket is found. + * F_unterminated_nest_eos (with error bit) if end of buffer is reached while inside a nested list before a closing bracket is found. + * F_unterminated_nest_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_content_read_ extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_nest *found); @@ -122,16 +122,16 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_object_write_ extern f_return_status fl_fss_extended_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -152,15 +152,15 @@ extern "C" { * This will be auto-incremented and must not be a static string. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_fss_extended_list_content_write_ extern f_return_status fl_fss_extended_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/fss_macro.h b/level_1/fl_fss/c/fss_macro.h index 16a4f60..5486e25 100644 --- a/level_1/fl_fss/c/fss_macro.h +++ b/level_1/fl_fss/c/fss_macro.h @@ -18,7 +18,7 @@ extern "C" { #ifndef _di_fl_macro_fss_apply_delimit_placeholders_ #define fl_macro_fss_apply_delimit_placeholders(buffer, delimits) \ { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ \ f_string_length i = 0; \ \ @@ -44,14 +44,14 @@ extern "C" { #ifndef _di_fl_macro_fss_object_return_on_overflow_ #define fl_macro_fss_object_return_on_overflow(buffer, location, found, delimits, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.stop = buffer.used - 1; \ return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.stop = location.stop; \ @@ -62,7 +62,7 @@ extern "C" { #ifndef _di_fl_macro_fss_object_delimited_return_on_overflow_ #define fl_macro_fss_object_delimited_return_on_overflow(buffer, location, found, delimits, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -75,7 +75,7 @@ extern "C" { return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -92,14 +92,14 @@ extern "C" { #ifndef _di_fl_macro_fss_content_return_on_overflow_ #define fl_macro_fss_content_return_on_overflow(buffer, location, found, delimits, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.array[found.used].stop = buffer.used - 1; \ return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.array[found.used].stop = location.stop; \ @@ -110,7 +110,7 @@ extern "C" { #ifndef _di_fl_macro_fss_content_delimited_return_on_overflow_ #define fl_macro_fss_content_delimited_return_on_overflow(buffer, location, found, delimits, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -123,7 +123,7 @@ extern "C" { return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -140,11 +140,11 @@ extern "C" { #ifndef _di_fl_macro_fss_allocate_content_if_necessary_ #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \ if (content.used >= content.size) { \ - f_status status = f_none; \ + f_status status = F_none; \ \ f_macro_fss_content_resize(status, content, content.size + f_fss_default_allocation_step); \ - if (f_status_is_error(status)) { \ - f_status macro_allocation_status = f_none; \ + if (F_status_is_error(status)) { \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ return status; \ @@ -155,7 +155,7 @@ extern "C" { #ifndef _di_fl_macro_fss_nest_return_on_overflow_ #define fl_macro_fss_nest_return_on_overflow(buffer, location, found, delimits, positions, objects, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ f_macro_string_lengths_delete(macro_allocation_status, positions); \ f_macro_fss_objects_delete(macro_allocation_status, objects); \ @@ -164,7 +164,7 @@ extern "C" { return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ f_macro_string_lengths_delete(macro_allocation_status, positions); \ f_macro_fss_objects_delete(macro_allocation_status, objects); \ @@ -177,7 +177,7 @@ extern "C" { #ifndef _di_fl_macro_fss_nest_delimited_return_on_overflow_ #define fl_macro_fss_nest_delimited_return_on_overflow(buffer, location, found, delimits, positions, objects, eos_status, stop_status) \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -191,7 +191,7 @@ extern "C" { return eos_status; \ } \ else if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -212,13 +212,13 @@ extern "C" { while (buffer.string[location.start] != f_string_eol) { \ location.start++; \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ return eos_status; \ } \ if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ return stop_status; \ @@ -231,7 +231,7 @@ extern "C" { while (buffer.string[location.start] != f_string_eol) { \ location.start++; \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -243,7 +243,7 @@ extern "C" { return eos_status; \ } \ if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -262,14 +262,14 @@ extern "C" { while (buffer.string[location.start] != f_string_eol) { \ location.start++; \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.array[found.used].stop = location.stop; \ return eos_status; \ } \ if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_macro_string_lengths_delete(macro_allocation_status, delimits); \ \ found.array[found.used].stop = location.stop; \ @@ -283,7 +283,7 @@ extern "C" { while (buffer.string[location.start] != f_string_eol) { \ location.start++; \ if (location.start >= buffer.used) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ @@ -296,7 +296,7 @@ extern "C" { return eos_status; \ } \ if (location.start > location.stop) { \ - f_status macro_allocation_status = f_none; \ + f_status macro_allocation_status = F_none; \ f_string_length i = 0; \ \ while (i < delimits.used) { \ diff --git a/level_1/fl_fss/c/fss_status.h b/level_1/fl_fss/c/fss_status.h index e90ca2b..14fe54a 100644 --- a/level_1/fl_fss/c/fss_status.h +++ b/level_1/fl_fss/c/fss_status.h @@ -20,33 +20,33 @@ extern "C" { #endif enum { - fl_fss_status_code_first = f_status_code_last + 1, - - #ifndef _di_fl_fss_status_error_ - fl_fss_invalid_format, - fl_fss_invalid_format_eos, - #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_no_header_eos, - #endif // _di_fl_fss_status_warning_ - - #ifndef _di_fl_fss_status_success_ - fl_fss_found_content, - fl_fss_found_object, - fl_fss_found_object_no_content, - fl_fss_found_no_content, - fl_fss_found_no_object, - #endif // _di_fl_fss_status_success_ - - #ifndef _di_fl_fss_status_codes_ - fl_fss_found_comment, - #endif // _di_fl_fss_status_codes_ - - fl_fss_status_code_last, + FL_fss_status_code_first = F_status_code_last + 1, + + #ifndef _di_FL_fss_status_error_ + FL_fss_format, + FL_fss_format_eos, + #endif // _di_FL_fss_status_error_ + + #ifndef _di_FL_fss_status_warning_ + FL_fss_accepted_invalid, + FL_fss_accepted_invalid_eos, + FL_fss_header_not, + FL_fss_header_not_eos, + #endif // _di_FL_fss_status_warning_ + + #ifndef _di_FL_fss_status_success_ + FL_fss_found_content, + FL_fss_found_object, + FL_fss_found_object_content_not, + FL_fss_found_content_not, + FL_fss_found_object_not, + #endif // _di_FL_fss_status_success_ + + #ifndef _di_FL_fss_status_codes_ + FL_fss_found_comment, + #endif // _di_FL_fss_status_codes_ + + FL_fss_status_code_last, }; // enum #ifdef __cplusplus diff --git a/level_1/fl_print/c/print.c b/level_1/fl_print/c/print.c index a332681..2768363 100644 --- a/level_1/fl_print/c/print.c +++ b/level_1/fl_print/c/print.c @@ -7,27 +7,27 @@ extern "C" { #ifndef _di_fl_print_trim_string_ f_return_status fl_print_trim_string(FILE *output, const f_string string, const f_string_length length) { #ifndef _di_level_1_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (length < 1) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (length < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = 0; - f_status status = f_none; + f_status status = F_none; uint8_t width_max = 0; for (; i < length; i += f_macro_utf_byte_width(string[i])) { width_max = (length - i) + 1; status = f_utf_is_whitespace(string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; i < length; i += f_macro_utf_byte_width(string[i])) { @@ -36,40 +36,40 @@ extern "C" { width_max = (length - i) + 1; status = f_utf_is_whitespace(string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + f_macro_utf_byte_width(string[i]); if (j == length) { - return f_none; + return F_none; } for (; j < length; j += f_macro_utf_byte_width(string[j])) { width_max = (length - j) + 1; status = f_utf_is_whitespace(string + j, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i < j; i++) { if (string[i] == 0) continue; if (fputc(string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for @@ -77,43 +77,43 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } if (fputc(string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_string_ #ifndef _di_fl_print_trim_string_dynamic_ f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = 0; - f_status status = f_none; + f_status status = F_none; uint8_t width_max = 0; for (; i < buffer.used; i += f_macro_utf_byte_width(buffer.string[i])) { width_max = (buffer.used - i) + 1; status = f_utf_is_whitespace(buffer.string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; i < buffer.used; i += f_macro_utf_byte_width(buffer.string[i])) { @@ -122,40 +122,40 @@ extern "C" { width_max = (buffer.used - i) + 1; status = f_utf_is_whitespace(buffer.string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + f_macro_utf_byte_width(buffer.string[i]); if (j == buffer.used) { - return f_none; + return F_none; } for (; j < buffer.used; j += f_macro_utf_byte_width(buffer.string[j])) { width_max = (buffer.used - j) + 1; status = f_utf_is_whitespace(buffer.string + j, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i < j; i++) { if (buffer.string[i] == 0) continue; if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for @@ -163,32 +163,32 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_string_dynamic_ #ifndef _di_fl_print_trim_string_dynamic_partial_ f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range) { #ifndef _di_level_1_parameter_checking_ - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); - if (range.stop >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); + if (range.stop >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = range.start; - f_status status = f_none; + f_status status = F_none; uint8_t width_max = 0; @@ -196,15 +196,15 @@ extern "C" { width_max = (range.stop - i) + 1; status = f_utf_is_whitespace(buffer.string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (uint8_t width_i = f_macro_utf_byte_width(buffer.string[i]); i <= range.stop; i += width_i) { @@ -217,19 +217,19 @@ extern "C" { width_max = (range.stop - i) + 1; status = f_utf_is_whitespace(buffer.string + i, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + width_i; if (j == range.stop) { - return f_none; + return F_none; } for (uint8_t width_j = f_macro_utf_byte_width(buffer.string[j]); j <= range.stop; j += width_j) { @@ -237,16 +237,16 @@ extern "C" { width_max = (range.stop - j) + 1; status = f_utf_is_whitespace(buffer.string + j, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i <= j; i += width_i) { if (buffer.string[i] == 0) { width_i = 1; @@ -257,7 +257,7 @@ extern "C" { for (uint8_t k = 0; k < width_i; k++) { if (fputc(buffer.string[i + k], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for } // for @@ -266,44 +266,44 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } for (uint8_t k = 0; k < width_i; k++) { if (fputc(buffer.string[i + k], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_string_dynamic_partial_ #ifndef _di_fl_print_trim_utf_string_ f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string string, const f_utf_string_length length) { #ifndef _di_level_1_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); - if (length < 1) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); + if (length < 1) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = 0; - f_status status = f_none; + f_status status = F_none; for (; i < length; i++) { status = f_utf_character_is_whitespace(string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; i < length; i++) { @@ -311,39 +311,39 @@ extern "C" { status = f_utf_character_is_whitespace(string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + 1; if (j == length) { - return f_none; + return F_none; } for (; j < length; j++) { status = f_utf_character_is_whitespace(string[j]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i < j; i++) { if (string[i] == 0) continue; if (fputc(string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for @@ -351,41 +351,41 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } if (fputc(string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_utf_string_ #ifndef _di_fl_print_trim_utf_string_dynamic_ f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static buffer) { #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_utf_string_length i = 0; - f_status status = f_none; + f_status status = F_none; for (; i < buffer.used; i++) { status = f_utf_character_is_whitespace(buffer.string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; i < buffer.used; i++) { @@ -393,39 +393,39 @@ extern "C" { status = f_utf_character_is_whitespace(buffer.string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + 1; if (j == buffer.used) { - return f_none; + return F_none; } for (; j < buffer.used; j++) { status = f_utf_character_is_whitespace(buffer.string[j]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i < j; i++) { if (buffer.string[i] == 0) continue; if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for @@ -433,45 +433,45 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_utf_string_dynamic_ #ifndef _di_fl_print_trim_utf_string_dynamic_partial_ f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static buffer, const f_utf_string_range range) { #ifndef _di_level_1_parameter_checking_ - if (range.start < 0) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= 0) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); - if (range.stop >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); + if (range.stop >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ register f_string_length i = range.start; - f_status status = f_none; + f_status status = F_none; for (; i <= range.stop; i++) { status = f_utf_character_is_whitespace(buffer.string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; i <= range.stop; i++) { @@ -479,39 +479,39 @@ extern "C" { status = f_utf_character_is_whitespace(buffer.string[i]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_true) { + if (status == F_true) { f_string_length j = i + 1; if (j == range.stop) { - return f_none; + return F_none; } for (; j <= range.stop; j++) { status = f_utf_character_is_whitespace(buffer.string[j]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } // all whitespaces found so far must be printed when a non-whitespace is found. - if (status == f_false) { + if (status == F_false) { for (; i <= j; i++) { if (buffer.string[i] == 0) continue; if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for @@ -519,17 +519,17 @@ extern "C" { } } // for - if (status == f_true) { + if (status == F_true) { break; } } if (fputc(buffer.string[i], output) == 0) { - return f_status_set_error(f_error_output); + return F_status_set_error(F_output); } } // for - return f_none; + return F_none; } #endif // _di_fl_print_trim_utf_string_dynamic_partial_ diff --git a/level_1/fl_print/c/print.h b/level_1/fl_print/c/print.h index 54c9519..d869979 100644 --- a/level_1/fl_print/c/print.h +++ b/level_1/fl_print/c/print.h @@ -39,11 +39,11 @@ extern "C" { * The total number of characters to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_string_ extern f_return_status fl_print_trim_string(FILE *output, const f_string string, const f_string_length length); @@ -64,11 +64,11 @@ extern "C" { * The string to output. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_string_dynamic_ extern f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static buffer); @@ -91,11 +91,11 @@ extern "C" { * The range within the provided string to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_string_dynamic_partial_ extern f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static buffer, const f_string_range range); @@ -117,11 +117,11 @@ extern "C" { * The total number of characters to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_utf_string_ extern f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string string, const f_utf_string_length length); @@ -142,11 +142,11 @@ extern "C" { * The string to output. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_utf_string_dynamic_ extern f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static buffer); @@ -169,11 +169,11 @@ extern "C" { * The range within the provided string to print. * * @return - * f_none on success. - * f_error_output (with error bit) on failure. - * 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. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_none on success. + * F_output (with error bit) on failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. */ #ifndef _di_fl_print_trim_utf_string_dynamic_partial_ extern f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static buffer, const f_utf_string_range range); diff --git a/level_1/fl_serialized/c/private-serialized.c b/level_1/fl_serialized/c/private-serialized.c index 47e7e92..a455f10 100644 --- a/level_1/fl_serialized/c/private-serialized.c +++ b/level_1/fl_serialized/c/private-serialized.c @@ -7,7 +7,7 @@ extern "C" { #if !defined(_di_fl_unserialize_simple_find_) || !defined(_di_fl_unserialize_simple_get_) f_return_status private_fl_unserialize_simple_find(const f_string_static serialized, const f_array_length index, f_string_range *location) { - f_status status = f_none; + f_status status = F_none; f_array_length i = 0; f_array_length start = 0; @@ -30,7 +30,7 @@ extern "C" { location->stop = i - 1; } - return f_none; + return F_none; } start = i + width; @@ -42,17 +42,17 @@ extern "C" { location->stop = i - 1; } - return f_none_on_eos; + return F_none_eos; } if (i + width > serialized.used) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } i += width; } // while - return f_no_data_on_eos; + return F_data_no_eos; } #endif // !defined(_di_fl_unserialize_simple_find_) || !defined(_di_fl_unserialize_simple_get_) diff --git a/level_1/fl_serialized/c/private-serialized.h b/level_1/fl_serialized/c/private-serialized.h index a6892fa..98014ae 100644 --- a/level_1/fl_serialized/c/private-serialized.h +++ b/level_1/fl_serialized/c/private-serialized.h @@ -28,11 +28,11 @@ extern "C" { * A location within the serialized string representing the string at the given index. * * @return - * f_none on success. - * f_none_on_eos on success at end of string. - * f_no_data_on_eos if end of string reached before index was reached. - * 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_none on success. + * F_none_eos on success at end of string. + * F_data_no_eos if end of string reached before index was reached. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. */ #if !defined(_di_fl_unserialize_simple_find_) || !defined(_di_fl_unserialize_simple_get_) extern f_return_status private_fl_unserialize_simple_find(const f_string_static serialized, const f_array_length index, f_string_range *location) f_gcc_attribute_visibility_internal; diff --git a/level_1/fl_serialized/c/serialized.c b/level_1/fl_serialized/c/serialized.c index 37965c4..f48ced9 100644 --- a/level_1/fl_serialized/c/serialized.c +++ b/level_1/fl_serialized/c/serialized.c @@ -8,15 +8,15 @@ extern "C" { #ifndef _di_fl_serialize_simple_ f_return_status fl_serialize_simple(const f_string_static value, f_string_dynamic *serialized) { #ifndef _di_level_0_parameter_checking_ - if (serialized == 0) return f_status_set_error(f_invalid_parameter); + if (serialized == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; if (serialized->used + value.used + 1 >= serialized->size) { f_macro_string_dynamic_resize(status, (*serialized), serialized->size + value.used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } if (serialized->used == 0) { @@ -29,18 +29,18 @@ extern "C" { serialized->used += value.used + 1; } - return f_none; + return F_none; } #endif // _di_fl_serialize_simple_ #ifndef _di_fl_unserialize_simple_ f_return_status fl_unserialize_simple(const f_string_static serialized, f_string_dynamics *strings) { #ifndef _di_level_0_parameter_checking_ - if (serialized.used == 0) return f_status_set_error(f_invalid_parameter); - if (strings == 0) return f_status_set_error(f_invalid_parameter); + if (serialized.used == 0) return F_status_set_error(F_parameter); + if (strings == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_array_length i = 0; f_array_length start = 0; @@ -54,7 +54,7 @@ extern "C" { if (strings->used >= strings->size) { f_macro_string_dynamics_resize(status, (*strings), strings->size + f_serialized_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } if (start == i) { @@ -75,7 +75,7 @@ extern "C" { if (total > strings->array[strings->used].size) { f_macro_string_dynamic_new(status, strings->array[strings->used], total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; strings->array[strings->used].size = total; } @@ -87,30 +87,30 @@ extern "C" { } if (i + width > serialized.used) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } start = i + width; } else if (i + width > serialized.used) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } i += width; } // while - return f_none; + return F_none; } #endif // _di_fl_unserialize_simple_ #ifndef _di_fl_unserialize_simple_map_ f_return_status fl_unserialize_simple_map(const f_string_static serialized, f_string_ranges *locations) { #ifndef _di_level_0_parameter_checking_ - if (serialized.used == 0) return f_status_set_error(f_invalid_parameter); - if (locations == 0) return f_status_set_error(f_invalid_parameter); + if (serialized.used == 0) return F_status_set_error(F_parameter); + if (locations == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_array_length i = 0; f_array_length start = 0; @@ -124,7 +124,7 @@ extern "C" { if (locations->used >= locations->size) { f_macro_string_ranges_resize(status, (*locations), locations->size + f_serialized_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } if (start == i) { @@ -145,27 +145,27 @@ extern "C" { locations->used++; if (i + width > serialized.used) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } start = i + width; } else if (i + width > serialized.used) { - return f_status_set_error(f_incomplete_utf_on_eos); + return F_status_set_error(F_incomplete_utf_eos); } i += width; } // while - return f_none; + return F_none; } #endif // _di_fl_unserialize_simple_map_ #ifndef _di_fl_unserialize_simple_find_ f_return_status fl_unserialize_simple_find(const f_string_static serialized, const f_array_length index, f_string_range *range) { #ifndef _di_level_0_parameter_checking_ - if (serialized.used == 0) return f_status_set_error(f_invalid_parameter); - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (serialized.used == 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ return private_fl_unserialize_simple_find(serialized, index, range); @@ -175,17 +175,17 @@ extern "C" { #ifndef _di_fl_unserialize_simple_get_ f_return_status fl_unserialize_simple_get(const f_string_static serialized, const f_array_length index, f_string_dynamic *dynamic) { #ifndef _di_level_0_parameter_checking_ - if (serialized.used == 0) return f_status_set_error(f_invalid_parameter); - if (dynamic == 0) return f_status_set_error(f_invalid_parameter); + if (serialized.used == 0) return F_status_set_error(F_parameter); + if (dynamic == 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ f_string_range range = f_string_range_initialize; f_status status = private_fl_unserialize_simple_find(serialized, index, &range); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if (status == f_no_data_on_eos) { + if (status == F_data_no_eos) { dynamic->used = 0; return status; } @@ -193,11 +193,11 @@ extern "C" { f_string_length total = (range.stop - range.start) + 1; if (total >= dynamic->size) { - f_status status_allocation = f_none; + f_status status_allocation = F_none; f_macro_string_dynamic_resize(status_allocation, (*dynamic), total); - if (f_status_is_error(status_allocation)) return status_allocation; + if (F_status_is_error(status_allocation)) return status_allocation; } memcpy(dynamic->string, serialized.string + range.start, total); diff --git a/level_1/fl_serialized/c/serialized.h b/level_1/fl_serialized/c/serialized.h index d3951f0..1c0d065 100644 --- a/level_1/fl_serialized/c/serialized.h +++ b/level_1/fl_serialized/c/serialized.h @@ -42,9 +42,9 @@ extern "C" { * The dynamic string that represents a serialized set of strings. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_serialize_simple_ extern f_return_status fl_serialize_simple(const f_string_static value, f_string_dynamic *serialized); @@ -66,10 +66,10 @@ extern "C" { * An array of strings de-serialized from serialized. * * @return - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_incomplete_utf_eos if end of sting is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_unserialize_simple_ extern f_return_status fl_unserialize_simple(const f_string_static serialized, f_string_dynamics *strings); @@ -91,10 +91,10 @@ extern "C" { * The locations within the serialized string representing distinct separate strings. * * @return - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_incomplete_utf_eos if end of sting is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_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_static serialized, f_string_ranges *locations); @@ -118,11 +118,11 @@ extern "C" { * A location within the serialized string representing the string at the given index. * * @return - * f_none on success. - * f_none_on_eos on success at end of string. - * f_no_data_on_eos if end of string reached before index was reached. - * 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_none on success. + * F_none_eos on success at end of string. + * F_data_no_eos if end of string reached before index was reached. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_unserialize_simple_find_ extern f_return_status fl_unserialize_simple_find(const f_string_static serialized, const f_array_length index, f_string_range *location); @@ -146,12 +146,12 @@ extern "C" { * The unserialized string from the specified index. * * @return - * f_none on success. - * f_none_on_eos on success at end of string. - * f_no_data_on_eos if end of string reached before index was reached (dynamic->used is set to 0). - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eos on success at end of string. + * F_data_no_eos if end of string reached before index was reached (dynamic->used is set to 0). + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fl_unserialize_simple_get_ extern f_return_status fl_unserialize_simple_get(const f_string_static serialized, const f_array_length index, f_string_dynamic *dynamic); diff --git a/level_1/fl_socket/c/socket.c b/level_1/fl_socket/c/socket.c index 5281cbe..64b3eec 100644 --- a/level_1/fl_socket/c/socket.c +++ b/level_1/fl_socket/c/socket.c @@ -12,43 +12,43 @@ extern "C"{ if (bind(*socket_id, (struct sockaddr *) socket_address, sizeof(struct sockaddr_un)) < 0) { if (errno == EACCES) { - return f_access_denied; + return F_access_denied; } else if (errno == EADDRINUSE) { - return f_busy_address; + return F_busy_address; } else if (errno == EADDRNOTAVAIL) { - return f_unavailable_address; + return F_unavailable_address; } else if (errno == EINVAL) { - return f_busy_socket; + return F_busy_socket; } else if (errno == ENOTSOCK) { - return f_invalid_socket; + return F_socket; } else if (errno == ENAMETOOLONG) { - return f_string_too_large; + return F_string_too_large; } else if (errno == ENOENT) { - return f_file_not_found; + return F_file_found_not; } else if (errno == EFAULT) { - return f_invalid_address; + return F_address; } else if (errno == ENOTDIR) { - return f_directory_not_found; + return F_directory_not_found; } else if (errno == ENOMEM) { - return f_out_of_memory; + return F_memory_out; } else if (errno == ELOOP) { - return f_loop; + return F_loop; } - return f_failure; + return F_failure; } - return f_none; + return F_none; } #endif // _di_fl_socket_file_bind_ @@ -56,22 +56,22 @@ extern "C"{ f_return_status fl_socket_listen(const f_socket_id socket_id, const unsigned int socket_backlog) { if (listen(socket_id, socket_backlog) < 0) { if (errno == EADDRINUSE) { - return f_busy; + return F_busy; } else if (errno == EBADF) { - return f_file_error_descriptor; + return F_file_descriptor; } else if (errno == ENOTSOCK) { - return f_invalid_socket; + return F_socket; } else if (errno == EOPNOTSUPP) { - return f_unsupported; + return F_unsupported; } - return f_failure; + return F_failure; } - return f_none; + return F_none; } #endif // _di_fl_socket_listen_ @@ -93,34 +93,34 @@ extern "C"{ } else { // socket close id is unsupported. - return f_unsupported; + return F_unsupported; } } if (error_code > 0) { if (error_code == EBADF) { - return f_file_error_descriptor; + return F_file_descriptor; } else if (error_code == EINVAL) { - return f_invalid_value; + return F_value; } else if (error_code == ENOTCONN) { - return f_not_connected; + return F_connected_not; } else if (error_code == ENOTSOCK) { - return f_invalid_socket; + return F_socket; } else if (error_code == EINTR) { - return f_interrupted; + return F_interrupted; } else if (error_code == EBADF) { - return f_error_input_output; + return F_input_output; } - return f_failure; + return F_failure; } - return f_none; + return F_none; } #endif // _di_fl_socket_close_client_ diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index dba56da..ceb2ec8 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -7,854 +7,833 @@ extern "C" { #ifndef _di_fl_status_to_string_ f_return_status fl_status_to_string(const f_status code, f_string *string) { #ifndef _di_level_1_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status unmasked_code = f_status_set_fine(code); + f_status unmasked_code = F_status_set_fine(code); switch (unmasked_code) { #ifndef _di_fl_status_booleans_ - case f_false: + case F_false: *string = fl_status_string_false; break; - case f_true: + case F_true: *string = fl_status_string_true; break; #endif // _di_fl_status_booleans_ #ifndef _di_fl_status_signals_ - // f_signal_hangup is not used because it has the same code as f_true. - case f_signal_interrupt: + // F_signal_hangup is not used because it has the same code as F_true. + case F_signal_interrupt: *string = fl_status_string_signal_interrupt; break; - case f_signal_quit: + case F_signal_quit: *string = fl_status_string_signal_quit; break; - case f_signal_illegal: + case F_signal_illegal: *string = fl_status_string_signal_illegal; break; - case f_signal_trap: + case F_signal_trap: *string = fl_status_string_signal_trap; break; - case f_signal_abort: + case F_signal_abort: *string = fl_status_string_signal_abort; break; - case f_signal_bus_error: + case F_signal_bus_error: *string = fl_status_string_signal_bus_error; break; - case f_signal_floating_point_exception: + case F_signal_floating_point_exception: *string = fl_status_string_signal_floating_point_exception; break; - case f_signal_kill: + case F_signal_kill: *string = fl_status_string_signal_kill; break; - case f_signal_user_1: + case F_signal_user_1: *string = fl_status_string_signal_user_1; break; - case f_signal_segmentation_fault: + case F_signal_segmentation_fault: *string = fl_status_string_signal_segmentation_fault; break; - case f_signal_user_2: + case F_signal_user_2: *string = fl_status_string_signal_user_2; break; - case f_signal_broken_pipe: + case F_signal_broken_pipe: *string = fl_status_string_signal_broken_pipe; break; - case f_signal_alarm_clock: + case F_signal_alarm_clock: *string = fl_status_string_signal_alarm_clock; break; - case f_signal_termination: + case F_signal_termination: *string = fl_status_string_signal_termination; break; - case f_signal_stack_fault: + case F_signal_stack_fault: *string = fl_status_string_signal_stack_fault; break; - case f_signal_child: + case F_signal_child: *string = fl_status_string_signal_child; break; - case f_signal_continue: + case F_signal_continue: *string = fl_status_string_signal_continue; break; - case f_signal_stop: + case F_signal_stop: *string = fl_status_string_signal_stop; break; - case f_signal_keyboard_stop: + case F_signal_keyboard_stop: *string = fl_status_string_signal_keyboard_stop; break; - case f_signal_tty_in: + case F_signal_tty_in: *string = fl_status_string_signal_tty_in; break; - case f_signal_tty_out: + case F_signal_tty_out: *string = fl_status_string_signal_tty_out; break; - case f_signal_urgent: + case F_signal_urgent: *string = fl_status_string_signal_urgent; break; - case f_signal_cpu_limit: + case F_signal_cpu_limit: *string = fl_status_string_signal_cpu_limit; break; - case f_signal_file_size_limit: + case F_signal_file_size_limit: *string = fl_status_string_signal_file_size_limit; break; - case f_signal_virtual_alarm_clock: + case F_signal_virtual_alarm_clock: *string = fl_status_string_signal_virtual_alarm_clock; break; - case f_signal_profile_alarm_clock: + case F_signal_profile_alarm_clock: *string = fl_status_string_signal_profile_alarm_clock; break; - case f_signal_window_size_change: + case F_signal_window_size_change: *string = fl_status_string_signal_window_size_change; break; - case f_signal_pollable_event: + case F_signal_pollable_event: *string = fl_status_string_signal_pollable_event; break; - case f_signal_power_failure: + case F_signal_power_failure: *string = fl_status_string_signal_power_failure; break; - case f_signal_bad_system_call: + case F_signal_bad_system_call: *string = fl_status_string_signal_bad_system_call; break; - case f_signal_reserved_32: + case F_signal_reserved_32: *string = fl_status_string_signal_reserved_32; break; - case f_signal_reserved_33: + case F_signal_reserved_33: *string = fl_status_string_signal_reserved_33; break; - case f_signal_reserved_34: + case F_signal_reserved_34: *string = fl_status_string_signal_reserved_34; break; - case f_signal_reserved_35: + case F_signal_reserved_35: *string = fl_status_string_signal_reserved_35; break; - case f_signal_reserved_36: + case F_signal_reserved_36: *string = fl_status_string_signal_reserved_36; break; - case f_signal_reserved_37: + case F_signal_reserved_37: *string = fl_status_string_signal_reserved_37; break; - case f_signal_reserved_38: + case F_signal_reserved_38: *string = fl_status_string_signal_reserved_38; break; - case f_signal_reserved_39: + case F_signal_reserved_39: *string = fl_status_string_signal_reserved_39; break; - case f_signal_reserved_40: + case F_signal_reserved_40: *string = fl_status_string_signal_reserved_40; break; - case f_signal_reserved_41: + case F_signal_reserved_41: *string = fl_status_string_signal_reserved_41; break; - case f_signal_reserved_42: + case F_signal_reserved_42: *string = fl_status_string_signal_reserved_42; break; - case f_signal_reserved_43: + case F_signal_reserved_43: *string = fl_status_string_signal_reserved_43; break; - case f_signal_reserved_44: + case F_signal_reserved_44: *string = fl_status_string_signal_reserved_44; break; - case f_signal_reserved_45: + case F_signal_reserved_45: *string = fl_status_string_signal_reserved_45; break; - case f_signal_reserved_46: + case F_signal_reserved_46: *string = fl_status_string_signal_reserved_46; break; - case f_signal_reserved_47: + case F_signal_reserved_47: *string = fl_status_string_signal_reserved_47; break; - case f_signal_reserved_48: + case F_signal_reserved_48: *string = fl_status_string_signal_reserved_48; break; - case f_signal_reserved_49: + case F_signal_reserved_49: *string = fl_status_string_signal_reserved_49; break; - case f_signal_reserved_50: + case F_signal_reserved_50: *string = fl_status_string_signal_reserved_50; break; - case f_signal_reserved_51: + case F_signal_reserved_51: *string = fl_status_string_signal_reserved_51; break; - case f_signal_reserved_52: + case F_signal_reserved_52: *string = fl_status_string_signal_reserved_52; break; - case f_signal_reserved_53: + case F_signal_reserved_53: *string = fl_status_string_signal_reserved_53; break; - case f_signal_reserved_54: + case F_signal_reserved_54: *string = fl_status_string_signal_reserved_54; break; - case f_signal_reserved_55: + case F_signal_reserved_55: *string = fl_status_string_signal_reserved_55; break; - case f_signal_reserved_56: + case F_signal_reserved_56: *string = fl_status_string_signal_reserved_56; break; - case f_signal_reserved_57: + case F_signal_reserved_57: *string = fl_status_string_signal_reserved_57; break; - case f_signal_reserved_58: + case F_signal_reserved_58: *string = fl_status_string_signal_reserved_58; break; - case f_signal_reserved_59: + case F_signal_reserved_59: *string = fl_status_string_signal_reserved_59; break; - case f_signal_reserved_60: + case F_signal_reserved_60: *string = fl_status_string_signal_reserved_60; break; - case f_signal_reserved_61: + case F_signal_reserved_61: *string = fl_status_string_signal_reserved_61; break; - case f_signal_reserved_62: + case F_signal_reserved_62: *string = fl_status_string_signal_reserved_62; break; - case f_signal_reserved_63: + case F_signal_reserved_63: *string = fl_status_string_signal_reserved_63; break; - case f_signal_reserved_64: + case F_signal_reserved_64: *string = fl_status_string_signal_reserved_64; break; #endif // _di_fl_status_signals_ #ifndef _di_fl_status_basic_ - case f_none: + case F_none: *string = fl_status_string_none; break; - case f_maybe: + case F_maybe: *string = fl_status_string_maybe; break; - case f_dummy: + case F_dummy: *string = fl_status_string_dummy; break; - case f_warn: + case F_warn: *string = fl_status_string_warn; break; - case f_block: + case F_block: *string = fl_status_string_block; break; - case f_critical: + case F_critical: *string = fl_status_string_critical; break; - case f_unknown: + case F_unknown: *string = fl_status_string_unknown; break; - case f_unsupported: + case F_unsupported: *string = fl_status_string_unsupported; break; - case f_no_data: + case F_data_not: *string = fl_status_string_no_data; break; - case f_no_space: + case F_space_not: *string = fl_status_string_no_space; break; - case f_out_of_bound: - *string = fl_status_string_out_of_bound; + case F_bound_out: + *string = fl_status_string_bound_out; break; - case f_out_of_memory: - *string = fl_status_string_out_of_memory; + case F_memory_out: + *string = fl_status_string_memory_out; break; - case f_prohibited: + case F_prohibited: *string = fl_status_string_prohibited; break; - case f_read_only: + case F_read_only: *string = fl_status_string_read_only; break; - case f_error_input: - *string = fl_status_string_input_error; + case F_input: + *string = fl_status_string_input; break; - case f_error_output: - *string = fl_status_string_output_error; + case F_output: + *string = fl_status_string_output; break; - case f_error_input_output: - *string = fl_status_string_input_output_error; + case F_input_output: + *string = fl_status_string_input_output; break; - case f_does_not_exist: - *string = fl_status_string_does_not_exist; + case F_exist_not: + *string = fl_status_string_exist_not; break; - case f_not_connected: - *string = fl_status_string_not_connected; + case F_connected_not: + *string = fl_status_string_connected_not; break; - case f_failure: + case F_failure: *string = fl_status_string_failure; break; - case f_interrupted: + case F_interrupted: *string = fl_status_string_interrupted; break; - case f_loop: + case F_loop: *string = fl_status_string_loop; break; - case f_incomplete: + case F_incomplete: *string = fl_status_string_incomplete; break; - case f_write_only: + case F_write_only: *string = fl_status_string_write_only; break; #endif // _di_fl_status_basic_ #ifndef _di_fl_status_invalid_ - case f_invalid: + case F_invalid: *string = fl_status_string_invalid; break; - case f_invalid_name: - *string = fl_status_string_invalid_name; + case F_name: + *string = fl_status_string_name; break; - case f_invalid_parameter: - *string = fl_status_string_invalid_parameter; + case F_parameter: + *string = fl_status_string_parameter; break; - case f_invalid_syntax: - *string = fl_status_string_invalid_syntax; + case F_syntax: + *string = fl_status_string_syntax; break; - case f_invalid_data: - *string = fl_status_string_invalid_data; + case F_data: + *string = fl_status_string_data; break; - case f_invalid_file: - *string = fl_status_string_invalid_file; + case F_descriptor: + *string = fl_status_string_descriptor; break; - case f_invalid_directory: - *string = fl_status_string_invalid_directory; + case F_socket: + *string = fl_status_string_socket; break; - case f_invalid_descriptor: - *string = fl_status_string_invalid_descriptor; + case F_device: + *string = fl_status_string_device; break; - case f_invalid_socket: - *string = fl_status_string_invalid_socket; + case F_link: + *string = fl_status_string_link; break; - case f_invalid_device: - *string = fl_status_string_invalid_device; + case F_pipe: + *string = fl_status_string_pipe; break; - case f_invalid_link: - *string = fl_status_string_invalid_link; + case F_address: + *string = fl_status_string_address; break; - case f_invalid_pipe: - *string = fl_status_string_invalid_pipe; + case F_port: + *string = fl_status_string_port; break; - case f_invalid_address: - *string = fl_status_string_invalid_address; + case F_value: + *string = fl_status_string_value; break; - case f_invalid_port: - *string = fl_status_string_invalid_port; + case F_buffer: + *string = fl_status_string_buffer; break; - case f_invalid_value: - *string = fl_status_string_invalid_value; + case F_process: + *string = fl_status_string_process; break; - case f_invalid_buffer: - *string = fl_status_string_invalid_buffer; + case F_utf: + *string = fl_status_string_utf; break; - case f_invalid_process: - *string = fl_status_string_invalid_process; + case F_eof: + *string = fl_status_string_eof; break; - case f_invalid_utf: - *string = fl_status_string_invalid_utf; + case F_eol: + *string = fl_status_string_eol; break; - case f_invalid_on_eof: - *string = fl_status_string_invalid_on_eof; + case F_eos: + *string = fl_status_string_eos; break; - case f_invalid_on_eol: - *string = fl_status_string_invalid_on_eol; - break; - case f_invalid_on_eos: - *string = fl_status_string_invalid_on_eos; - break; - case f_invalid_on_stop: - *string = fl_status_string_invalid_on_stop; + case F_stop: + *string = fl_status_string_stop; break; #endif // _di_fl_status_invalid_ #ifndef _di_fl_status_busy_ - case f_busy: + case F_busy: *string = fl_status_string_busy; break; - case f_busy_address: + case F_busy_address: *string = fl_status_string_busy_address; break; - case f_busy_port: + case F_busy_port: *string = fl_status_string_busy_port; break; - case f_busy_socket: + case F_busy_socket: *string = fl_status_string_busy_socket; break; - case f_busy_device: + case F_busy_device: *string = fl_status_string_busy_device; break; - case f_busy_pipe: + case F_busy_pipe: *string = fl_status_string_busy_pipe; break; - case f_busy_buffer: + case F_busy_buffer: *string = fl_status_string_busy_buffer; break; - case f_busy_process: + case F_busy_process: *string = fl_status_string_busy_process; break; #endif // _di_fl_status_busy_ #ifndef _di_fl_status_unavailable_ - case f_unavailable: + case F_unavailable: *string = fl_status_string_unavailable; break; - case f_unavailable_address: + case F_unavailable_address: *string = fl_status_string_unavailable_address; break; - case f_unavailable_port: + case F_unavailable_port: *string = fl_status_string_unavailable_port; break; - case f_unavailable_socket: + case F_unavailable_socket: *string = fl_status_string_unavailable_socket; break; - case f_unavailable_device: + case F_unavailable_device: *string = fl_status_string_unavailable_device; break; - case f_unavailable_pipe: + case F_unavailable_pipe: *string = fl_status_string_unavailable_pipe; break; - case f_unavailable_buffer: + case F_unavailable_buffer: *string = fl_status_string_unavailable_buffer; break; - case f_unavailable_process: + case F_unavailable_process: *string = fl_status_string_unavailable_process; break; #endif // _di_fl_status_unavailable_ #ifndef _di_fl_status_digits_ - case f_number_underflow: + case F_number_underflow: *string = fl_status_string_underflow; break; - case f_number_overflow: + case F_number_overflow: *string = fl_status_string_overflow; break; - case f_number_divide_by_zero: + case F_number_divide_by_zero: *string = fl_status_string_divide_by_zero; break; - case f_number_negative: + case F_number_negative: *string = fl_status_string_negative_number; break; - case f_number_positive: + case F_number_positive: *string = fl_status_string_positive_number; break; - case f_number_zero: + case F_number_zero: *string = fl_status_string_zero_number; break; - case f_number_decimal: + case F_number_decimal: *string = fl_status_string_decimal_number; break; - case f_number_whole: + case F_number_whole: *string = fl_status_string_whole_number; break; - case f_number_invalid: - *string = fl_status_string_invalid_number; + case F_number_invalid: + *string = fl_status_string_number; break; #endif // _di_fl_status_digits_ #ifndef _di_fl_status_buffers_ - case f_no_data_on_eof: - *string = fl_status_string_no_data_on_eof; - break; - case f_no_data_on_eol: - *string = fl_status_string_no_data_on_eol; - break; - case f_no_data_on_eos: - *string = fl_status_string_no_data_on_eos; - break; - case f_no_data_on_stop: - *string = fl_status_string_no_data_on_stop; - break; - case f_no_data_on_block: - *string = fl_status_string_no_data_on_block; - break; - case f_none_on_eof: - *string = fl_status_string_none_on_eof; + case F_data_no_eof: + *string = fl_status_string_data_no_eof; break; - case f_none_on_eol: - *string = fl_status_string_none_on_eol; + case F_data_no_eol: + *string = fl_status_string_data_no_eol; break; - case f_none_on_eos: - *string = fl_status_string_none_on_eos; + case F_data_no_eos: + *string = fl_status_string_data_no_eos; break; - case f_none_on_stop: - *string = fl_status_string_none_on_stop; + case F_data_no_stop: + *string = fl_status_string_data_no_stop; break; - case f_none_on_block: - *string = fl_status_string_none_on_block; + case F_data_block_no: + *string = fl_status_string_data_no_block; break; - case f_error_on_eof: - *string = fl_status_string_error_on_eof; + case F_none_eof: + *string = fl_status_string_none_eof; break; - case f_error_on_eol: - *string = fl_status_string_error_on_eol; + case F_none_eol: + *string = fl_status_string_none_eol; break; - case f_error_on_eos: - *string = fl_status_string_error_on_eos; + case F_none_eos: + *string = fl_status_string_none_eos; break; - case f_error_on_stop: - *string = fl_status_string_error_on_stop; + case F_none_stop: + *string = fl_status_string_none_stop; break; - case f_error_on_block: - *string = fl_status_string_error_on_block; + case F_none_block: + *string = fl_status_string_none_block; break; - case f_buffer_too_small: + case F_buffer_too_small: *string = fl_status_string_buffer_too_small; break; - case f_buffer_too_large: + case F_buffer_too_large: *string = fl_status_string_buffer_too_large; break; - case f_string_too_small: + case F_string_too_small: *string = fl_status_string_string_too_small; break; - case f_string_too_large: + case F_string_too_large: *string = fl_status_string_string_too_large; break; - case f_unterminated: + case F_unterminated: *string = fl_status_string_unterminated; break; - case f_unterminated_on_eof: - *string = fl_status_string_unterminated_on_eof; + case F_unterminated_eof: + *string = fl_status_string_unterminated_eof; break; - case f_unterminated_on_eol: - *string = fl_status_string_unterminated_on_eol; + case F_unterminated_eol: + *string = fl_status_string_unterminated_eol; break; - case f_unterminated_on_eos: - *string = fl_status_string_unterminated_on_eos; + case F_unterminated_eos: + *string = fl_status_string_unterminated_eos; break; - case f_unterminated_on_stop: - *string = fl_status_string_unterminated_on_stop; + case F_unterminated_stop: + *string = fl_status_string_unterminated_stop; break; - case f_unterminated_on_block: - *string = fl_status_string_unterminated_on_block; + case F_unterminated_block: + *string = fl_status_string_unterminated_block; break; - case f_unterminated_group: + case F_unterminated_group: *string = fl_status_string_unterminated_group; break; - case f_unterminated_group_on_eof: + case F_unterminated_group_eof: *string = fl_status_string_unterminated_group_on_eof; break; - case f_unterminated_group_on_eol: + case F_unterminated_group_eol: *string = fl_status_string_unterminated_group_on_eol; break; - case f_unterminated_group_on_eos: + case F_unterminated_group_eos: *string = fl_status_string_unterminated_group_on_eos; break; - case f_unterminated_group_on_stop: + case F_unterminated_group_stop: *string = fl_status_string_unterminated_group_on_stop; break; - case f_unterminated_group_on_block: + case F_unterminated_group_block: *string = fl_status_string_unterminated_group_on_block; break; - case f_unterminated_nest: + case F_unterminated_nest: *string = fl_status_string_unterminated_nest; break; - case f_unterminated_nest_on_eof: - *string = fl_status_string_unterminated_nest_on_eof; + case F_unterminated_nest_eof: + *string = fl_status_string_unterminated_nest_eof; break; - case f_unterminated_nest_on_eol: - *string = fl_status_string_unterminated_nest_on_eol; + case F_unterminated_nest_eol: + *string = fl_status_string_unterminated_nest_eol; break; - case f_unterminated_nest_on_eos: - *string = fl_status_string_unterminated_nest_on_eos; + case F_unterminated_nest_eos: + *string = fl_status_string_unterminated_nest_eos; break; - case f_unterminated_nest_on_stop: - *string = fl_status_string_unterminated_nest_on_stop; + case F_unterminated_nest_stop: + *string = fl_status_string_unterminated_nest_stop; break; - case f_unterminated_nest_on_block: - *string = fl_status_string_unterminated_nest_on_block; + case F_unterminated_nest_block: + *string = fl_status_string_unterminated_nest_block; break; - case f_incomplete_utf: + case F_incomplete_utf: *string = fl_status_string_incomplete_utf; break; - case f_incomplete_utf_on_eof: + case F_incomplete_utf_eof: *string = fl_status_string_incomplete_utf_on_eof; break; - case f_incomplete_utf_on_eol: + case F_incomplete_utf_eol: *string = fl_status_string_incomplete_utf_on_eol; break; - case f_incomplete_utf_on_eos: + case F_incomplete_utf_eos: *string = fl_status_string_incomplete_utf_on_eos; break; - case f_incomplete_utf_on_stop: + case F_incomplete_utf_stop: *string = fl_status_string_incomplete_utf_on_stop; break; - case f_incomplete_utf_on_block: + case F_incomplete_utf_block: *string = fl_status_string_incomplete_utf_on_block; break; #endif // _di_fl_status_buffers_ #ifndef _di_fl_status_allocation_ - case f_error_allocation: - *string = fl_status_string_allocation_error; + case F_memory_allocation: + *string = fl_status_string_memory_allocation; break; - case f_error_reallocation: - *string = fl_status_string_reallocation_error; + case F_memory_reallocation: + *string = fl_status_string_memory_reallocation; break; - case f_error_deallocation: - *string = fl_status_string_deallocation_error; + case F_memory_deallocation: + *string = fl_status_string_memory_deallocation; break; #endif // _di_fl_status_allocation_ #ifndef _di_fl_status_fork_ - case f_fork_failed: - *string = fl_status_string_fork_failed; + case F_fork: + *string = fl_status_string_fork; break; - case f_too_many_processes: - *string = fl_status_string_too_many_processes; + case F_process_too_many: + *string = fl_status_string_process_too_many; break; #endif // _di_fl_status_fork_ #ifndef _di_fl_status_file_ - case f_file_closed: + case F_file_closed: *string = fl_status_string_file_closed; break; - case f_file_error_seek: - *string = fl_status_string_file_seek_error; + case F_file_seek: + *string = fl_status_string_file_seek; break; - case f_file_error_read: - *string = fl_status_string_file_read_error; + case F_file_read: + *string = fl_status_string_file_read; break; - case f_file_error_write: - *string = fl_status_string_file_write_error; + case F_file_write: + *string = fl_status_string_file_write; break; - case f_file_error_flush: - *string = fl_status_string_file_flush_error; + case F_file_flush: + *string = fl_status_string_file_flush; break; - case f_file_error_purge: - *string = fl_status_string_file_purge_error; + case F_file_purge: + *string = fl_status_string_file_purge; break; - case f_file_error_open: - *string = fl_status_string_file_open_error; + case F_file_open: + *string = fl_status_string_file_open; break; - case f_file_error_close: - *string = fl_status_string_file_close_error; + case F_file_close: + *string = fl_status_string_file_close; break; - case f_file_error_synchronize: - *string = fl_status_string_file_synchronize_error; + case F_file_synchronize: + *string = fl_status_string_file_synchronize; break; - case f_file_error_descriptor: - *string = fl_status_string_file_descriptor_error; + case F_file_descriptor: + *string = fl_status_string_file_descriptor; break; - case f_file_not_found: - *string = fl_status_string_file_not_found; + case F_file_found_not: + *string = fl_status_string_file_found_not; break; - case f_file_empty: + case F_file_empty: *string = fl_status_string_file_empty; break; - case f_file_found: + case F_file_found: *string = fl_status_string_file_found; break; - case f_file_is_type_block: - *string = fl_status_string_file_is_type_block; + case F_file_type_block: + *string = fl_status_string_file_type_block; break; - case f_file_is_type_character: - *string = fl_status_string_file_is_type_character; + case F_file_type_character: + *string = fl_status_string_file_type_character; break; - case f_file_is_type_directory: - *string = fl_status_string_file_is_type_directory; + case F_file_type_directory: + *string = fl_status_string_file_type_directory; break; - case f_file_is_type_file: - *string = fl_status_string_file_is_type_file; + case F_file_type_file: + *string = fl_status_string_file_type_file; break; - case f_file_is_type_link: - *string = fl_status_string_file_is_type_link; + case F_file_type_link: + *string = fl_status_string_file_type_link; break; - case f_file_is_type_pipe: - *string = fl_status_string_file_is_type_pipe; + case F_file_type_pipe: + *string = fl_status_string_file_type_pipe; break; - case f_file_is_type_socket: - *string = fl_status_string_file_is_type_socket; + case F_file_type_socket: + *string = fl_status_string_file_type_socket; break; - case f_file_is_type_unknown: - *string = fl_status_string_file_is_type_unknown; + case F_file_type_unknown: + *string = fl_status_string_file_type_unknown; break; - case f_file_not_open: - *string = fl_status_string_file_not_open; + case F_file_open_not: + *string = fl_status_string_file_open_not; break; - case f_file_not_type_block: - *string = fl_status_string_file_not_type_block; + case F_file_type_not_block: + *string = fl_status_string_file_type_not_block; break; - case f_file_not_type_character: - *string = fl_status_string_file_not_type_character; + case F_file_type_not_character: + *string = fl_status_string_file_type_not_character; break; - case f_file_not_type_directory: + case F_file_type_not_directory: *string = fl_status_string_file_not_type_directory; break; - case f_file_not_type_file: + case F_file_type_not_file: *string = fl_status_string_file_not_type_file; break; - case f_file_not_type_link: + case F_file_type_not_link: *string = fl_status_string_file_not_type_link; break; - case f_file_not_type_pipe: + case F_file_type_not_pipe: *string = fl_status_string_file_not_type_pipe; break; - case f_file_not_type_socket: + case F_file_type_not_socket: *string = fl_status_string_file_not_type_socket; break; - case f_file_not_type_unknown: + case F_file_type_not_unknown: *string = fl_status_string_file_not_type_unknown; break; - case f_file_error_allocation: - *string = fl_status_string_file_allocation_error; + case F_file_allocation: + *string = fl_status_string_file_allocation; break; - case f_file_error_reallocation: - *string = fl_status_string_file_reallocation_error; + case F_file_reallocation: + *string = fl_status_string_file_reallocation; break; - case f_file_error_deallocation: - *string = fl_status_string_file_deallocation_error; + case F_file_deallocation: + *string = fl_status_string_file_deallocation; break; - case f_file_error_stat: - *string = fl_status_string_file_stat_error; + case F_file_stat: + *string = fl_status_string_file_stat; break; - case f_file_error: - *string = fl_status_string_file_error; + case F_file_error: + *string = fl_status_string_file; break; - case f_file_not_utf: + case F_file_not_utf: *string = fl_status_string_file_not_utf; break; - case f_file_max_descriptors: - *string = fl_status_string_file_max_descriptors; + case F_file_descriptors_max: + *string = fl_status_string_file_descriptors_max; break; - case f_file_max_open: - *string = fl_status_string_file_max_open; + case F_file_open_max: + *string = fl_status_string_file_open_max; break; - case f_file_utf: + case F_file_utf: *string = fl_status_string_file_utf; break; #endif // _di_fl_status_file_ #ifndef _di_f_status_filesystem_ - case f_filesystem_error: + case F_filesystem: *string = fl_status_string_filesystem_error; break; - case f_filesystem_quota_blocks: + case F_filesystem_quota_blocks: *string = fl_status_string_filesystem_quota_blocks; break; - case f_filesystem_quota_reached: + case F_filesystem_quota_reached: *string = fl_status_string_filesystem_quota_reached; break; #endif // _di_f_status_filesystem_ #ifndef _di_fl_status_directory_ - case f_directory_error_read: - *string = fl_status_string_directory_read_error; + case F_directory_read: + *string = fl_status_string_directory_read; break; - case f_directory_error_write: - *string = fl_status_string_directory_write_error; + case F_directory_write: + *string = fl_status_string_directory_write; break; - case f_directory_error_flush: - *string = fl_status_string_directory_flush_error; + case F_directory_flush: + *string = fl_status_string_directory_flush; break; - case f_directory_error_link_max: - *string = fl_status_string_directory_error_link_max; + case F_directory_link_max: + *string = fl_status_string_directory_link_max; break; - case f_directory_error_purge: - *string = fl_status_string_directory_purge_error; + case F_directory_purge: + *string = fl_status_string_directory_purge; break; - case f_directory_error_open: - *string = fl_status_string_directory_open_error; + case F_directory_open: + *string = fl_status_string_directory_open; break; - case f_directory_error_close: - *string = fl_status_string_directory_close_error; + case F_directory_close: + *string = fl_status_string_directory_close; break; - case f_directory_error_synchronize: - *string = fl_status_string_directory_synchronize_error; + case F_directory_synchronize: + *string = fl_status_string_directory_synchronize; break; - case f_directory_error_descriptor: - *string = fl_status_string_directory_descriptor_error; + case F_directory_descriptor: + *string = fl_status_string_directory_descriptor; break; - case f_directory_closed: + case F_directory_closed: *string = fl_status_string_directory_closed; break; - case f_directory_empty: + case F_directory_empty: *string = fl_status_string_directory_empty; break; - case f_directory_found: + case F_directory_found: *string = fl_status_string_directory_found; break; - case f_directory_not_found: + case F_directory_not_found: *string = fl_status_string_directory_not_found; break; - case f_directory_not_open: + case F_directory_not_open: *string = fl_status_string_directory_not_open; break; - case f_directory_error: - *string = fl_status_string_directory_error; + case F_directory: + *string = fl_status_string_directory; break; - case f_directory_not_utf: + case F_directory_utf_not: *string = fl_status_string_directory_not_utf; break; - case f_directory_error_unsupported: - *string = fl_status_string_directory_error_unsupported; + case F_directory_unsupported: + *string = fl_status_string_directory_unsupported; break; - case f_directory_error_stream: - *string = fl_status_string_directory_error_stream; + case F_directory_stream: + *string = fl_status_string_directory_stream; break; - case f_directory_utf: + case F_directory_utf: *string = fl_status_string_directory_utf; break; #endif // _di_fl_status_directory_ #ifndef _di_fl_status_socket_ - case f_socket_error_connection_client: - *string = fl_status_string_socket_connection_client_error; + case F_socket_connection_client: + *string = fl_status_string_socket_connection_client; break; - case f_socket_error_connection_target: - *string = fl_status_string_socket_connection_target_error; + case F_socket_connection_target: + *string = fl_status_string_socket_connection_target; break; - case f_socket_error_receive: - *string = fl_status_string_socket_receive_error; + case F_socket_receive: + *string = fl_status_string_socket_receive; break; - case f_socket_error_send: - *string = fl_status_string_socket_send_error; + case F_socket_send: + *string = fl_status_string_socket_send; break; #endif // _di_fl_status_socket_ #ifndef _di_fll_error_non_ - case f_less_than: - *string = fl_status_string_less_than; + case F_than_less: + *string = fl_status_string_than_less; break; - case f_equal_to: + case F_equal_to: *string = fl_status_string_equal_to; break; - case f_not_equal_to: - *string = fl_status_string_not_equal_to; + case F_equal_to_not: + *string = fl_status_string_equal_to_not; break; - case f_greater_than: - *string = fl_status_string_greater_than; + case F_than_greater: + *string = fl_status_string_than_greater; break; #endif // _di_fl_status_non_ #ifndef _di_fl_status_access_denied_ - case f_access_denied: + case F_access_denied: *string = fl_status_string_access_denied; break; - case f_access_denied_user: + case F_access_denied_user: *string = fl_status_string_access_denied_user; break; - case f_access_denied_group: + case F_access_denied_group: *string = fl_status_string_access_denied_group; break; - case f_access_denied_world: + case F_access_denied_world: *string = fl_status_string_access_denied_world; break; - case f_access_denied_read: + case F_access_denied_read: *string = fl_status_string_access_denied_read; break; - case f_access_denied_write: + case F_access_denied_write: *string = fl_status_string_access_denied_write; break; - case f_access_denied_execute: + case F_access_denied_execute: *string = fl_status_string_access_denied_execute; break; - case f_access_denied_super: + case F_access_denied_super: *string = fl_status_string_access_denied_super; break; #endif // _di_fl_status_access_denied_ - case f_status_code_last: + case F_status_code_last: *string = fl_status_string_status_code_last; break; default: *string = 0; - return f_status_set_error(f_invalid_data); + return F_status_set_error(F_data); } - return f_none; + return F_none; } #endif // _di_fl_status_to_string_ diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index 9dbbcfe..5ec96a7 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -22,824 +22,818 @@ extern "C" { #ifndef _di_fl_status_string_ #ifndef _di_fl_status_booleans_ - #define fl_status_string_false "f_false" + #define fl_status_string_false "F_false" #define fl_status_string_false_length 7 - #define fl_status_string_true "f_true" + #define fl_status_string_true "F_true" #define fl_status_string_true_length 6 #endif // _di_fl_status_booleans_ #ifndef _di_fl_status_signals_ - #define fl_status_string_signal_hangup "f_signal_hangup" + #define fl_status_string_signal_hangup "F_signal_hangup" #define fl_status_string_signal_hangup_length 15 - #define fl_status_string_signal_interrupt "f_signal_interrupt" + #define fl_status_string_signal_interrupt "F_signal_interrupt" #define fl_status_string_signal_interrupt_length 18 - #define fl_status_string_signal_quit "f_signal_quit" + #define fl_status_string_signal_quit "F_signal_quit" #define fl_status_string_signal_quit_length 13 - #define fl_status_string_signal_illegal "f_signal_illegal" + #define fl_status_string_signal_illegal "F_signal_illegal" #define fl_status_string_signal_illegal_length 16 - #define fl_status_string_signal_trap "f_signal_trap" + #define fl_status_string_signal_trap "F_signal_trap" #define fl_status_string_signal_trap_length 13 - #define fl_status_string_signal_abort "f_signal_abort" + #define fl_status_string_signal_abort "F_signal_abort" #define fl_status_string_signal_abort_length 14 - #define fl_status_string_signal_bus_error "f_signal_bus_error" + #define fl_status_string_signal_bus_error "F_signal_bus_error" #define fl_status_string_signal_bus_error_length 17 - #define fl_status_string_signal_floating_point_exception "f_signal_floating_point_exception" + #define fl_status_string_signal_floating_point_exception "F_signal_floating_point_exception" #define fl_status_string_signal_floating_point_exception_length 33 - #define fl_status_string_signal_kill "f_signal_kill" + #define fl_status_string_signal_kill "F_signal_kill" #define fl_status_string_signal_kill_length 13 - #define fl_status_string_signal_user_1 "f_signal_user_1" + #define fl_status_string_signal_user_1 "F_signal_user_1" #define fl_status_string_signal_user_1_length 15 - #define fl_status_string_signal_segmentation_fault "f_signal_segmentation_fault" + #define fl_status_string_signal_segmentation_fault "F_signal_segmentation_fault" #define fl_status_string_signal_segmentation_fault_length 27 - #define fl_status_string_signal_user_2 "f_signal_user_2" + #define fl_status_string_signal_user_2 "F_signal_user_2" #define fl_status_string_signal_user_2_length 15 - #define fl_status_string_signal_broken_pipe "f_signal_broken_pipe" + #define fl_status_string_signal_broken_pipe "F_signal_broken_pipe" #define fl_status_string_signal_broken_pipe_length 20 - #define fl_status_string_signal_alarm_clock "f_signal_alarm_clock" + #define fl_status_string_signal_alarm_clock "F_signal_alarm_clock" #define fl_status_string_signal_alarm_clock_length 20 - #define fl_status_string_signal_termination "f_signal_termination" + #define fl_status_string_signal_termination "F_signal_termination" #define fl_status_string_signal_termination_length 20 - #define fl_status_string_signal_stack_fault "f_signal_stack_fault" + #define fl_status_string_signal_stack_fault "F_signal_stack_fault" #define fl_status_string_signal_stack_fault_length 20 - #define fl_status_string_signal_child "f_signal_child" + #define fl_status_string_signal_child "F_signal_child" #define fl_status_string_signal_child_length 14 - #define fl_status_string_signal_continue "f_signal_continue" + #define fl_status_string_signal_continue "F_signal_continue" #define fl_status_string_signal_continue_length 17 - #define fl_status_string_signal_stop "f_signal_stop" + #define fl_status_string_signal_stop "F_signal_stop" #define fl_status_string_signal_stop_length 13 - #define fl_status_string_signal_keyboard_stop "f_signal_keyboard_stop" + #define fl_status_string_signal_keyboard_stop "F_signal_keyboard_stop" #define fl_status_string_signal_keyboard_stop_length 22 - #define fl_status_string_signal_tty_in "f_signal_tty_in" + #define fl_status_string_signal_tty_in "F_signal_tty_in" #define fl_status_string_signal_tty_in_length 15 - #define fl_status_string_signal_tty_out "f_signal_tty_out" + #define fl_status_string_signal_tty_out "F_signal_tty_out" #define fl_status_string_signal_tty_out_length 16 - #define fl_status_string_signal_urgent "f_signal_urgent" + #define fl_status_string_signal_urgent "F_signal_urgent" #define fl_status_string_signal_urgent_length 15 - #define fl_status_string_signal_cpu_limit "f_signal_cpu_limit" + #define fl_status_string_signal_cpu_limit "F_signal_cpu_limit" #define fl_status_string_signal_cpu_limit_length 18 - #define fl_status_string_signal_file_size_limit "f_signal_file_size_limit" + #define fl_status_string_signal_file_size_limit "F_signal_file_size_limit" #define fl_status_string_signal_file_size_limit_length 24 - #define fl_status_string_signal_virtual_alarm_clock "f_signal_virtual_alarm_clock" + #define fl_status_string_signal_virtual_alarm_clock "F_signal_virtual_alarm_clock" #define fl_status_string_signal_virtual_alarm_clock_length 28 - #define fl_status_string_signal_profile_alarm_clock "f_signal_profile_alarm_clock" + #define fl_status_string_signal_profile_alarm_clock "F_signal_profile_alarm_clock" #define fl_status_string_signal_profile_alarm_clock_length 28 - #define fl_status_string_signal_window_size_change "f_signal_window_size_change" + #define fl_status_string_signal_window_size_change "F_signal_window_size_change" #define fl_status_string_signal_window_size_change_length 27 - #define fl_status_string_signal_pollable_event "f_signal_pollable_event" + #define fl_status_string_signal_pollable_event "F_signal_pollable_event" #define fl_status_string_signal_pollable_event_length 23 - #define fl_status_string_signal_power_failure "f_signal_power_failure" + #define fl_status_string_signal_power_failure "F_signal_power_failure" #define fl_status_string_signal_power_failure_length 22 - #define fl_status_string_signal_bad_system_call "f_signal_bad_system_call" + #define fl_status_string_signal_bad_system_call "F_signal_bad_system_call" #define fl_status_string_signal_bad_system_call_length 24 - #define fl_status_string_signal_reserved_32 "f_signal_reserved_32" + #define fl_status_string_signal_reserved_32 "F_signal_reserved_32" #define fl_status_string_signal_reserved_32_length 20 - #define fl_status_string_signal_reserved_33 "f_signal_reserved_33" + #define fl_status_string_signal_reserved_33 "F_signal_reserved_33" #define fl_status_string_signal_reserved_33_length 20 - #define fl_status_string_signal_reserved_34 "f_signal_reserved_34" + #define fl_status_string_signal_reserved_34 "F_signal_reserved_34" #define fl_status_string_signal_reserved_34_length 20 - #define fl_status_string_signal_reserved_35 "f_signal_reserved_35" + #define fl_status_string_signal_reserved_35 "F_signal_reserved_35" #define fl_status_string_signal_reserved_35_length 20 - #define fl_status_string_signal_reserved_36 "f_signal_reserved_36" + #define fl_status_string_signal_reserved_36 "F_signal_reserved_36" #define fl_status_string_signal_reserved_36_length 20 - #define fl_status_string_signal_reserved_37 "f_signal_reserved_37" + #define fl_status_string_signal_reserved_37 "F_signal_reserved_37" #define fl_status_string_signal_reserved_37_length 20 - #define fl_status_string_signal_reserved_38 "f_signal_reserved_38" + #define fl_status_string_signal_reserved_38 "F_signal_reserved_38" #define fl_status_string_signal_reserved_38_length 20 - #define fl_status_string_signal_reserved_39 "f_signal_reserved_39" + #define fl_status_string_signal_reserved_39 "F_signal_reserved_39" #define fl_status_string_signal_reserved_39_length 20 - #define fl_status_string_signal_reserved_40 "f_signal_reserved_40" + #define fl_status_string_signal_reserved_40 "F_signal_reserved_40" #define fl_status_string_signal_reserved_40_length 20 - #define fl_status_string_signal_reserved_41 "f_signal_reserved_41" + #define fl_status_string_signal_reserved_41 "F_signal_reserved_41" #define fl_status_string_signal_reserved_41_length 20 - #define fl_status_string_signal_reserved_42 "f_signal_reserved_42" + #define fl_status_string_signal_reserved_42 "F_signal_reserved_42" #define fl_status_string_signal_reserved_42_length 20 - #define fl_status_string_signal_reserved_43 "f_signal_reserved_43" + #define fl_status_string_signal_reserved_43 "F_signal_reserved_43" #define fl_status_string_signal_reserved_43_length 20 - #define fl_status_string_signal_reserved_44 "f_signal_reserved_44" + #define fl_status_string_signal_reserved_44 "F_signal_reserved_44" #define fl_status_string_signal_reserved_44_length 20 - #define fl_status_string_signal_reserved_45 "f_signal_reserved_45" + #define fl_status_string_signal_reserved_45 "F_signal_reserved_45" #define fl_status_string_signal_reserved_45_length 20 - #define fl_status_string_signal_reserved_46 "f_signal_reserved_46" + #define fl_status_string_signal_reserved_46 "F_signal_reserved_46" #define fl_status_string_signal_reserved_46_length 20 - #define fl_status_string_signal_reserved_47 "f_signal_reserved_47" + #define fl_status_string_signal_reserved_47 "F_signal_reserved_47" #define fl_status_string_signal_reserved_47_length 20 - #define fl_status_string_signal_reserved_48 "f_signal_reserved_48" + #define fl_status_string_signal_reserved_48 "F_signal_reserved_48" #define fl_status_string_signal_reserved_48_length 20 - #define fl_status_string_signal_reserved_49 "f_signal_reserved_49" + #define fl_status_string_signal_reserved_49 "F_signal_reserved_49" #define fl_status_string_signal_reserved_49_length 20 - #define fl_status_string_signal_reserved_50 "f_signal_reserved_50" + #define fl_status_string_signal_reserved_50 "F_signal_reserved_50" #define fl_status_string_signal_reserved_50_length 20 - #define fl_status_string_signal_reserved_51 "f_signal_reserved_51" + #define fl_status_string_signal_reserved_51 "F_signal_reserved_51" #define fl_status_string_signal_reserved_51_length 20 - #define fl_status_string_signal_reserved_52 "f_signal_reserved_52" + #define fl_status_string_signal_reserved_52 "F_signal_reserved_52" #define fl_status_string_signal_reserved_52_length 20 - #define fl_status_string_signal_reserved_53 "f_signal_reserved_53" + #define fl_status_string_signal_reserved_53 "F_signal_reserved_53" #define fl_status_string_signal_reserved_53_length 20 - #define fl_status_string_signal_reserved_54 "f_signal_reserved_54" + #define fl_status_string_signal_reserved_54 "F_signal_reserved_54" #define fl_status_string_signal_reserved_54_length 20 - #define fl_status_string_signal_reserved_55 "f_signal_reserved_55" + #define fl_status_string_signal_reserved_55 "F_signal_reserved_55" #define fl_status_string_signal_reserved_55_length 20 - #define fl_status_string_signal_reserved_56 "f_signal_reserved_56" + #define fl_status_string_signal_reserved_56 "F_signal_reserved_56" #define fl_status_string_signal_reserved_56_length 20 - #define fl_status_string_signal_reserved_57 "f_signal_reserved_57" + #define fl_status_string_signal_reserved_57 "F_signal_reserved_57" #define fl_status_string_signal_reserved_57_length 20 - #define fl_status_string_signal_reserved_58 "f_signal_reserved_58" + #define fl_status_string_signal_reserved_58 "F_signal_reserved_58" #define fl_status_string_signal_reserved_58_length 20 - #define fl_status_string_signal_reserved_59 "f_signal_reserved_59" + #define fl_status_string_signal_reserved_59 "F_signal_reserved_59" #define fl_status_string_signal_reserved_59_length 20 - #define fl_status_string_signal_reserved_60 "f_signal_reserved_60" + #define fl_status_string_signal_reserved_60 "F_signal_reserved_60" #define fl_status_string_signal_reserved_60_length 20 - #define fl_status_string_signal_reserved_61 "f_signal_reserved_61" + #define fl_status_string_signal_reserved_61 "F_signal_reserved_61" #define fl_status_string_signal_reserved_61_length 20 - #define fl_status_string_signal_reserved_62 "f_signal_reserved_62" + #define fl_status_string_signal_reserved_62 "F_signal_reserved_62" #define fl_status_string_signal_reserved_62_length 20 - #define fl_status_string_signal_reserved_63 "f_signal_reserved_63" + #define fl_status_string_signal_reserved_63 "F_signal_reserved_63" #define fl_status_string_signal_reserved_63_length 20 - #define fl_status_string_signal_reserved_64 "f_signal_reserved_64" + #define fl_status_string_signal_reserved_64 "F_signal_reserved_64" #define fl_status_string_signal_reserved_64_length 20 #endif // _di_fl_status_signals_ #ifndef _di_fl_status_basic_ - #define fl_status_string_none "f_none" + #define fl_status_string_none "F_none" #define fl_status_string_none_length 6 - #define fl_status_string_maybe "f_maybe" + #define fl_status_string_maybe "F_maybe" #define fl_status_string_maybe_length 7 - #define fl_status_string_dummy "f_dummy" + #define fl_status_string_dummy "F_dummy" #define fl_status_string_dummy_length 7 - #define fl_status_string_warn "f_warn" + #define fl_status_string_warn "F_warn" #define fl_status_string_warn_length 6 - #define fl_status_string_block "f_block" + #define fl_status_string_block "F_block" #define fl_status_string_block_length 7 - #define fl_status_string_critical "f_critical" + #define fl_status_string_critical "F_critical" #define fl_status_string_critical_length 10 - #define fl_status_string_unknown "f_unknown" + #define fl_status_string_unknown "F_unknown" #define fl_status_string_unknown_length 9 - #define fl_status_string_unsupported "f_unsupported" + #define fl_status_string_unsupported "F_unsupported" #define fl_status_string_unsupported_length 13 - #define fl_status_string_no_data "f_no_data" - #define fl_status_string_no_data_length 9 + #define fl_status_string_no_data "F_data_not" + #define fl_status_string_no_data_length 10 - #define fl_status_string_no_space "f_no_space" - #define fl_status_string_no_space_length 10 + #define fl_status_string_no_space "F_space_not" + #define fl_status_string_no_space_length 11 - #define fl_status_string_out_of_bound "f_out_of_bound" - #define fl_status_string_out_of_bound_length 14 + #define fl_status_string_bound_out "F_bound_out" + #define fl_status_string_bound_out_length 11 - #define fl_status_string_out_of_memory "f_out_of_memory" - #define fl_status_string_out_of_memory_length 15 + #define fl_status_string_memory_out "F_memory_out" + #define fl_status_string_memory_out_length 12 - #define fl_status_string_prohibited "f_prohibited" + #define fl_status_string_prohibited "F_prohibited" #define fl_status_string_prohibited_length 12 - #define fl_status_string_read_only "f_read_only" + #define fl_status_string_read_only "F_read_only" #define fl_status_string_read_only_length 11 - #define fl_status_string_input_error "f_error_input" - #define fl_status_string_input_error_length 13 + #define fl_status_string_input "F_input" + #define fl_status_string_input_length 7 - #define fl_status_string_output_error "f_error_output" - #define fl_status_string_output_error_length 14 + #define fl_status_string_output "F_output" + #define fl_status_string_output_length 8 - #define fl_status_string_input_output_error "f_error_input_output" - #define fl_status_string_input_output_error_length 20 + #define fl_status_string_input_output "F_input_output" + #define fl_status_string_input_output_length 14 - #define fl_status_string_does_not_exist "f_does_not_exist" - #define fl_status_string_does_not_exist_length 16 + #define fl_status_string_exist_not "F_exist_not" + #define fl_status_string_exist_not_length 11 - #define fl_status_string_not_connected "f_not_connected" - #define fl_status_string_not_connected_length 15 + #define fl_status_string_connected_not "F_connected_not" + #define fl_status_string_connected_not_length 15 - #define fl_status_string_failure "f_failure" + #define fl_status_string_failure "F_failure" #define fl_status_string_failure_length 9 - #define fl_status_string_interrupted "f_interrupted" + #define fl_status_string_interrupted "F_interrupted" #define fl_status_string_interrupted_length 13 - #define fl_status_string_loop "f_loop" + #define fl_status_string_loop "F_loop" #define fl_status_string_loop_length 6 - #define fl_status_string_incomplete "f_incomplete" + #define fl_status_string_incomplete "F_incomplete" #define fl_status_string_incomplete_length 12 - #define fl_status_string_write_only "f_write_only" + #define fl_status_string_write_only "F_write_only" #define fl_status_string_write_only_length 12 #endif // _di_fl_status_basic_ #ifndef _di_fl_status_invalid_ - #define fl_status_string_invalid "f_invalid" - #define fl_status_string_invalid_length 9 + #define fl_status_string_invalid "F_invalid" + #define fl_status_string_length 9 - #define fl_status_string_invalid_name "f_invalid_name" - #define fl_status_string_invalid_name_length 14 + #define fl_status_string_name "F_name" + #define fl_status_string_name_length 6 - #define fl_status_string_invalid_parameter "f_invalid_parameter" - #define fl_status_string_invalid_parameter_length 19 + #define fl_status_string_parameter "F_parameter" + #define fl_status_string_parameter_length 11 - #define fl_status_string_invalid_syntax "f_invalid_syntax" - #define fl_status_string_invalid_syntax_length 16 + #define fl_status_string_syntax "F_syntax" + #define fl_status_string_syntax_length 8 - #define fl_status_string_invalid_data "f_invalid_data" - #define fl_status_string_invalid_data_length 14 + #define fl_status_string_data "F_data" + #define fl_status_string_data_length 6 - #define fl_status_string_invalid_file "f_invalid_file" - #define fl_status_string_invalid_file_length 14 + #define fl_status_string_descriptor "F_descriptor" + #define fl_status_string_descriptor_length 12 - #define fl_status_string_invalid_directory "f_invalid_directory" - #define fl_status_string_invalid_directory_length 19 + #define fl_status_string_socket "F_socket" + #define fl_status_string_socket_length 8 - #define fl_status_string_invalid_descriptor "f_invalid_descriptor" - #define fl_status_string_invalid_descriptor_length 20 + #define fl_status_string_device "F_device" + #define fl_status_string_device_length 8 - #define fl_status_string_invalid_socket "f_invalid_socket" - #define fl_status_string_invalid_socket_length 16 + #define fl_status_string_link "F_link" + #define fl_status_string_link_length 6 - #define fl_status_string_invalid_device "f_invalid_device" - #define fl_status_string_invalid_device_length 16 + #define fl_status_string_pipe "F_pipe" + #define fl_status_string_pipe_length 6 - #define fl_status_string_invalid_link "f_invalid_link" - #define fl_status_string_invalid_link_length 14 + #define fl_status_string_address "F_address" + #define fl_status_string_address_length 9 - #define fl_status_string_invalid_pipe "f_invalid_pipe" - #define fl_status_string_invalid_pipe_length 14 + #define fl_status_string_port "F_port" + #define fl_status_string_port_length 6 - #define fl_status_string_invalid_address "f_invalid_address" - #define fl_status_string_invalid_address_length 17 + #define fl_status_string_value "F_value" + #define fl_status_string_value_length 7 - #define fl_status_string_invalid_port "f_invalid_port" - #define fl_status_string_invalid_port_length 14 + #define fl_status_string_buffer "F_buffer" + #define fl_status_string_buffer_length 8 - #define fl_status_string_invalid_value "f_invalid_value" - #define fl_status_string_invalid_value_length 15 + #define fl_status_string_process "F_process" + #define fl_status_string_process_length 9 - #define fl_status_string_invalid_buffer "f_invalid_buffer" - #define fl_status_string_invalid_buffer_length 16 + #define fl_status_string_utf "F_utf" + #define fl_status_string_utf_length 5 - #define fl_status_string_invalid_process "f_invalid_process" - #define fl_status_string_invalid_process_length 17 + #define fl_status_string_eof "F_eof" + #define fl_status_string_eof_length 5 - #define fl_status_string_invalid_utf "f_invalid_utf" - #define fl_status_string_invalid_utf_length 13 + #define fl_status_string_eol "F_eol" + #define fl_status_string_eol_length 5 - #define fl_status_string_invalid_on_eof "f_invalid_on_eof" - #define fl_status_string_invalid_on_eof_length 16 + #define fl_status_string_eos "F_eos" + #define fl_status_string_eos_length 5 - #define fl_status_string_invalid_on_eol "f_invalid_on_eol" - #define fl_status_string_invalid_on_eol_length 16 - - #define fl_status_string_invalid_on_eos "f_invalid_on_eos" - #define fl_status_string_invalid_on_eos_length 16 - - #define fl_status_string_invalid_on_stop "f_invalid_on_stop" - #define fl_status_string_invalid_on_stop_length 17 + #define fl_status_string_stop "F_stop" + #define fl_status_string_stop_length 6 #endif // _di_fl_status_invalid_ #ifndef _di_fl_status_busy_ - #define fl_status_string_busy "f_busy" + #define fl_status_string_busy "F_busy" #define fl_status_string_busy_length 6 - #define fl_status_string_busy_address "f_busy_address" + #define fl_status_string_busy_address "F_busy_address" #define fl_status_string_busy_address_length 14 - #define fl_status_string_busy_port "f_busy_port" + #define fl_status_string_busy_port "F_busy_port" #define fl_status_string_busy_port_length 11 - #define fl_status_string_busy_socket "f_busy_socket" + #define fl_status_string_busy_socket "F_busy_socket" #define fl_status_string_busy_socket_length 13 - #define fl_status_string_busy_device "f_busy_device" + #define fl_status_string_busy_device "F_busy_device" #define fl_status_string_busy_device_length 13 - #define fl_status_string_busy_pipe "f_busy_pipe" + #define fl_status_string_busy_pipe "F_busy_pipe" #define fl_status_string_busy_pipe_length 11 - #define fl_status_string_busy_buffer "f_busy_buffer" + #define fl_status_string_busy_buffer "F_busy_buffer" #define fl_status_string_busy_buffer_length 13 - #define fl_status_string_busy_process "f_busy_process" + #define fl_status_string_busy_process "F_busy_process" #define fl_status_string_busy_process_length 14 #endif // _di_fl_status_busy_ #ifndef _di_fl_status_unavailable_ - #define fl_status_string_unavailable "f_unavailable" + #define fl_status_string_unavailable "F_unavailable" #define fl_status_string_unavailable_length 13 - #define fl_status_string_unavailable_address "f_unavailable_address" + #define fl_status_string_unavailable_address "F_unavailable_address" #define fl_status_string_unavailable_address_length 21 - #define fl_status_string_unavailable_port "f_unavailable_port" + #define fl_status_string_unavailable_port "F_unavailable_port" #define fl_status_string_unavailable_port_length 18 - #define fl_status_string_unavailable_socket "f_unavailable_socket" + #define fl_status_string_unavailable_socket "F_unavailable_socket" #define fl_status_string_unavailable_socket_length 20 - #define fl_status_string_unavailable_device "f_unavailable_device" + #define fl_status_string_unavailable_device "F_unavailable_device" #define fl_status_string_unavailable_device_length 20 - #define fl_status_string_unavailable_pipe "f_unavailable_pipe" + #define fl_status_string_unavailable_pipe "F_unavailable_pipe" #define fl_status_string_unavailable_pipe_length 18 - #define fl_status_string_unavailable_buffer "f_unavailable_buffer" + #define fl_status_string_unavailable_buffer "F_unavailable_buffer" #define fl_status_string_unavailable_buffer_length 20 - #define fl_status_string_unavailable_process "f_unavailable_process" + #define fl_status_string_unavailable_process "F_unavailable_process" #define fl_status_string_unavailable_process_length 21 #endif // _di_fl_status_unavailable_ #ifndef _di_fl_status_digits_ - #define fl_status_string_underflow "f_number_underflow" + #define fl_status_string_underflow "F_number_underflow" #define fl_status_string_underflow_length 18 - #define fl_status_string_overflow "f_number_overflow" + #define fl_status_string_overflow "F_number_overflow" #define fl_status_string_overflow_length 17 - #define fl_status_string_divide_by_zero "f_number_divide_by_zero" + #define fl_status_string_divide_by_zero "F_number_divide_by_zero" #define fl_status_string_divide_by_zero_length 23 - #define fl_status_string_negative_number "f_number_negative" + #define fl_status_string_negative_number "F_number_negative" #define fl_status_string_negative_number_length 17 - #define fl_status_string_positive_number "f_number_positive" + #define fl_status_string_positive_number "F_number_positive" #define fl_status_string_positive_number_length 17 - #define fl_status_string_zero_number "f_number_zero" + #define fl_status_string_zero_number "F_number_zero" #define fl_status_string_zero_number_length 13 - #define fl_status_string_decimal_number "f_number_decimal" + #define fl_status_string_decimal_number "F_number_decimal" #define fl_status_string_decimal_number_length 16 - #define fl_status_string_whole_number "f_number_whole" + #define fl_status_string_whole_number "F_number_whole" #define fl_status_string_whole_number_length 14 - #define fl_status_string_invalid_number "f_number_invalid" - #define fl_status_string_invalid_number_length 16 + #define fl_status_string_number "F_number_invalid" + #define fl_status_string_number_length 16 #endif // _di_fl_status_digits_ #ifndef _di_fl_status_buffers_ - #define fl_status_string_no_data_on_eof "f_no_data_on_eof" - #define fl_status_string_no_data_on_eof_length 16 + #define fl_status_string_data_no_eof "F_data_no_eof" + #define fl_status_string_data_no_eof_length 13 - #define fl_status_string_no_data_on_eol "f_no_data_on_eol" - #define fl_status_string_no_data_on_eol_length 16 + #define fl_status_string_data_no_eol "F_data_no_eol" + #define fl_status_string_data_no_eol_length 13 - #define fl_status_string_no_data_on_eos "f_no_data_on_eos" - #define fl_status_string_no_data_on_eos_length 16 + #define fl_status_string_data_no_eos "F_data_no_eos" + #define fl_status_string_data_no_eos_length 13 - #define fl_status_string_none_on_eof "f_none_on_eof" - #define fl_status_string_none_on_eof_length 13 + #define fl_status_string_none_eof "F_none_eof" + #define fl_status_string_none_eof_length 10 - #define fl_status_string_no_data_on_stop "f_no_data_on_stop" - #define fl_status_string_no_data_on_stop_length 17 + #define fl_status_string_data_no_stop "F_data_no_stop" + #define fl_status_string_data_no_stop_length 14 - #define fl_status_string_no_data_on_block "f_no_data_on_block" - #define fl_status_string_no_data_on_block_length 18 + #define fl_status_string_data_no_block "F_data_block_no" + #define fl_status_string_data_no_block_length 15 - #define fl_status_string_none_on_eol "f_none_on_eol" - #define fl_status_string_none_on_eol_length 13 + #define fl_status_string_none_eol "F_none_eol" + #define fl_status_string_none_eol_length 10 - #define fl_status_string_none_on_eos "f_none_on_eos" - #define fl_status_string_none_on_eos_length 13 + #define fl_status_string_none_eos "F_none_eos" + #define fl_status_string_none_eos_length 10 - #define fl_status_string_none_on_stop "f_none_on_stop" - #define fl_status_string_none_on_stop_length 14 + #define fl_status_string_none_stop "F_none_stop" + #define fl_status_string_none_stop_length 11 - #define fl_status_string_none_on_block "f_none_on_block" - #define fl_status_string_none_on_block_length 15 + #define fl_status_string_none_block "F_none_block" + #define fl_status_string_none_block_length 12 - #define fl_status_string_error_on_eof "f_error_on_eof" - #define fl_status_string_error_on_eof_length 14 + #define fl_status_string_eof "F_eof" + #define fl_status_string_eof_length 5 - #define fl_status_string_error_on_eol "f_error_on_eol" - #define fl_status_string_error_on_eol_length 14 + #define fl_status_string_eol "F_eol" + #define fl_status_string_eol_length 5 - #define fl_status_string_error_on_eos "f_error_on_eos" - #define fl_status_string_error_on_eos_length 14 + #define fl_status_string_error_on_eos "F_eos" + #define fl_status_string_error_on_eos_length 5 - #define fl_status_string_error_on_stop "f_error_on_stop" - #define fl_status_string_error_on_stop_length 15 + #define fl_status_string_stop "F_stop" + #define fl_status_string_stop_length 6 - #define fl_status_string_error_on_block "f_error_on_block" - #define fl_status_string_error_on_block_length 16 + #define fl_status_string_block "F_block" + #define fl_status_string_block_length 7 - #define fl_status_string_buffer_too_small "f_buffer_too_small" + #define fl_status_string_buffer_too_small "F_buffer_too_small" #define fl_status_string_buffer_too_small_length 18 - #define fl_status_string_buffer_too_large "f_buffer_too_large" + #define fl_status_string_buffer_too_large "F_buffer_too_large" #define fl_status_string_buffer_too_large_length 18 - #define fl_status_string_string_too_small "f_string_too_small" + #define fl_status_string_string_too_small "F_string_too_small" #define fl_status_string_string_too_small_length 18 - #define fl_status_string_string_too_large "f_string_too_large" + #define fl_status_string_string_too_large "F_string_too_large" #define fl_status_string_string_too_large_length 18 - #define fl_status_string_unterminated "f_unterminated" + #define fl_status_string_unterminated "F_unterminated" #define fl_status_string_unterminated_length 14 - #define fl_status_string_unterminated_on_eof "f_unterminated_on_eof" - #define fl_status_string_unterminated_on_eof_length 21 + #define fl_status_string_unterminated_eof "F_unterminated_eof" + #define fl_status_string_unterminated_eof_length 18 - #define fl_status_string_unterminated_on_eol "f_unterminated_on_eol" - #define fl_status_string_unterminated_on_eol_length 21 + #define fl_status_string_unterminated_eol "F_unterminated_eol" + #define fl_status_string_unterminated_eol_length 18 - #define fl_status_string_unterminated_on_eos "f_unterminated_on_eos" - #define fl_status_string_unterminated_on_eos_length 21 + #define fl_status_string_unterminated_eos "F_unterminated_eos" + #define fl_status_string_unterminated_eos_length 18 - #define fl_status_string_unterminated_on_stop "f_unterminated_on_stop" - #define fl_status_string_unterminated_on_stop_length 22 + #define fl_status_string_unterminated_stop "F_unterminated_stop" + #define fl_status_string_unterminated_stop_length 19 - #define fl_status_string_unterminated_on_block "f_unterminated_on_block" - #define fl_status_string_unterminated_on_block_length 23 + #define fl_status_string_unterminated_block "F_unterminated_block" + #define fl_status_string_unterminated_block_length 20 - #define fl_status_string_unterminated_group "f_unterminated_group" + #define fl_status_string_unterminated_group "F_unterminated_group" #define fl_status_string_unterminated_group_length 20 - #define fl_status_string_unterminated_group_on_eof "f_unterminated_group_on_eof" - #define fl_status_string_unterminated_group_on_eof_length 27 + #define fl_status_string_unterminated_group_on_eof "F_unterminated_group_eof" + #define fl_status_string_unterminated_group_on_eof_length 24 - #define fl_status_string_unterminated_group_on_eol "f_unterminated_group_on_eol" - #define fl_status_string_unterminated_group_on_eol_length 27 + #define fl_status_string_unterminated_group_on_eol "F_unterminated_group_eol" + #define fl_status_string_unterminated_group_on_eol_length 24 - #define fl_status_string_unterminated_group_on_eos "f_unterminated_group_on_eos" - #define fl_status_string_unterminated_group_on_eos_length 27 + #define fl_status_string_unterminated_group_on_eos "F_unterminated_group_eos" + #define fl_status_string_unterminated_group_on_eos_length 24 - #define fl_status_string_unterminated_group_on_stop "f_unterminated_group_on_stop" - #define fl_status_string_unterminated_group_on_stop_length 28 + #define fl_status_string_unterminated_group_on_stop "F_unterminated_group_stop" + #define fl_status_string_unterminated_group_on_stop_length 25 - #define fl_status_string_unterminated_group_on_block "f_unterminated_group_on_block" - #define fl_status_string_unterminated_group_on_block_length 29 + #define fl_status_string_unterminated_group_on_block "F_unterminated_group_block" + #define fl_status_string_unterminated_group_on_block_length 26 - #define fl_status_string_unterminated_nest "f_unterminated_nest" + #define fl_status_string_unterminated_nest "F_unterminated_nest" #define fl_status_string_unterminated_nest_length 19 - #define fl_status_string_unterminated_nest_on_eof "f_unterminated_nest_on_eof" - #define fl_status_string_unterminated_nest_on_eof_length 26 + #define fl_status_string_unterminated_nest_eof "F_unterminated_nest_eof" + #define fl_status_string_unterminated_nest_eof_length 23 - #define fl_status_string_unterminated_nest_on_eol "f_unterminated_nest_on_eol" - #define fl_status_string_unterminated_nest_on_eol_length 26 + #define fl_status_string_unterminated_nest_eol "F_unterminated_nest_eol" + #define fl_status_string_unterminated_nest_eol_length 23 - #define fl_status_string_unterminated_nest_on_eos "f_unterminated_nest_on_eos" - #define fl_status_string_unterminated_nest_on_eos_length 26 + #define fl_status_string_unterminated_nest_eos "F_unterminated_nest_eos" + #define fl_status_string_unterminated_nest_eos_length 23 - #define fl_status_string_unterminated_nest_on_stop "f_unterminated_nest_on_stop" - #define fl_status_string_unterminated_nest_on_stop_length 27 + #define fl_status_string_unterminated_nest_stop "F_unterminated_nest_stop" + #define fl_status_string_unterminated_nest_stop_length 24 - #define fl_status_string_unterminated_nest_on_block "f_unterminated_nest_on_block" - #define fl_status_string_unterminated_nest_on_block_length 28 + #define fl_status_string_unterminated_nest_block "F_unterminated_nest_block" + #define fl_status_string_unterminated_nest_block_length 25 - #define fl_status_string_incomplete_utf "f_incomplete_utf" + #define fl_status_string_incomplete_utf "F_incomplete_utf" #define fl_status_string_incomplete_utf_length 16 - #define fl_status_string_incomplete_utf_on_eof "f_incomplete_utf_on_eof" - #define fl_status_string_incomplete_utf_on_eof_length 23 + #define fl_status_string_incomplete_utf_on_eof "F_incomplete_utf_eof" + #define fl_status_string_incomplete_utf_on_eof_length 20 - #define fl_status_string_incomplete_utf_on_eol "f_incomplete_utf_on_eol" - #define fl_status_string_incomplete_utf_on_eol_length 23 + #define fl_status_string_incomplete_utf_on_eol "F_incomplete_utf_eol" + #define fl_status_string_incomplete_utf_on_eol_length 20 - #define fl_status_string_incomplete_utf_on_eos "f_incomplete_utf_on_eos" - #define fl_status_string_incomplete_utf_on_eos_length 23 + #define fl_status_string_incomplete_utf_on_eos "F_incomplete_utf_eos" + #define fl_status_string_incomplete_utf_on_eos_length 20 - #define fl_status_string_incomplete_utf_on_stop "f_incomplete_utf_on_stop" - #define fl_status_string_incomplete_utf_on_stop_length 24 + #define fl_status_string_incomplete_utf_on_stop "F_incomplete_utf_stop" + #define fl_status_string_incomplete_utf_on_stop_length 21 - #define fl_status_string_incomplete_utf_on_block "f_incomplete_utf_on_block" - #define fl_status_string_incomplete_utf_on_block_length 25 + #define fl_status_string_incomplete_utf_on_block "F_incomplete_utf_block" + #define fl_status_string_incomplete_utf_on_block_length 22 #endif // _di_fl_status_buffers_ #ifndef _di_fl_status_allocation_ - #define fl_status_string_allocation_error "f_error_allocation" - #define fl_status_string_allocation_error_length 18 + #define fl_status_string_memory_allocation "F_memory_allocation" + #define fl_status_string_memory_deallocation "F_memory_deallocation" + #define fl_status_string_memory_reallocation "F_memory_reallocation" - #define fl_status_string_reallocation_error "f_error_reallocation" - #define fl_status_string_reallocation_error_length 20 + #define fl_status_string_memory_allocation_length 19 + #define fl_status_string_memory_deallocation_length 21 + #define fl_status_string_memory_reallocation_length 21 - #define fl_status_string_deallocation_error "f_error_deallocation" - #define fl_status_string_deallocation_error_length 20 #endif // _di_fl_status_allocation_ #ifndef _di_fl_status_fork_ - #define fl_status_string_fork_failed "f_fork_failed" - #define fl_status_string_fork_failed_length 13 + #define fl_status_string_fork "F_fork" + #define fl_status_string_process_too_many "F_process_too_many" - #define fl_status_string_too_many_processes "f_too_many_processes" - #define fl_status_string_too_many_processes_length 20 + #define fl_status_string_fork_length 6 + #define fl_status_string_process_too_many_length 20 #endif // _di_fl_status_fork_ #ifndef _di_fl_status_file_ - #define fl_status_string_file_closed "f_file_closed" + #define fl_status_string_file "F_file" + #define fl_status_string_file_length 6 + + #define fl_status_string_file_closed "F_file_closed" #define fl_status_string_file_closed_length 13 - #define fl_status_string_file_seek_error "f_file_error_seek" - #define fl_status_string_file_seek_error_length 17 + #define fl_status_string_file_seek "F_file_seek" + #define fl_status_string_file_seek_length 11 - #define fl_status_string_file_read_error "f_file_error_read" - #define fl_status_string_file_read_error_length 17 + #define fl_status_string_file_read "F_file_read" + #define fl_status_string_file_read_length 11 - #define fl_status_string_file_write_error "f_file_error_write" - #define fl_status_string_file_write_error_length 18 + #define fl_status_string_file_write "F_file_write" + #define fl_status_string_file_write_length 12 - #define fl_status_string_file_flush_error "f_file_error_flush" - #define fl_status_string_file_flush_error_length 18 + #define fl_status_string_file_flush "F_file_flush" + #define fl_status_string_file_flush_length 12 - #define fl_status_string_file_purge_error "f_file_error_purge" - #define fl_status_string_file_purge_error_length 18 + #define fl_status_string_file_purge "F_file_purge" + #define fl_status_string_file_purge_length 12 - #define fl_status_string_file_open_error "f_file_error_open" - #define fl_status_string_file_open_error_length 17 + #define fl_status_string_file_open "F_file_open" + #define fl_status_string_file_open_length 11 - #define fl_status_string_file_close_error "f_file_error_close" - #define fl_status_string_file_close_error_length 18 + #define fl_status_string_file_close "F_file_close" + #define fl_status_string_file_close_length 12 - #define fl_status_string_file_synchronize_error "f_file_error_synchronize" - #define fl_status_string_file_synchronize_error_length 24 + #define fl_status_string_file_synchronize "F_file_synchronize" + #define fl_status_string_file_synchronize_length 18 - #define fl_status_string_file_descriptor_error "f_file_error_descriptor" - #define fl_status_string_file_descriptor_error_length 23 + #define fl_status_string_file_descriptor "F_file_descriptor" + #define fl_status_string_file_descriptor_length 17 - #define fl_status_string_file_not_found "f_file_not_found" - #define fl_status_string_file_not_found_length 16 + #define fl_status_string_file_found_not "F_file_found_not" + #define fl_status_string_file_found_not_length 16 - #define fl_status_string_file_empty "f_file_empty" + #define fl_status_string_file_empty "F_file_empty" #define fl_status_string_file_empty_length 12 - #define fl_status_string_file_found "f_file_found" + #define fl_status_string_file_found "F_file_found" #define fl_status_string_file_found_length 12 - #define fl_status_string_file_is_type_block "f_file_is_type_block" - #define fl_status_string_file_is_type_block_length 20 + #define fl_status_string_file_type_block "F_file_type_block" + #define fl_status_string_file_type_block_length 17 - #define fl_status_string_file_is_type_character "f_file_is_type_character" - #define fl_status_string_file_is_type_character_length 24 + #define fl_status_string_file_type_character "F_file_type_character" + #define fl_status_string_file_type_character_length 21 - #define fl_status_string_file_is_type_directory "f_file_is_type_directory" - #define fl_status_string_file_is_type_directory_length 24 + #define fl_status_string_file_type_directory "F_file_type_directory" + #define fl_status_string_file_type_directory_length 21 - #define fl_status_string_file_is_type_file "f_file_is_type_file" - #define fl_status_string_file_is_type_file_length 19 + #define fl_status_string_file_type_file "F_file_type_file" + #define fl_status_string_file_type_file_length 16 - #define fl_status_string_file_is_type_link "f_file_is_type_link" - #define fl_status_string_file_is_type_link_length 19 + #define fl_status_string_file_type_link "F_file_type_link" + #define fl_status_string_file_type_link_length 16 - #define fl_status_string_file_is_type_pipe "f_file_is_type_pipe" - #define fl_status_string_file_is_type_pipe_length 19 + #define fl_status_string_file_type_pipe "F_file_type_pipe" + #define fl_status_string_file_type_pipe_length 16 - #define fl_status_string_file_is_type_socket "f_file_is_type_socket" - #define fl_status_string_file_is_type_socket_length 21 + #define fl_status_string_file_type_socket "F_file_type_socket" + #define fl_status_string_file_type_socket_length 18 - #define fl_status_string_file_is_type_unknown "f_file_is_type_unknown" - #define fl_status_string_file_is_type_unknown_length 22 + #define fl_status_string_file_type_unknown "F_file_type_unknown" + #define fl_status_string_file_type_unknown_length 19 - #define fl_status_string_file_not_open "f_file_not_open" - #define fl_status_string_file_not_open_length 15 + #define fl_status_string_file_open_not "F_file_open_not" + #define fl_status_string_file_open_not_length 15 - #define fl_status_string_file_not_type_block "f_file_not_type_block" - #define fl_status_string_file_not_type_block_length 21 + #define fl_status_string_file_type_not_block "F_file_type_not_block" + #define fl_status_string_file_type_not_block_length 21 - #define fl_status_string_file_not_type_character "f_file_not_type_character" - #define fl_status_string_file_not_type_character_length 25 + #define fl_status_string_file_type_not_character "F_file_type_not_character" + #define fl_status_string_file_type_not_character_length 25 - #define fl_status_string_file_not_type_directory "f_file_not_type_directory" + #define fl_status_string_file_not_type_directory "F_file_type_not_directory" #define fl_status_string_file_not_type_directory_length 25 - #define fl_status_string_file_not_type_file "f_file_not_type_file" + #define fl_status_string_file_not_type_file "F_file_type_not_file" #define fl_status_string_file_not_type_file_length 20 - #define fl_status_string_file_not_type_link "f_file_not_type_link" + #define fl_status_string_file_not_type_link "F_file_type_not_link" #define fl_status_string_file_not_type_link_length 20 - #define fl_status_string_file_not_type_pipe "f_file_not_type_pipe" + #define fl_status_string_file_not_type_pipe "F_file_type_not_pipe" #define fl_status_string_file_not_type_pipe_length 20 - #define fl_status_string_file_not_type_socket "f_file_not_type_socket" + #define fl_status_string_file_not_type_socket "F_file_type_not_socket" #define fl_status_string_file_not_type_socket_length 22 - #define fl_status_string_file_not_type_unknown "f_file_not_type_unknown" + #define fl_status_string_file_not_type_unknown "F_file_type_not_unknown" #define fl_status_string_file_not_type_unknown_length 23 - #define fl_status_string_file_allocation_error "f_file_error_allocation" - #define fl_status_string_file_allocation_error_length 23 - - #define fl_status_string_file_reallocation_error "f_file_error_reallocation" - #define fl_status_string_file_reallocation_error_length 25 + #define fl_status_string_file_allocation "F_file_allocation" + #define fl_status_string_file_allocation_length 17 - #define fl_status_string_file_deallocation_error "f_file_error_deallocation" - #define fl_status_string_file_deallocation_error_length 25 + #define fl_status_string_file_reallocation "F_file_reallocation" + #define fl_status_string_file_reallocation_length 19 - #define fl_status_string_file_stat_error "f_file_error_stat" - #define fl_status_string_file_stat_error_length 17 + #define fl_status_string_file_deallocation "F_file_deallocation" + #define fl_status_string_file_deallocation_length 19 - #define fl_status_string_file_error "f_file_error" - #define fl_status_string_file_error_length 12 + #define fl_status_string_file_stat "F_file_stat" + #define fl_status_string_file_stat_length 11 - #define fl_status_string_file_not_utf "f_file_not_utf" + #define fl_status_string_file_not_utf "F_file_not_utf" #define fl_status_string_file_not_utf_length 14 - #define fl_status_string_file_max_descriptors "f_file_max_descriptors" - #define fl_status_string_file_max_descriptors_length 22 + #define fl_status_string_file_descriptors_max "F_file_descriptors_max" + #define fl_status_string_file_descriptors_max_length 22 - #define fl_status_string_file_max_open "f_file_max_open" - #define fl_status_string_file_max_open_length 15 + #define fl_status_string_file_open_max "F_file_open_max" + #define fl_status_string_file_open_max_length 15 - #define fl_status_string_file_utf "f_file_utf" + #define fl_status_string_file_utf "F_file_utf" #define fl_status_string_file_utf_length 10 #endif // _di_fl_status_file_ #ifndef _di_f_status_filesystem_ - #define fl_status_string_filesystem_error "f_filesystem_error" + #define fl_status_string_filesystem_error "F_filesystem" #define fl_status_string_filesystem_error_length 18 - #define fl_status_string_filesystem_quota_blocks "f_filesystem_quota_blocks" + #define fl_status_string_filesystem_quota_blocks "F_filesystem_quota_blocks" #define fl_status_string_filesystem_quota_blocks_length 25 - #define fl_status_string_filesystem_quota_reached "f_filesystem_quota_reached" + #define fl_status_string_filesystem_quota_reached "F_filesystem_quota_reached" #define fl_status_string_filesystem_quota_reached_length 26 #endif // _di_f_status_filesystem_ #ifndef _di_fl_status_directory_ - #define fl_status_string_directory_closed "f_directory_closed" + #define fl_status_string_directory_closed "F_directory_closed" #define fl_status_string_directory_closed_length 18 - #define fl_status_string_directory_read_error "f_directory_error_read" - #define fl_status_string_directory_read_error_length 22 + #define fl_status_string_directory_read "F_directory_read" + #define fl_status_string_directory_read_length 16 - #define fl_status_string_directory_write_error "f_directory_error_write" - #define fl_status_string_directory_write_error_length 23 + #define fl_status_string_directory_write "F_directory_write" + #define fl_status_string_directory_write_length 17 - #define fl_status_string_directory_flush_error "f_directory_error_flush" - #define fl_status_string_directory_flush_error_length 23 + #define fl_status_string_directory_flush "F_directory_flush" + #define fl_status_string_directory_flush_length 17 - #define fl_status_string_directory_error_link_max "f_directory_error_link_max" - #define fl_status_string_directory_error_link_max_length 26 + #define fl_status_string_directory_link_max "F_directory_link_max" + #define fl_status_string_directory_link_max_length 20 - #define fl_status_string_directory_purge_error "f_directory_error_purge" - #define fl_status_string_directory_purge_error_length 23 + #define fl_status_string_directory_purge "F_directory_purge" + #define fl_status_string_directory_purge_length 17 - #define fl_status_string_directory_open_error "f_directory_error_open" - #define fl_status_string_directory_open_error_length 22 + #define fl_status_string_directory_open "F_directory_open" + #define fl_status_string_directory_open_length 16 - #define fl_status_string_directory_close_error "f_directory_error_close" - #define fl_status_string_directory_close_error_length 23 + #define fl_status_string_directory_close "F_directory_close" + #define fl_status_string_directory_close_length 17 - #define fl_status_string_directory_synchronize_error "f_directory_error_synchronize" - #define fl_status_string_directory_synchronize_error_length 29 + #define fl_status_string_directory_synchronize "F_directory_synchronize" + #define fl_status_string_directory_synchronize_length 23 - #define fl_status_string_directory_descriptor_error "f_directory_error_descriptor" - #define fl_status_string_directory_descriptor_error_length 28 + #define fl_status_string_directory_descriptor "F_directory_descriptor" + #define fl_status_string_directory_descriptor_length 22 - #define fl_status_string_directory_empty "f_directory_empty" + #define fl_status_string_directory_empty "F_directory_empty" #define fl_status_string_directory_empty_length 17 - #define fl_status_string_directory_found "f_directory_found" + #define fl_status_string_directory_found "F_directory_found" #define fl_status_string_directory_found_length 17 - #define fl_status_string_directory_not_found "f_directory_not_found" + #define fl_status_string_directory_not_found "F_directory_not_found" #define fl_status_string_directory_not_found_length 21 - #define fl_status_string_directory_not_open "f_directory_not_open" + #define fl_status_string_directory_not_open "F_directory_not_open" #define fl_status_string_directory_not_open_length 20 - #define fl_status_string_directory_error "f_directory_error" - #define fl_status_string_directory_error_length 17 + #define fl_status_string_directory "F_directory" + #define fl_status_string_directory_length 11 - #define fl_status_string_directory_not_utf "f_directory_not_utf" + #define fl_status_string_directory_not_utf "F_directory_utf_not" #define fl_status_string_directory_not_utf_length 19 - #define fl_status_string_directory_error_unsupported "f_directory_error_unsupported" - #define fl_status_string_directory_error_unsupported_length 19 + #define fl_status_string_directory_unsupported "F_directory_unsupported" + #define fl_status_string_directory_unsupported_length 23 - #define fl_status_string_directory_error_stream "f_directory_error_stream" - #define fl_status_string_directory_error_stream_length 19 + #define fl_status_string_directory_stream "F_directory_stream" + #define fl_status_string_directory_stream_length 18 - #define fl_status_string_directory_utf "f_directory_utf" + #define fl_status_string_directory_utf "F_directory_utf" #define fl_status_string_directory_utf_length 15 #endif // _di_fl_status_directory_ #ifndef _di_fl_status_socket_ - #define fl_status_string_socket_connection_client_error "f_socket_error_connection_client" - #define fl_status_string_socket_connection_client_error_length 32 + #define fl_status_string_socket_connection_client "F_socket_connection_client" + #define fl_status_string_socket_connection_client_length 26 - #define fl_status_string_socket_connection_target_error "f_socket_error_connection_target" - #define fl_status_string_socket_connection_target_error_length 32 + #define fl_status_string_socket_connection_target "F_socket_connection_target" + #define fl_status_string_socket_connection_target_length 26 - #define fl_status_string_socket_receive_error "f_socket_error_receive" - #define fl_status_string_socket_receive_error_length 22 + #define fl_status_string_socket_receive "F_socket_receive" + #define fl_status_string_socket_receive_length 16 - #define fl_status_string_socket_send_error "f_socket_error_send" - #define fl_status_string_socket_send_error_length 19 + #define fl_status_string_socket_send "F_socket_send" + #define fl_status_string_socket_send_length 13 #endif // _di_fl_status_socket_ #ifndef _di_fl_status_non_ - #define fl_status_string_less_than "f_less_than" - #define fl_status_string_less_than_length 11 + #define fl_status_string_than_less "F_than_less" + #define fl_status_string_than_less_length 11 - #define fl_status_string_equal_to "f_equal_to" + #define fl_status_string_equal_to "F_equal_to" #define fl_status_string_equal_to_length 10 - #define fl_status_string_not_equal_to "f_not_equal_to" - #define fl_status_string_not_equal_to_length 14 + #define fl_status_string_equal_to_not "F_equal_to_not" + #define fl_status_string_equal_to_not_length 14 - #define fl_status_string_greater_than "f_greater_than" - #define fl_status_string_greater_than_length 14 + #define fl_status_string_than_greater "F_than_greater" + #define fl_status_string_than_greater_length 14 #endif // _di_fl_status_non_ #ifndef _di_fl_status_access_denied_ - #define fl_status_string_access_denied "f_access_denied" + #define fl_status_string_access_denied "F_access_denied" #define fl_status_string_access_denied_length 15 - #define fl_status_string_access_denied_user "f_access_denied_user" + #define fl_status_string_access_denied_user "F_access_denied_user" #define fl_status_string_access_denied_user_length 20 - #define fl_status_string_access_denied_group "f_access_denied_group" + #define fl_status_string_access_denied_group "F_access_denied_group" #define fl_status_string_access_denied_group_length 21 - #define fl_status_string_access_denied_world "f_access_denied_world" + #define fl_status_string_access_denied_world "F_access_denied_world" #define fl_status_string_access_denied_world_length 21 - #define fl_status_string_access_denied_read "f_access_denied_read" + #define fl_status_string_access_denied_read "F_access_denied_read" #define fl_status_string_access_denied_read_length 20 - #define fl_status_string_access_denied_write "f_access_denied_write" + #define fl_status_string_access_denied_write "F_access_denied_write" #define fl_status_string_access_denied_write_length 21 - #define fl_status_string_access_denied_execute "f_access_denied_execute" + #define fl_status_string_access_denied_execute "F_access_denied_execute" #define fl_status_string_access_denied_execute_length 23 - #define fl_status_string_access_denied_super "f_access_denied_super" + #define fl_status_string_access_denied_super "F_access_denied_super" #define fl_status_string_access_denied_super_length 21 #endif // _di_fl_status_access_denied_ - #define fl_status_string_status_code_last "f_status_code_last" + #define fl_status_string_status_code_last "F_status_code_last" #define fl_status_string_status_code_last_length 17 #endif // _di_fl_status_string_ @@ -854,9 +848,9 @@ extern "C" { * The processed code code. * * @return - * f_none on success. - * f_invalid_data (with error bit) if there status is unknown. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data (with error bit) if there status is unknown. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_status_to_string_ extern f_return_status fl_status_to_string(const f_status code, f_string *string); diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index b1ed1ab..1406484 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -7,29 +7,29 @@ extern "C" { #if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) f_return_status private_fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) { - if (destination->used + length > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; const f_string_length total = destination->used + length; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source, length); destination->used = total; - return f_none; + return F_none; } #endif // !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) #if !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) f_return_status private_fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { - if (destination->used + length > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; f_string_length first = 0; @@ -38,13 +38,13 @@ extern "C" { if (i > first) { f_string_length size = i - first; - if (destination->used + size > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); f_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source + first, size); @@ -59,13 +59,13 @@ extern "C" { if (i > first) { f_string_length size = i - first; - if (destination->used + size > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); f_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source + first, size); @@ -82,7 +82,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // !defined(_di_fl_string_append_nulless_) || !defined(_di_fl_string_dynamic_append_nulless_) || !defined(_di_fl_string_mash_nulless_) || !defined(_di_fl_string_dynamic_mash_nulless_) @@ -100,19 +100,19 @@ extern "C" { while (i2 < stop2 && string2[i2] == 0) i2++; if (i2 == stop2) break; - if (string1[i1] != string2[i2]) return f_not_equal_to; + if (string1[i1] != string2[i2]) return F_equal_to_not; } // for - // only return f_equal_to if all remaining characters are NULL. + // only return F_equal_to if all remaining characters are NULL. for (; i1 < stop1; i1++) { - if (string1[i1] != 0) return f_not_equal_to; + if (string1[i1] != 0) return F_equal_to_not; } // for for (; i2 < stop2; i2++) { - if (string2[i2] != 0) return f_not_equal_to; + if (string2[i2] != 0) return F_equal_to_not; } // for - return f_equal_to; + return F_equal_to; } #endif // !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_) @@ -123,7 +123,7 @@ extern "C" { uint8_t width = 0; uint8_t width_max = 0; - f_status status = f_none; + f_status status = F_none; // skip past leading whitespace in string1. for (; i1 < stop1; i1 += width) { @@ -133,13 +133,13 @@ extern "C" { width_max = (stop1 - i1) + 1; status = f_utf_is_whitespace(string1 + i1, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_false) break; + if (status == F_false) break; width = f_macro_utf_byte_width(string1[i1]); } // for @@ -152,15 +152,15 @@ extern "C" { width_max = (stop2 - i2) + 1; status = f_utf_is_whitespace(string2 + i2, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) { - return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) { + return F_status_set_error(F_utf); } return status; } - if (status == f_false) break; + if (status == F_false) break; width = f_macro_utf_byte_width(string2[i2]); } // for @@ -181,15 +181,15 @@ extern "C" { width_max = (stop1 - j) + 1; status = f_utf_is_whitespace(string1 + j, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } width = f_macro_utf_byte_width(string1[j]); - if (status == f_false) { + if (status == F_false) { last1 = j; size1++; } @@ -203,21 +203,21 @@ extern "C" { width_max = (stop2 - j) + 1; status = f_utf_is_whitespace(string2 + j, width_max); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } width = f_macro_utf_byte_width(string2[j]); - if (status == f_false) { + if (status == F_false) { last2 = j; size2++; } } // for - if (size1 != size2) return f_not_equal_to; + if (size1 != size2) return F_equal_to_not; } for (; i1 < last1 && i2 < last2; i1++, i2++) { @@ -229,35 +229,35 @@ extern "C" { while (i2 < last2 && string2[i2] == 0) i2++; if (i2 == last2) break; - if (string1[i1] != string2[i2]) return f_not_equal_to; + if (string1[i1] != string2[i2]) return F_equal_to_not; } // for - // only return f_equal_to if all remaining characters are NULL. + // only return F_equal_to if all remaining characters are NULL. while (i1 < last1) { - if (string1[i1] != 0) return f_not_equal_to; + if (string1[i1] != 0) return F_equal_to_not; i1++; } // while while (i2 < last2) { - if (string2[i2] != 0) return f_not_equal_to; + if (string2[i2] != 0) return F_equal_to_not; i2++; } // while - return f_equal_to; + return F_equal_to; } #endif // !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_) #if !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) f_return_status private_fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) { - if (destination->used + length > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; const f_string_length total = destination->used + length; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } if (destination->used > 0) { @@ -269,15 +269,15 @@ extern "C" { } destination->used = total; - return f_none; + return F_none; } #endif // !defined(_di_fl_string_prepend_) || !defined(_di_fl_string_dynamic_prepend_) #if !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) f_return_status private_fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { - if (destination->used + length > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_string_length_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; f_string_length first = 0; f_string_length offset = 0; @@ -287,13 +287,13 @@ extern "C" { if (i > first) { f_string_length size = i - first; - if (destination->used + size > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); f_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); @@ -311,14 +311,14 @@ extern "C" { if (i > first) { f_string_length size = i - first; - if (destination->used + size > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_string_length_size) return F_status_set_error(F_string_too_large); f_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); @@ -338,7 +338,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // !defined(_di_fl_string_prepend_nulless_) || !defined(_di_fl_string_dynamic_prepend_nulless_) @@ -346,7 +346,7 @@ extern "C" { f_return_status private_fl_string_rip_find_range(const f_string source, f_string_length *start, f_string_length *stop) { f_string_length stop_original = *stop; - f_status status = f_none; + f_status status = F_none; uint8_t width = 0; @@ -357,13 +357,13 @@ extern "C" { if (*start > *stop) break; status = f_utf_is_whitespace(source + *start, (*stop - *start) + 1); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_false) break; + if (status == F_false) break; width = f_macro_utf_byte_width(source[*start]); } // for @@ -392,27 +392,27 @@ extern "C" { if (*stop == *start) break; status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_false) break; + if (status == F_false) break; } // for if (*stop == *start) { status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_true) return f_no_data; + if (status == F_true) return F_data_not; } - return f_none; + return F_none; } #endif // !defined(_di_fl_string_rip_) || !defined(_di_fl_string_dynamic_rip_) || !defined(_di_fl_string_rip_nulless_) || !defined(_di_fl_string_dynamic_rip_nulless_) diff --git a/level_1/fl_string/c/private-string.h b/level_1/fl_string/c/private-string.h index 2b7ed7d..6ef1f5e 100644 --- a/level_1/fl_string/c/private-string.h +++ b/level_1/fl_string/c/private-string.h @@ -32,11 +32,11 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append() * @see fl_string_mash() @@ -60,11 +60,11 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append_nulless() * @see fl_string_mash_nulless() @@ -94,9 +94,9 @@ extern "C" { * Exclusive stop position for string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare() * @see fl_string_dynamic_compare() @@ -125,9 +125,9 @@ extern "C" { * Exclusive stop position for string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare_trim() * @see fl_string_dynamic_compare_trim() @@ -150,11 +150,11 @@ extern "C" { * The destination string the source and glue are prepended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_prepend() * @see fl_string_dynamic_prepend() @@ -176,11 +176,11 @@ extern "C" { * The destination string the source and glue are prepended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_prepend_nulless() * @see fl_string_dynamic_prepend_nulless() @@ -204,11 +204,11 @@ extern "C" { * Will be updated to reflect the new stop range. * * @return - * f_none on success. - * f_no_data on success but only whitespace found. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not on success but only whitespace found. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_rip() * @see fl_string_rip() diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index e2ee4f7..cc5cbba 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -8,10 +8,10 @@ extern "C" { #ifndef _di_fl_string_append_ f_return_status fl_string_append(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_string_append(source, length, destination); } @@ -20,10 +20,10 @@ extern "C" { #ifndef _di_fl_string_append_assure_ f_return_status fl_string_append_assure(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_string_append(source, length, destination); @@ -51,17 +51,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_append_assure_ #ifndef _di_fl_string_append_assure_nulless_ f_return_status fl_string_append_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_string_append_nulless(source, length, destination); @@ -89,17 +89,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_append_assure_nulless_ #ifndef _di_fl_string_append_nulless_ f_return_status fl_string_append_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_string_append_nulless(source, length, destination); } @@ -132,10 +132,10 @@ extern "C" { #ifndef _di_fl_string_dynamic_append_ f_return_status fl_string_dynamic_append(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_string_append(source.string, source.used, destination); } @@ -144,10 +144,10 @@ extern "C" { #ifndef _di_fl_string_dynamic_append_assure_ f_return_status fl_string_dynamic_append_assure(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_string_append(source.string, source.used, destination); @@ -175,17 +175,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_append_assure_ #ifndef _di_fl_string_dynamic_append_assure_nulless_ f_return_status fl_string_dynamic_append_assure_nulless(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_string_append_nulless(source.string, source.used, destination); @@ -213,17 +213,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_append_assure_nulless_ #ifndef _di_fl_string_dynamic_append_nulless_ f_return_status fl_string_dynamic_append_nulless(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_string_append_nulless(source.string, source.used, destination); } @@ -232,15 +232,15 @@ extern "C" { #ifndef _di_fl_string_dynamic_mash_ f_return_status fl_string_dynamic_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append(source.string, source.used, destination); @@ -250,15 +250,15 @@ extern "C" { #ifndef _di_fl_string_dynamic_mash_nulless_ f_return_status fl_string_dynamic_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append_nulless(source.string, source.used, destination); @@ -268,15 +268,15 @@ extern "C" { #ifndef _di_fl_string_dynamic_mish_ f_return_status fl_string_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend(source.string, source.used, destination); @@ -286,15 +286,15 @@ extern "C" { #ifndef _di_fl_string_dynamic_mish_nulless_ f_return_status fl_string_dynamic_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend_nulless(source.string, source.used, destination); @@ -304,12 +304,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_append_ f_return_status fl_string_dynamic_partial_append(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -318,12 +318,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_append_assure_ f_return_status fl_string_dynamic_partial_append_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_string_length length = (range.stop - range.start) + 1; @@ -358,12 +358,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_append_assure_nulless_ f_return_status fl_string_dynamic_partial_append_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_string_length length = (range.stop - range.start) + 1; @@ -398,12 +398,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_append_nulless_ f_return_status fl_string_dynamic_partial_append_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -412,8 +412,8 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_compare_ f_return_status fl_string_dynamic_partial_compare(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2) { #ifndef _di_level_1_parameter_checking_ - if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter); - if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter); + if (string1.used <= range1.stop) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); @@ -423,8 +423,8 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_compare_trim_ f_return_status fl_string_dynamic_partial_compare_trim(const f_string_static string1, const f_string_static string2, const f_string_range range1, const f_string_range range2) { #ifndef _di_level_1_parameter_checking_ - if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter); - if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter); + if (string1.used <= range1.stop) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); @@ -434,17 +434,17 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_mash_ f_return_status fl_string_dynamic_partial_mash(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); @@ -454,17 +454,17 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_mash_nulless_ f_return_status fl_string_dynamic_partial_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); @@ -474,17 +474,17 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_mish_ f_return_status fl_string_partial_dynamic_mish(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); @@ -494,17 +494,17 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_mish_nulless_ f_return_status fl_string_dynamic_partial_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); @@ -514,12 +514,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_prepend_ f_return_status fl_string_dynamic_partial_prepend(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_string_length length = (range.stop - range.start) + 1; @@ -549,19 +549,19 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_partial_prepend_ #ifndef _di_fl_string_dynamic_partial_prepend_assure_ f_return_status fl_string_dynamic_partial_prepend_assure(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_string_length length = (range.stop - range.start) + 1; @@ -591,19 +591,19 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_partial_prepend_assure_ #ifndef _di_fl_string_dynamic_partial_prepend_assure_nulless_ f_return_status fl_string_dynamic_partial_prepend_assure_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -612,12 +612,12 @@ extern "C" { #ifndef _di_fl_string_dynamic_partial_prepend_nulless_ f_return_status fl_string_dynamic_partial_prepend_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -626,10 +626,10 @@ extern "C" { #ifndef _di_fl_string_dynamic_prepend_ f_return_status fl_string_dynamic_prepend(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_string_prepend(source.string, source.used, destination); } @@ -638,10 +638,10 @@ extern "C" { #ifndef _di_fl_string_dynamic_prepend_assure_ f_return_status fl_string_dynamic_prepend_assure(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_string_prepend(source.string, source.used, destination); @@ -669,17 +669,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_prepend_assure_ #ifndef _di_fl_string_dynamic_prepend_assure_nulless_ f_return_status fl_string_dynamic_prepend_assure_nulless(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_string_prepend_nulless(source.string, source.used, destination); @@ -707,17 +707,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_prepend_assure_nulless_ #ifndef _di_fl_string_dynamic_prepend_nulless_ f_return_status fl_string_dynamic_prepend_nulless(const f_string_static source, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_string_prepend_nulless(source.string, source.used, destination); } @@ -726,13 +726,13 @@ extern "C" { #ifndef _di_fl_string_dynamic_rip_ f_return_status fl_string_dynamic_rip(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.start) return f_status_set_error(f_invalid_parameter); - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.start) return F_status_set_error(F_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -741,13 +741,13 @@ extern "C" { #ifndef _di_fl_string_dynamic_rip_nulless_ f_return_status fl_string_dynamic_rip_nulless(const f_string_static source, const f_string_range range, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.start) return f_status_set_error(f_invalid_parameter); - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.start) return F_status_set_error(F_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -756,41 +756,41 @@ extern "C" { #ifndef _di_fl_string_dynamic_seek_line_to_ f_return_status fl_string_dynamic_seek_line_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; while (buffer.string[range->start] != seek_to_this) { - if (buffer.string[range->start] == f_string_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_string_eol) return F_none_eol; range->start++; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_seek_line_to_ #ifndef _di_fl_string_dynamic_seek_line_to_utf_character_ f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; @@ -808,50 +808,50 @@ extern "C" { if (width == 0) { width = 1; - if (buffer.string[range->start] == f_string_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_string_eol) return F_none_eol; if (seek_width == width) { - if (buffer.string[range->start] == seek_to_this) return f_none; + if (buffer.string[range->start] == seek_to_this) return F_none; } } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { f_utf_character character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); - if (f_status_is_error(status)) return status; - if (character == seek_to_this) return f_none; + if (F_status_is_error(status)) return status; + if (character == seek_to_this) return F_none; } } range->start += width; - if (range->start >= range->stop) return f_none_on_stop; + if (range->start >= range->stop) return F_none_stop; } // while - return f_none_on_eos; + return F_none_eos; } #endif // _di_fl_string_dynamic_seek_line_to_utf_character_ #ifndef _di_fl_string_dynamic_seek_line_until_graph_ f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; @@ -860,9 +860,9 @@ extern "C" { width_max = buffer.used - range->start; } - while (buffer.string[range->start] == placeholder || (status = f_utf_is_graph(buffer.string + range->start, width_max)) == f_false) { - if (f_status_is_error(status)) return status; - if (buffer.string[range->start] == f_string_eol) return f_none_on_eol; + while (buffer.string[range->start] == placeholder || (status = f_utf_is_graph(buffer.string + range->start, width_max)) == F_false) { + if (F_status_is_error(status)) return status; + if (buffer.string[range->start] == f_string_eol) return F_none_eol; width = f_macro_utf_byte_width_is(buffer.string[range->start]); @@ -871,17 +871,17 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; @@ -890,24 +890,24 @@ extern "C" { } } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_seek_line_until_graph_ #ifndef _di_fl_string_dynamic_seek_line_until_non_graph_ f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_static buffer, f_string_range *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; @@ -916,9 +916,9 @@ extern "C" { width_max = buffer.used - range->start; } - while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max)) == f_false) { - if (f_status_is_error(status)) return status; - if (buffer.string[range->start] == f_string_eol) return f_none_on_eol; + while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max)) == F_false) { + if (F_status_is_error(status)) return status; + if (buffer.string[range->start] == f_string_eol) return F_none_eol; width = f_macro_utf_byte_width_is(buffer.string[range->start]); @@ -927,17 +927,17 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; @@ -946,48 +946,48 @@ extern "C" { } } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_seek_line_until_non_graph_ #ifndef _di_fl_string_dynamic_seek_to_ f_return_status fl_string_dynamic_seek_to(const f_string_static buffer, f_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; while (buffer.string[range->start] != seek_to_this) { range->start++; - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_seek_to_ #ifndef _di_fl_string_dynamic_seek_to_utf_character_ f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_static buffer, f_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; @@ -1006,74 +1006,74 @@ extern "C" { width = 1; if (seek_width == width) { - if (buffer.string[range->start] == seek_to_this) return f_none; + if (buffer.string[range->start] == seek_to_this) return F_none; } } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos); - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { f_utf_character character = 0; status = f_utf_char_to_character(buffer.string + range->start, width_max, &character); - if (f_status_is_error(status)) return status; - if (character == seek_to_this) return f_none; + if (F_status_is_error(status)) return status; + if (character == seek_to_this) return F_none; } } range->start += width; - if (range->start >= range->stop) return f_none_on_stop; + if (range->start >= range->stop) return F_none_stop; } // while - return f_none_on_eos; + return F_none_eos; } #endif // _di_fl_string_dynamic_seek_to_utf_character_ #ifndef _di_fl_string_dynamic_terminate_ f_return_status fl_string_dynamic_terminate(f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); - if (destination->used > destination->size) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); + if (destination->used > destination->size) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (destination->used > 0 && destination->string[destination->used - 1] == 0) return f_none; + if (destination->used > 0 && destination->string[destination->used - 1] == 0) return F_none; - if (destination->used + 1 > f_string_length_size) return f_status_set_error(f_string_too_large); + if (destination->used + 1 > f_string_length_size) return F_status_set_error(F_string_too_large); const f_string_length total = destination->used + 1; if (total > destination->size) { - f_status status = f_none; + f_status status = F_none; f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } destination->string[destination->used] = 0; destination->used = total; - return f_none; + return F_none; } #endif // _di_fl_string_dynamic_terminate_ #ifndef _di_fl_string_mash_ f_return_status fl_string_mash(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append(source, length, destination); @@ -1083,15 +1083,15 @@ extern "C" { #ifndef _di_fl_string_mash_nulless_ f_return_status fl_string_mash_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_append_nulless(source, length, destination); @@ -1101,15 +1101,15 @@ extern "C" { #ifndef _di_fl_string_mish_ f_return_status fl_string_mish(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend(source, length, destination); @@ -1119,15 +1119,15 @@ extern "C" { #ifndef _di_fl_string_mish_nulless_ f_return_status fl_string_mish_nulless(const f_string glue, const f_string_length glue_length, const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } return private_fl_string_prepend_nulless(source, length, destination); @@ -1137,10 +1137,10 @@ extern "C" { #ifndef _di_fl_string_prepend_ f_return_status fl_string_prepend(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_string_prepend(source, length, destination); } @@ -1149,10 +1149,10 @@ extern "C" { #ifndef _di_fl_string_prepend_nulless_ f_return_status fl_string_prepend_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_string_prepend_nulless(source, length, destination); } @@ -1161,10 +1161,10 @@ extern "C" { #ifndef _di_fl_string_prepend_assure_ f_return_status fl_string_prepend_assure(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_string_prepend(source, length, destination); @@ -1192,17 +1192,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_prepend_assure_ #ifndef _di_fl_string_prepend_assure_nulless_ f_return_status fl_string_prepend_assure_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_string_prepend_nulless(source, length, destination); @@ -1230,25 +1230,25 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_string_prepend_assure_nulless_ #ifndef _di_fl_string_rip_ f_return_status fl_string_rip(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; f_string_length begin = 0; f_string_length end = length - 1; f_status status = private_fl_string_rip_find_range(source, &begin, &end); - if (f_status_is_error(status)) return status; - if (status == f_no_data) return status; + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; return private_fl_string_append(source + begin, (end - begin) + 1, destination); } @@ -1257,18 +1257,18 @@ extern "C" { #ifndef _di_fl_string_rip_nulless_ f_return_status fl_string_rip_nulless(const f_string source, const f_string_length length, f_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; f_string_length begin = 0; f_string_length end = length - 1; f_status status = private_fl_string_rip_find_range(source, &begin, &end); - if (f_status_is_error(status)) return status; - if (status == f_no_data) return status; + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; return private_fl_string_append_nulless(source + begin, (end - begin) + 1, destination); } @@ -1277,34 +1277,34 @@ extern "C" { #ifndef _di_fl_string_seek_line_to_ f_return_status fl_string_seek_line_to(const f_string string, f_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; while (string[range->start] != seek_to_this) { - if (string[range->start] == f_string_eol) return f_none_on_eol; + if (string[range->start] == f_string_eol) return F_none_eol; range->start++; - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_string_seek_line_to_ #ifndef _di_fl_string_seek_line_to_utf_character_ f_return_status fl_string_seek_line_to_utf_character(const f_string string, f_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; @@ -1318,49 +1318,49 @@ extern "C" { if (width == 0) { width = 1; - if (string[range->start] == f_string_eol) return f_none_on_eol; + if (string[range->start] == f_string_eol) return F_none_eol; if (seek_width == width) { - if (string[range->start] == seek_to_this) return f_none; + if (string[range->start] == seek_to_this) return F_none; } } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_eos); if (width == seek_width) { f_utf_character character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); - if (f_status_is_error(status)) return status; - if (character == seek_to_this) return f_none; + if (F_status_is_error(status)) return status; + if (character == seek_to_this) return F_none; } } } // for - return f_none_on_stop; + return F_none_stop; } #endif // _di_fl_string_seek_line_to_utf_character_ #ifndef _di_fl_string_seek_line_until_graph_ f_return_status fl_string_seek_line_until_graph(const f_string string, f_string_range *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; - while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == f_false) { - if (f_status_is_error(status)) return status; - if (string[range->start] == f_string_eol) return f_none_on_eol; + while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) { + if (F_status_is_error(status)) return status; + if (string[range->start] == f_string_eol) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); @@ -1369,44 +1369,44 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fl_string_seek_line_until_graph_ #ifndef _di_fl_string_seek_line_until_non_graph_ f_return_status fl_string_seek_line_until_non_graph(const f_string string, f_string_range *range, const int8_t placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; f_string_length width_max = (range->stop - range->start) + 1; - while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == f_false) { - if (f_status_is_error(status)) { + while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) { + if (F_status_is_error(status)) { return status; } - if (string[range->start] == f_string_eol) return f_none_on_eol; + if (string[range->start] == f_string_eol) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); @@ -1415,54 +1415,54 @@ extern "C" { } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); } range->start += width; - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; width_max = (range->stop - range->start) + 1; } // while - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fl_string_seek_line_until_non_graph_ #ifndef _di_fl_string_seek_to_ f_return_status fl_string_seek_to(const f_string string, f_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; while (string[range->start] != seek_to_this) { range->start++; - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_string_seek_to_ #ifndef _di_fl_string_seek_to_utf_character_ f_return_status fl_string_seek_to_utf_character(const f_string string, f_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; const unsigned short seek_width = f_macro_utf_character_width(seek_to_this); - f_status status = f_none; + f_status status = F_none; unsigned short width = 0; @@ -1477,27 +1477,27 @@ extern "C" { width = 1; if (seek_width == width) { - if (string[range->start] == seek_to_this) return f_none; + if (string[range->start] == seek_to_this) return F_none; } } // Do not operate on UTF-8 fragments that are not the first byte of the character. else if (width == 1) { - return f_status_set_error(f_incomplete_utf); + return F_status_set_error(F_incomplete_utf); } else { - if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); if (width == seek_width) { f_utf_character character = 0; status = f_utf_char_to_character(string + range->start, width_max, &character); - if (f_status_is_error(status)) return status; - if (character == seek_to_this) return f_none; + if (F_status_is_error(status)) return status; + if (character == seek_to_this) return F_none; } } } // for - return f_none_on_stop; + return F_none_stop; } #endif // _di_fl_string_seek_to_utf_character_ diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index a8fb523..d8ed5a6 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -45,12 +45,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append_nulless() */ @@ -71,12 +71,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append_assure_nulless() */ @@ -98,12 +98,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append_assure() */ @@ -124,12 +124,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append() */ @@ -153,9 +153,9 @@ extern "C" { * Length of string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_compare() * @see fl_string_dynamic_compare_trim() @@ -183,9 +183,9 @@ extern "C" { * Length of string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_compare() * @see fl_string_dynamic_compare_trim() @@ -205,12 +205,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_append_nulless() */ @@ -227,12 +227,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_append_assure_nulless() */ @@ -251,12 +251,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_append_assure() */ @@ -275,12 +275,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_append() */ @@ -300,9 +300,9 @@ extern "C" { * String to compare. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare() * @see fl_string_compare_trim() @@ -326,9 +326,9 @@ extern "C" { * String to compare. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare() * @see fl_string_compare_trim() @@ -354,12 +354,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_mash_nulless() */ @@ -384,12 +384,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_mash() */ @@ -412,12 +412,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_mish_nulless() */ @@ -442,12 +442,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_mish() */ @@ -466,12 +466,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_append_nulless() */ @@ -492,12 +492,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_append_assure_nulless() */ @@ -520,12 +520,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_append_assure() */ @@ -546,12 +546,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_append() */ @@ -575,9 +575,9 @@ extern "C" { * A range within the string2 to restrict the comparison to. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare() * @see fl_string_compare_trim() @@ -605,9 +605,9 @@ extern "C" { * A range within the string2 to restrict the comparison to. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_compare() * @see fl_string_compare_trim() @@ -635,12 +635,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_mash_nulless() */ @@ -667,12 +667,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_mash() */ @@ -697,12 +697,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_mish_nulless() */ @@ -729,12 +729,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_mish() */ @@ -755,12 +755,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_prepend_nulless() */ @@ -783,12 +783,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_prepend_assure_nulless() */ @@ -811,12 +811,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_prepend_assure() */ @@ -837,12 +837,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_partial_prepend() */ @@ -861,12 +861,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend_nulless() */ @@ -887,12 +887,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend_assure_nulless() */ @@ -913,12 +913,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend_assure() */ @@ -937,12 +937,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend() */ @@ -964,11 +964,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_rip_nulless() */ @@ -992,11 +992,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_rip() */ @@ -1016,11 +1016,11 @@ extern "C" { * A single-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_line_to_utf_character() * @see fl_string_seek_line_to_utf_character() @@ -1041,14 +1041,14 @@ extern "C" { * A 1-width, 2-width, 3-width, or 4-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_line_to() * @see fl_string_seek_line_to() @@ -1068,15 +1068,15 @@ extern "C" { * A single-width character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_seek_line_until_graph() */ @@ -1095,16 +1095,16 @@ extern "C" { * A single-width character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_seek_line_until_non_graph() */ @@ -1124,13 +1124,13 @@ extern "C" { * A single-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_to_utf_character() * @see fl_string_seek_to() @@ -1152,14 +1152,14 @@ extern "C" { * A 1-width, 2-width, 3-width, or 4-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_to() * @see fl_string_seek_to() @@ -1181,10 +1181,10 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on memory reallocation error. - * f_string_too_large (with error bit) if string is too large to fit into the buffer. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. + * F_string_too_large (with error bit) if string is too large to fit into the buffer. */ #ifndef _di_fl_string_dynamic_terminate_ extern f_return_status fl_string_dynamic_terminate(f_string_dynamic *destination); @@ -1207,12 +1207,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_mash_nulless() */ @@ -1239,12 +1239,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_mash() */ @@ -1269,12 +1269,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_mish_nulless() */ @@ -1301,12 +1301,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_mish() */ @@ -1327,12 +1327,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_prepend_nulless() */ @@ -1355,12 +1355,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_prepend_assure_nulless() */ @@ -1384,12 +1384,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend_assure() */ @@ -1413,12 +1413,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_prepend() */ @@ -1440,11 +1440,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_rip_nulless() */ @@ -1468,11 +1468,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_rip() */ @@ -1492,10 +1492,10 @@ extern "C" { * A single-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_stop on success, but stopped stop location. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_line_to() * @see fl_string_dynamic_seek_line_to_utf_character() @@ -1517,12 +1517,12 @@ extern "C" { * A 1-width, 2-width, 3-width, or 4-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_line_to() * @see fl_string_seek_line_to() @@ -1543,13 +1543,13 @@ extern "C" { * A single-width character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_seek_line_until_graph() */ @@ -1569,14 +1569,14 @@ extern "C" { * A single-width character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_stop on success, but stopped stop location. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_stop on success, but stopped stop location. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_dynamic_seek_line_until_non_graph() */ @@ -1596,11 +1596,11 @@ extern "C" { * A single-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_stop on success, but stopped stop location. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success, but stopped stop location. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_to() * @see fl_string_dynamic_seek_to_utf_character() @@ -1622,12 +1622,12 @@ extern "C" { * A 1-width, 2-width, 3-width, or 4-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_string_dynamic_seek_to() * @see fl_string_dynamic_seek_to_utf_character() diff --git a/level_1/fl_utf/c/private-utf.c b/level_1/fl_utf/c/private-utf.c index 10d167c..b61ea75 100644 --- a/level_1/fl_utf/c/private-utf.c +++ b/level_1/fl_utf/c/private-utf.c @@ -7,29 +7,29 @@ extern "C" { #if !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) f_return_status private_fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { - if (destination->used + length > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; const f_utf_string_length total = destination->used + length; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source, length); destination->used = total; - return f_none; + return F_none; } #endif // !defined(_di_fl_utf_string_append_) || !defined(_di_fl_utf_string_dynamic_append_) || !defined(_di_fl_utf_string_append_mash_) || !defined(_di_fl_utf_string_dynamic_mash_) #if !defined(_di_fl_utf_string_append_nulless_) || !defined(_di_fl_utf_string_dynamic_append_nulless_) || !defined(_di_fl_utf_string_mash_nulless_) || !defined(_di_fl_utf_string_dynamic_mash_nulless_) f_return_status private_fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { - if (destination->used + length > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; f_utf_string_length first = 0; @@ -38,13 +38,13 @@ extern "C" { if (i > first) { f_utf_string_length size = i - first; - if (destination->used + size > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); f_utf_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source + first, size); @@ -59,13 +59,13 @@ extern "C" { if (i > first) { f_utf_string_length size = i - first; - if (destination->used + size > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); f_utf_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memcpy(destination->string + destination->used, source + first, size); @@ -82,7 +82,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // !defined(_di_fl_utf_string_append_nulless_) || !defined(_di_fl_utf_string_dynamic_append_nulless_) || !defined(_di_fl_utf_string_mash_nulless_) || !defined(_di_fl_utf_string_dynamic_mash_nulless_) @@ -100,19 +100,19 @@ extern "C" { while (i2 < stop2 && string2[i2] == 0) i2++; if (i2 == stop2) break; - if (string1[i1] != string2[i2]) return f_not_equal_to; + if (string1[i1] != string2[i2]) return F_equal_to_not; } // for - // only return f_equal_to if all remaining characters are NULL. + // only return F_equal_to if all remaining characters are NULL. for (; i1 < stop1; i1++) { - if (string1[i1] != 0) return f_not_equal_to; + if (string1[i1] != 0) return F_equal_to_not; } // for for (; i2 < stop2; i2++) { - if (string2[i2] != 0) return f_not_equal_to; + if (string2[i2] != 0) return F_equal_to_not; } // for - return f_equal_to; + return F_equal_to; } #endif // !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_) @@ -121,7 +121,7 @@ extern "C" { f_utf_string_length i1 = offset1; f_utf_string_length i2 = offset2; - f_status status = f_none; + f_status status = F_none; // skip past leading whitespace in string1. for (; i1 < stop1; i1++) { @@ -130,14 +130,14 @@ extern "C" { if (i1 == stop1) break; status = f_utf_character_is_whitespace(string1[i1]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // ignore possibly invalid UTF-8 codes. - if (f_status_set_fine(status) != f_maybe) { + if (F_status_set_fine(status) != F_maybe) { return status; } } - if (status == f_false) break; + if (status == F_false) break; } // for // skip past leading whitespace in string2. @@ -147,14 +147,14 @@ extern "C" { if (i2 == stop2) break; status = f_utf_character_is_whitespace(string2[i2]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // ignore possibly invalid UTF-8 codes. - if (f_status_set_fine(status) != f_maybe) { + if (F_status_set_fine(status) != F_maybe) { return status; } } - if (status == f_false) break; + if (status == F_false) break; } // for f_utf_string_length last1 = i1; @@ -172,14 +172,14 @@ extern "C" { if (j == stop1) break; status = f_utf_character_is_whitespace(string1[j]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // ignore possibly invalid UTF-8 codes. - if (f_status_set_fine(status) != f_maybe) { + if (F_status_set_fine(status) != F_maybe) { return status; } } - if (status == f_false) { + if (status == F_false) { last1 = j; size1++; } @@ -192,20 +192,20 @@ extern "C" { if (j == stop2) break; status = f_utf_character_is_whitespace(string2[j]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // ignore possibly invalid UTF-8 codes. - if (f_status_set_fine(status) != f_maybe) { + if (F_status_set_fine(status) != F_maybe) { return status; } } - if (status == f_false) { + if (status == F_false) { last2 = j; size2++; } } // for - if (size1 != size2) return f_not_equal_to; + if (size1 != size2) return F_equal_to_not; } for (; i1 < last1 && i2 < last2; i1++, i2++) { @@ -217,33 +217,33 @@ extern "C" { while (i2 < last2 && string2[i2] == 0) i2++; if (i2 == last2) break; - if (string1[i1] != string2[i2]) return f_not_equal_to; + if (string1[i1] != string2[i2]) return F_equal_to_not; } // for - // only return f_equal_to if all remaining characters are NULL. + // only return F_equal_to if all remaining characters are NULL. for (; i1 < last1; i1++) { - if (string1[i1] != 0) return f_not_equal_to; + if (string1[i1] != 0) return F_equal_to_not; } // for for (; i2 < last2; i2++) { - if (string2[i2] != 0) return f_not_equal_to; + if (string2[i2] != 0) return F_equal_to_not; } // for - return f_equal_to; + return F_equal_to; } #endif // !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_) #if !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) f_return_status private_fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { - if (destination->used + length > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; const f_utf_string_length total = destination->used + length; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } if (destination->used > 0) { @@ -255,15 +255,15 @@ extern "C" { } destination->used = total; - return f_none; + return F_none; } #endif // !defined(_di_fl_utf_string_prepend_) || !defined(_di_fl_utf_string_dynamic_prepend_) #if !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_) f_return_status private_fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { - if (destination->used + length > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + length > f_utf_string_max_size) return F_status_set_error(F_string_too_large); - f_status status = f_none; + f_status status = F_none; f_utf_string_length first = 0; f_utf_string_length offset = 0; @@ -273,13 +273,13 @@ extern "C" { if (i > first) { f_utf_string_length size = i - first; - if (destination->used + size > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); f_utf_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); @@ -297,14 +297,14 @@ extern "C" { if (i > first) { f_utf_string_length size = i - first; - if (destination->used + size > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + size > f_utf_string_max_size) return F_status_set_error(F_string_too_large); f_utf_string_length total = destination->used + size; if (total > destination->size) { f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } memmove(destination->string + offset + size, destination->string + offset, destination->used - offset); @@ -324,7 +324,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // !defined(_di_fl_utf_string_prepend_nulless_) || !defined(_di_fl_utf_string_dynamic_prepend_nulless_) @@ -332,7 +332,7 @@ extern "C" { f_return_status private_fl_utf_string_rip_find_range(const f_utf_string source, f_utf_string_length *start, f_utf_string_length *stop) { f_utf_string_length stop_original = *stop; - f_status status = f_none; + f_status status = F_none; // skip past leading whitespace. for (; *start <= *stop; (*start)++) { @@ -341,13 +341,13 @@ extern "C" { if (*start > *stop) break; status = f_utf_character_is_whitespace(source[*start]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_false) break; + if (status == F_false) break; } // for for (; *stop > *start; (*stop)--) { @@ -359,27 +359,27 @@ extern "C" { if (*stop == *start) break; status = f_utf_character_is_whitespace(source[*stop]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_false) break; + if (status == F_false) break; } // for if (*stop == *start) { status = f_utf_character_is_whitespace(source[*stop]); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_maybe) return f_status_set_error(f_invalid_utf); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf); return status; } - if (status == f_true) return f_no_data; + if (status == F_true) return F_data_not; } - return f_none; + return F_none; } #endif // !defined(_di_fl_utf_string_rip_) || !defined(_di_fl_utf_string_dynamic_rip_) || !defined(_di_fl_utf_string_rip_nulless_) || !defined(_di_fl_utf_string_dynamic_rip_nulless_) diff --git a/level_1/fl_utf/c/private-utf.h b/level_1/fl_utf/c/private-utf.h index 70b1cec..db0536e 100644 --- a/level_1/fl_utf/c/private-utf.h +++ b/level_1/fl_utf/c/private-utf.h @@ -30,11 +30,11 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append() * @see fl_utf_string_mash() @@ -58,11 +58,11 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append_nulless() * @see fl_utf_string_mash_nulless() @@ -92,9 +92,9 @@ extern "C" { * Exclusive stop position for string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare() * @see fl_utf_string_dynamic_compare() @@ -123,9 +123,9 @@ extern "C" { * Exclusive stop position for string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare_trim() * @see fl_utf_string_dynamic_compare_trim() @@ -148,11 +148,11 @@ extern "C" { * The destination string the source and glue are prepended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend() * @see fl_utf_string_dynamic_prepend() @@ -174,11 +174,11 @@ extern "C" { * The destination string the source and glue are prepended onto. * * @return - * f_none on success. + * F_none on success. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend_nulless() * @see fl_utf_string_dynamic_prepend_nulless() @@ -202,11 +202,11 @@ extern "C" { * Will be updated to reflect the new stop range. * * @return - * f_none on success. - * f_no_data on success but only whitespace found. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not on success but only whitespace found. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_rip() * @see fl_utf_string_rip() diff --git a/level_1/fl_utf/c/utf.c b/level_1/fl_utf/c/utf.c index d3f99b1..217e437 100644 --- a/level_1/fl_utf/c/utf.c +++ b/level_1/fl_utf/c/utf.c @@ -8,10 +8,10 @@ extern "C" { #ifndef _di_fl_utf_string_append_ f_return_status fl_utf_string_append(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_utf_string_append(source, length, destination); } @@ -20,10 +20,10 @@ extern "C" { #ifndef _di_fl_utf_string_append_nulless_ f_return_status fl_utf_string_append_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_utf_string_append_nulless(source, length, destination); } @@ -32,10 +32,10 @@ extern "C" { #ifndef _di_fl_utf_string_append_assure_ f_return_status fl_utf_string_append_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_utf_string_append(source, length, destination); @@ -63,17 +63,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_append_assure_ #ifndef _di_fl_utf_string_append_assure_nulless_ f_return_status fl_utf_string_append_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_utf_string_append_nulless(source, length, destination); @@ -101,15 +101,15 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_append_assure_nulless_ #ifndef _di_fl_utf_string_compare_ f_return_status fl_utf_string_compare(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) { #ifndef _di_level_1_parameter_checking_ - if (length1 == 0) return f_status_set_error(f_invalid_parameter); - if (length2 == 0) return f_status_set_error(f_invalid_parameter); + if (length1 == 0) return F_status_set_error(F_parameter); + if (length2 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_utf_string_compare(string1, string2, 0, 0, length1, length2); @@ -119,8 +119,8 @@ extern "C" { #ifndef _di_fl_utf_string_compare_trim_ f_return_status fl_utf_string_compare_trim(const f_utf_string string1, const f_utf_string string2, const f_utf_string_length length1, const f_utf_string_length length2) { #ifndef _di_level_1_parameter_checking_ - if (length1 == 0) return f_status_set_error(f_invalid_parameter); - if (length2 == 0) return f_status_set_error(f_invalid_parameter); + if (length1 == 0) return F_status_set_error(F_parameter); + if (length2 == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_utf_string_compare_trim(string1, string2, 0, 0, length1, length2); @@ -130,10 +130,10 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_append_ f_return_status fl_utf_string_dynamic_append(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_utf_string_append(source.string, source.used, destination); } @@ -142,10 +142,10 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_append_assure_ f_return_status fl_utf_string_dynamic_append_assure(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_utf_string_append(source.string, source.used, destination); @@ -173,17 +173,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_append_assure_ #ifndef _di_fl_utf_string_dynamic_append_assure_nulless_ f_return_status fl_utf_string_dynamic_append_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_utf_string_append_nulless(source.string, source.used, destination); @@ -211,17 +211,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_append_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_append_nulless_ f_return_status fl_utf_string_dynamic_append_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_utf_string_append_nulless(source.string, source.used, destination); } @@ -230,15 +230,15 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_mash_ f_return_status fl_utf_string_dynamic_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -250,15 +250,15 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_mash_nulless_ f_return_status fl_utf_string_dynamic_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -270,15 +270,15 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_mish_ f_return_status fl_utf_string_dynamic_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -290,15 +290,15 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_mish_nulless_ f_return_status fl_utf_string_dynamic_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -322,12 +322,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_append_ f_return_status fl_utf_string_dynamic_partial_append(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -336,12 +336,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_append_assure_ f_return_status fl_utf_string_dynamic_partial_append_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_utf_string_length length = (range.stop - range.start) + 1; @@ -376,12 +376,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_append_assure_nulless_ f_return_status fl_utf_string_dynamic_partial_append_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_utf_string_length length = (range.stop - range.start) + 1; @@ -416,12 +416,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_append_nulless_ f_return_status fl_utf_string_dynamic_partial_append_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -430,8 +430,8 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_compare_ f_return_status fl_utf_string_dynamic_partial_compare(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2) { #ifndef _di_level_1_parameter_checking_ - if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter); - if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter); + if (string1.used <= range1.stop) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_utf_string_compare(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); @@ -441,8 +441,8 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_compare_trim_ f_return_status fl_utf_string_dynamic_partial_comparetrim(const f_utf_string_static string1, const f_utf_string_static string2, const f_utf_string_range range1, const f_utf_string_range range2) { #ifndef _di_level_1_parameter_checking_ - if (string1.used <= range1.stop) return f_status_set_error(f_invalid_parameter); - if (string2.used <= range2.stop) return f_status_set_error(f_invalid_parameter); + if (string1.used <= range1.stop) return F_status_set_error(F_parameter); + if (string2.used <= range2.stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ return private_fl_utf_string_compare_trim(string1.string, string2.string, range1.start, range2.start, range1.stop + 1, range2.stop + 1); @@ -452,17 +452,17 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_mash_ f_return_status fl_utf_string_dynamic_partial_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -474,17 +474,17 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_mash_nulless_ f_return_status fl_utf_string_dynamic_partial_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -496,17 +496,17 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_mish_ f_return_status fl_utf_string_dynamic_partial_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -518,17 +518,17 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_mish_nulless_ f_return_status fl_utf_string_dynamic_partial_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -540,12 +540,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_prepend_ f_return_status fl_utf_string_dynamic_partial_prepend(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -554,12 +554,12 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_ f_return_status fl_utf_string_dynamic_partial_prepend_assure(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_utf_string_length length = (range.stop - range.start) + 1; @@ -589,19 +589,19 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_partial_prepend_assure_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_ f_return_status fl_utf_string_dynamic_partial_prepend_assure_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; f_utf_string_length length = (range.stop - range.start) + 1; @@ -631,19 +631,19 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_partial_prepend_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_partial_prepend_nulless_ f_return_status fl_utf_string_dynamic_partial_prepend_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -652,10 +652,10 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_prepend_ f_return_status fl_utf_string_dynamic_prepend(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_utf_string_prepend(source.string, source.used, destination); } @@ -664,10 +664,10 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_prepend_assure_ f_return_status fl_utf_string_dynamic_prepend_assure(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_utf_string_prepend(source.string, source.used, destination); @@ -695,17 +695,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_prepend_assure_ #ifndef _di_fl_utf_string_dynamic_prepend_assure_nulless_ f_return_status fl_utf_string_dynamic_prepend_assure_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; if (destination->used < source.used) { return private_fl_utf_string_prepend_nulless(source.string, source.used, destination); @@ -733,17 +733,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_prepend_assure_nulless_ #ifndef _di_fl_utf_string_dynamic_prepend_nulless_ f_return_status fl_utf_string_dynamic_prepend_nulless(const f_utf_string_static source, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; return private_fl_utf_string_prepend_nulless(source.string, source.used, destination); } @@ -752,13 +752,13 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_rip_ f_return_status fl_utf_string_dynamic_rip(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.start) return f_status_set_error(f_invalid_parameter); - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.start) return F_status_set_error(F_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -767,13 +767,13 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_rip_nulless_ f_return_status fl_utf_string_dynamic_rip_nulless(const f_utf_string_static source, const f_utf_string_range range, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (source.used <= range.start) return f_status_set_error(f_invalid_parameter); - if (source.used <= range.stop) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (source.used <= range.start) return F_status_set_error(F_parameter); + if (source.used <= range.stop) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (source.used == 0) return f_no_data; - if (range.start > range.stop) return f_no_data; + if (source.used == 0) return F_data_not; + if (range.start > range.stop) return F_data_not; return private_fl_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination); } @@ -782,254 +782,254 @@ extern "C" { #ifndef _di_fl_utf_string_dynamic_seek_line_to_ f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_this) { - if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_line_to_ #ifndef _di_fl_utf_string_dynamic_seek_line_to_char_ f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; f_utf_character seek_to_character = seek_to_this << 24; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_character) { - if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_line_to_character_ #ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_ f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[range->start])) == f_false) { - if (f_status_is_error(status)) { + while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[range->start])) == F_false) { + if (F_status_is_error(status)) { return status; } - if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_line_until_graph_ #ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_ f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == f_false) { - if (f_status_is_error(status)) { + while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) { + if (F_status_is_error(status)) { return status; } - if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (buffer.string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_ #ifndef _di_fl_utf_string_dynamic_seek_to_ f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_static buffer, f_utf_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_this) { range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_to_ #ifndef _di_fl_utf_string_dynamic_seek_to_char_ f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_static buffer, f_utf_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter); - if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (buffer.used <= range->start) return F_status_set_error(F_parameter); + if (buffer.used <= range->stop) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (buffer.used == 0) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (buffer.used == 0) return F_none_eos; + if (range->start > range->stop) return F_none_stop; f_utf_character seek_to_character = seek_to_this << 24; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (buffer.string[range->start] != seek_to_character) { range->start++; if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start >= buffer.used) return f_none_on_eos; - if (range->start > range->stop) return f_none_on_stop; + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_seek_to_char_ #ifndef _di_fl_utf_string_dynamic_terminate_ f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); - if (destination->used > destination->size) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); + if (destination->used > destination->size) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (destination->used > 0 && destination->string[destination->used - 1] == f_utf_character_eos) return f_none; + if (destination->used > 0 && destination->string[destination->used - 1] == f_utf_character_eos) return F_none; - if (destination->used + 1 > f_utf_string_max_size) return f_status_set_error(f_string_too_large); + if (destination->used + 1 > f_utf_string_max_size) return F_status_set_error(F_string_too_large); const f_utf_string_length total = destination->used + 1; if (total > destination->size) { - f_status status = f_none; + f_status status = F_none; f_macro_string_dynamic_resize(status, (*destination), total); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } destination->string[destination->used] = f_utf_character_eos; destination->used = total; - return f_none; + return F_none; } #endif // _di_fl_utf_string_dynamic_terminate_ #ifndef _di_fl_utf_string_mash_ f_return_status fl_utf_string_mash(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -1041,15 +1041,15 @@ extern "C" { #ifndef _di_fl_utf_string_mash_nulless_ f_return_status fl_utf_string_mash_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_append_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -1061,15 +1061,15 @@ extern "C" { #ifndef _di_fl_utf_string_mish_ f_return_status fl_utf_string_mish(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -1081,15 +1081,15 @@ extern "C" { #ifndef _di_fl_utf_string_mish_nulless_ f_return_status fl_utf_string_mish_nulless(const f_utf_string glue, const f_utf_string_length glue_length, const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (glue_length > 0 && destination->used > 0) { f_status status = private_fl_utf_string_prepend_nulless(glue, glue_length, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -1101,10 +1101,10 @@ extern "C" { #ifndef _di_fl_utf_string_prepend_ f_return_status fl_utf_string_prepend(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_utf_string_prepend(source, length, destination); } @@ -1113,10 +1113,10 @@ extern "C" { #ifndef _di_fl_utf_string_prepend_assure_ f_return_status fl_utf_string_prepend_assure(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_utf_string_prepend(source, length, destination); @@ -1144,17 +1144,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_prepend_assure_ #ifndef _di_fl_utf_string_prepend_assure_nulless_ f_return_status fl_utf_string_prepend_assure_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; if (destination->used < length) { return private_fl_utf_string_prepend_nulless(source, length, destination); @@ -1182,17 +1182,17 @@ extern "C" { j++; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_prepend_assure_nulless_ #ifndef _di_fl_utf_string_prepend_nulless_ f_return_status fl_utf_string_prepend_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; return private_fl_utf_string_prepend_nulless(source, length, destination); } @@ -1201,18 +1201,18 @@ extern "C" { #ifndef _di_fl_utf_string_rip_ f_return_status fl_utf_string_rip(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; f_utf_string_length begin = 0; f_utf_string_length end = length - 1; f_status status = private_fl_utf_string_rip_find_range(source, &begin, &end); - if (f_status_is_error(status)) return status; - if (status == f_no_data) return status; + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; return private_fl_utf_string_append(source + begin, (end - begin) + 1, destination); } @@ -1221,18 +1221,18 @@ extern "C" { #ifndef _di_fl_utf_string_rip_nulless_ f_return_status fl_utf_string_rip_nulless(const f_utf_string source, const f_utf_string_length length, f_utf_string_dynamic *destination) { #ifndef _di_level_1_parameter_checking_ - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; f_utf_string_length begin = 0; f_utf_string_length end = length - 1; f_status status = private_fl_utf_string_rip_find_range(source, &begin, &end); - if (f_status_is_error(status)) return status; - if (status == f_no_data) return status; + if (F_status_is_error(status)) return status; + if (status == F_data_not) return status; return private_fl_utf_string_append_nulless(source + begin, (end - begin) + 1, destination); } @@ -1241,185 +1241,185 @@ extern "C" { #ifndef _di_fl_utf_string_seek_line_to_ f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (string[range->start] != seek_to_this) { - if (string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_seek_line_to_ #ifndef _di_fl_utf_string_seek_line_to_char_ f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; f_utf_character seek_to_character = seek_to_this << 24; - f_status status = f_none; + f_status status = F_none; for (; range->start <= range->stop; range->start++) { if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (string[range->start] == f_utf_character_eol) return f_none_on_eol; - if (string[range->start] == seek_to_character) return f_none; + if (string[range->start] == f_utf_character_eol) return F_none_eol; + if (string[range->start] == seek_to_character) return F_none; } // for - return f_none_on_stop; + return F_none_stop; } #endif // _di_fl_utf_string_seek_line_to_char_ #ifndef _di_fl_utf_string_seek_line_until_graph_ f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == f_false) { - if (f_status_is_error(status)) { + while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_false) { + if (F_status_is_error(status)) { return status; } - if (string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_utf_string_seek_line_until_graph_ #ifndef _di_fl_utf_string_seek_line_until_non_graph_ f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_range *range, const f_utf_character placeholder) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; - f_status status = f_none; + f_status status = F_none; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - while (string[range->start] == placeholder || (status = f_utf_character_is_whitespace(string[range->start])) == f_false) { - if (f_status_is_error(status)) { + while (string[range->start] == placeholder || (status = f_utf_character_is_whitespace(string[range->start])) == F_false) { + if (F_status_is_error(status)) { return status; } - if (string[range->start] == f_utf_character_eol) return f_none_on_eol; + if (string[range->start] == f_utf_character_eol) return F_none_eol; range->start++; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - return f_none; + return F_none; } #endif // _di_fl_utf_string_seek_line_until_non_graph_ #ifndef _di_fl_utf_string_seek_to_ f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_range *range, const f_utf_character seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (string[range->start] != seek_to_this) { range->start++; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; } // while - return f_none; + return F_none; } #endif // _di_fl_utf_string_seek_to_ #ifndef _di_fl_utf_string_seek_to_char_ f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_range *range, const int8_t seek_to_this) { #ifndef _di_level_1_parameter_checking_ - if (range == 0) return f_status_set_error(f_invalid_parameter); + if (range == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (range->start > range->stop) return f_none_on_stop; + if (range->start > range->stop) return F_none_stop; f_utf_character seek_to_character = seek_to_this << 24; - f_status status = f_none; + f_status status = F_none; if (f_macro_utf_character_width_is(string[0]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } while (range->start <= range->stop) { - if (string[range->start] == seek_to_character) return f_none; + if (string[range->start] == seek_to_character) return F_none; range->start++; if (f_macro_utf_character_width_is(string[range->start]) == 1) { - return f_status_set_error(f_invalid_utf); + return F_status_set_error(F_utf); } } // while - return f_none_on_stop; + return F_none_stop; } #endif // _di_fl_utf_string_seek_to_utf_character_ diff --git a/level_1/fl_utf/c/utf.h b/level_1/fl_utf/c/utf.h index a59fb21..9080747 100644 --- a/level_1/fl_utf/c/utf.h +++ b/level_1/fl_utf/c/utf.h @@ -47,12 +47,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append_nulless() */ @@ -75,12 +75,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append_assure() */ @@ -103,12 +103,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append_assure_nulless() */ @@ -132,12 +132,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append() */ @@ -161,10 +161,10 @@ extern "C" { * Length of string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_compare() * @see fl_utf_string_dynamic_compare_trim() @@ -192,10 +192,10 @@ extern "C" { * Length of string2. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_compare() * @see fl_utf_string_dynamic_compare_trim() @@ -215,12 +215,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_append_nulless() */ @@ -239,12 +239,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_append_assure_nulless() */ @@ -264,12 +264,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_append_assure() */ @@ -288,12 +288,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_append() */ @@ -313,10 +313,10 @@ extern "C" { * String to compare. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare() * @see fl_utf_string_compare_trim() @@ -340,10 +340,10 @@ extern "C" { * String to compare. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare() * @see fl_utf_string_compare_trim() @@ -369,12 +369,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mash() * @see fl_utf_string_dynamic_mash() @@ -400,12 +400,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mash_nulless() * @see fl_utf_string_dynamic_mash_nulless() @@ -429,12 +429,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mish() * @see fl_utf_string_dynamic_mish() @@ -460,12 +460,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mish_nulless() * @see fl_utf_string_dynamic_mish_nulless() @@ -485,12 +485,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_append_nulless() */ @@ -509,12 +509,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_append_assure_nulless() */ @@ -536,12 +536,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_append_assure() */ @@ -563,12 +563,12 @@ extern "C" { * The destination string the source is appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_append() */ @@ -592,10 +592,10 @@ extern "C" { * A range within the string2 to restrict the comparison to. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare() * @see fl_utf_string_compare_trim() @@ -623,10 +623,10 @@ extern "C" { * A range within the string2 to restrict the comparison to. * * @return - * f_equal_to when both strings equal. - * f_not_equal_to when both strings do not equal. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_equal_to when both strings equal. + * F_equal_to_not when both strings do not equal. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_compare() * @see fl_utf_string_compare_trim() @@ -654,12 +654,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_mash_nulless() */ @@ -686,12 +686,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_mash() */ @@ -716,12 +716,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_mish_nulless() */ @@ -748,12 +748,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_mish() */ @@ -774,12 +774,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_prepend_nulless() */ @@ -802,12 +802,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_prepend_assure_nulless() */ @@ -830,12 +830,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_prepend_assure() */ @@ -856,12 +856,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 or range is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 or range is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_partial_prepend() */ @@ -880,12 +880,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_prepend_nulless() */ @@ -906,12 +906,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_prepend_assure_nulless() */ @@ -932,12 +932,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_prepend_assure() */ @@ -956,12 +956,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0. + * F_none on success. + * F_data_not if source length is 0. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_prepend() */ @@ -983,11 +983,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_rip_nulless() */ @@ -1011,11 +1011,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_rip() */ @@ -1035,12 +1035,12 @@ extern "C" { * A UTF-8 character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_line_to_char() * @see fl_utf_string_seek_line_to_char() @@ -1061,11 +1061,11 @@ extern "C" { * A single-width non-UTF-8 character. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_line_to() * @see fl_utf_string_seek_line_to() @@ -1085,11 +1085,11 @@ extern "C" { * A UTF-8 character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid * * @see fl_utf_string_seek_line_until_graph() */ @@ -1108,12 +1108,12 @@ extern "C" { * A single-width character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_seek_line_until_non_graph() */ @@ -1133,11 +1133,11 @@ extern "C" { * A UTF-8 character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_to_char() * @see fl_utf_string_seek_to() @@ -1159,11 +1159,11 @@ extern "C" { * A single-width non-UTF-8 character. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_to() * @see fl_utf_string_seek_to() @@ -1185,14 +1185,14 @@ extern "C" { * A 1-width, 2-width, 3-width, or 4-width character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if character is an invalid UTF-8 character. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * 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_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if character is an invalid UTF-8 character. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_to() * @see fl_utf_string_seek_to() @@ -1214,10 +1214,10 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_reallocation (with error bit) on memory reallocation error. - * f_string_too_large (with error bit) if string is too large to fit into the buffer. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. + * F_string_too_large (with error bit) if string is too large to fit into the buffer. */ #ifndef _di_fl_utf_string_dynamic_terminate_ extern f_return_status fl_utf_string_dynamic_terminate(f_utf_string_dynamic *destination); @@ -1242,12 +1242,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mash_nulless() */ @@ -1276,12 +1276,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mash() */ @@ -1308,12 +1308,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mish_nulless() */ @@ -1342,12 +1342,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_mish() */ @@ -1370,12 +1370,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend_nulless() */ @@ -1400,12 +1400,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend_assure_nulless() */ @@ -1431,12 +1431,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend_assure() */ @@ -1461,12 +1461,12 @@ extern "C" { * The destination string the source is prepended onto. * * @return - * f_none on success. - * f_no_data if source length is 0 (start > stop). + * F_none on success. + * F_data_not if source length is 0 (start > stop). * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_prepend() */ @@ -1490,11 +1490,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_rip_nulless() */ @@ -1520,11 +1520,11 @@ extern "C" { * The new string, which will be allocated or reallocated as necessary. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_append() */ @@ -1544,12 +1544,12 @@ extern "C" { * A UTF-8 character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_seek_line_to_char() */ @@ -1569,11 +1569,11 @@ extern "C" { * A single-width non-UTF-8 character. * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_eos on success, but stopped at end of buffer. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_eos on success, but stopped at end of buffer. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_seek_line_to() */ @@ -1593,14 +1593,14 @@ extern "C" { * A UTF-8 character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_seek_line_until_graph() */ @@ -1620,15 +1620,15 @@ extern "C" { * A UTF-8 character representing a placeholder to ignore (may be NULL). * * @return - * f_none on success. - * f_none_on_eol on success, but stopped at EOL. - * f_none_on_stop on success, but stopped stop location. - * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. - * f_incomplete_utf_on_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. - * f_invalid_utf (with error bit) if a character in the string is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_none_eol on success, but stopped at EOL. + * F_none_stop on success, but stopped stop location. + * F_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment. + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_utf_string_dynamic_seek_line_until_non_graph() */ @@ -1648,11 +1648,11 @@ extern "C" { * A UTF-8 character representing a character to seek to. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_to() * @see fl_utf_string_dynamic_seek_to_char() @@ -1674,11 +1674,11 @@ extern "C" { * A single-width non-UTF-8 character. * * @return - * f_none on success. - * f_none_on_eos on success, but stopped at end of buffer. - * f_none_on_stop on success, but stopped stop location. - * f_invalid_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_eos on success, but stopped at end of buffer. + * F_none_stop on success, but stopped stop location. + * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. + * F_parameter (with error bit) if a parameter is invalid. * * @see fl_utf_string_dynamic_seek_to() * @see fl_utf_string_dynamic_seek_to_char() diff --git a/level_1/fl_utf_file/c/private-utf_file.c b/level_1/fl_utf_file/c/private-utf_file.c index a99e9ec..1ee7037 100644 --- a/level_1/fl_utf_file/c/private-utf_file.c +++ b/level_1/fl_utf_file/c/private-utf_file.c @@ -9,7 +9,7 @@ extern "C" { f_return_status private_fl_utf_file_write_until(const f_file file, const f_utf_string string, const f_utf_string_length total, f_utf_string_length *written) { *written = 0; - f_status status = f_none; + f_status status = F_none; f_utf_string_length write_size = file.size_write > 4 ? file.size_write : 4; f_utf_string_length write_max = total; f_utf_string_length i = 0; @@ -92,19 +92,19 @@ extern "C" { size_write = write(file.id, buffer_write, used); if (size_write == 0) { - return f_none_on_stop; + return F_none_stop; } if (size_write < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - - return f_status_set_error(f_failure); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + + return F_status_set_error(F_failure); } *written += i; @@ -115,7 +115,7 @@ extern "C" { } } while (*written < write_max); - return f_none; + return F_none; } #endif // !defined(fl_utf_file_write) || !defined(fl_utf_file_write_until) || !defined(fl_utf_file_write_range) diff --git a/level_1/fl_utf_file/c/private-utf_file.h b/level_1/fl_utf_file/c/private-utf_file.h index d9fe9f7..dc1f6fc 100644 --- a/level_1/fl_utf_file/c/private-utf_file.h +++ b/level_1/fl_utf_file/c/private-utf_file.h @@ -31,17 +31,17 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. * * @see fl_utf_file_write() * @see fl_utf_file_write_range() diff --git a/level_1/fl_utf_file/c/utf_file.c b/level_1/fl_utf_file/c/utf_file.c index f0ef1ba..ed131b1 100644 --- a/level_1/fl_utf_file/c/utf_file.c +++ b/level_1/fl_utf_file/c/utf_file.c @@ -8,13 +8,13 @@ extern "C" { #ifndef _di_fl_utf_file_read_ f_return_status fl_utf_file_read(const f_file file, f_utf_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; uint8_t width = 0; @@ -29,11 +29,11 @@ extern "C" { while ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } for (i = 0; i < size_read; i += width) { @@ -61,35 +61,35 @@ extern "C" { } // while if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - - return f_status_set_error(f_failure); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_fl_utf_file_read_ #ifndef _di_fl_utf_file_read_block_ f_return_status fl_utf_file_read_block(const f_file file, f_utf_string_dynamic *buffer) { #ifndef _di_level_1_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; uint8_t width = 0; @@ -104,11 +104,11 @@ extern "C" { if ((size_read = read(file.id, buffer_read, file.size_read)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } for (i = 0; i < size_read; i += width) { @@ -136,35 +136,35 @@ extern "C" { } if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - - return f_status_set_error(f_failure); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_fl_utf_file_read_block_ #ifndef _di_fl_utf_file_read_until_ f_return_status fl_utf_file_read_until(const f_file file, f_utf_string_dynamic *buffer, const f_utf_string_length total) { #ifndef _di_level_1_parameter_checking_ - if (file.size_read == 0) return f_status_set_error(f_invalid_parameter); - if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter); + if (file.size_read == 0) return F_status_set_error(F_parameter); + if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); - f_status status = f_none; + f_status status = F_none; ssize_t size_read = 0; uint8_t width = 0; @@ -186,11 +186,11 @@ extern "C" { while (buffer_count < total && (size_read = read(file.id, buffer_read, buffer_size)) > 0) { if (buffer->used + size_read > buffer->size) { if (buffer->size + size_read > f_string_length_size) { - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } f_macro_string_dynamic_resize(status, (*buffer), buffer->size + size_read); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } for (i = 0; i < size_read; i += width) { @@ -219,43 +219,43 @@ extern "C" { } // while if (size_read == 0) { - return f_none_on_eof; + return F_none_eof; } if (size_read < 0) { - if (errno == EAGAIN || errno == EWOULDBLOCK) return f_status_set_error(f_block); - if (errno == EBADF) return f_status_set_error(f_file_error_descriptor); - if (errno == EFAULT) return f_status_set_error(f_invalid_buffer); - if (errno == EINTR) return f_status_set_error(f_interrupted); - if (errno == EINVAL) return f_status_set_error(f_invalid_parameter); - if (errno == EIO) return f_status_set_error(f_error_input_output); - if (errno == EISDIR) return f_status_set_error(f_file_is_type_directory); - - return f_status_set_error(f_failure); + if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); + if (errno == EBADF) return F_status_set_error(F_file_descriptor); + if (errno == EFAULT) return F_status_set_error(F_buffer); + if (errno == EINTR) return F_status_set_error(F_interrupted); + if (errno == EINVAL) return F_status_set_error(F_parameter); + if (errno == EIO) return F_status_set_error(F_input_output); + if (errno == EISDIR) return F_status_set_error(F_file_type_directory); + + return F_status_set_error(F_failure); } - return f_none; + return F_none; } #endif // _di_fl_utf_file_read_until_ #ifndef _di_fl_utf_file_write_ f_return_status fl_utf_file_write(const f_file file, const f_utf_string_dynamic buffer, f_utf_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { *written = 0; - return f_no_data; + return F_data_not; } f_status status = private_fl_utf_file_write_until(file, buffer.string, buffer.used, written); - if (f_status_is_error(status)) return f_status_set_error(status); + if (F_status_is_error(status)) return F_status_set_error(status); - if (status == f_none && *written == buffer.used) return f_none_on_eos; + if (status == F_none && *written == buffer.used) return F_none_eos; return status; } @@ -264,15 +264,15 @@ extern "C" { #ifndef _di_fl_utf_file_write_block_ f_return_status fl_utf_file_write_block(const f_file file, const f_utf_string_dynamic buffer, f_utf_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { *written = 0; - return f_no_data; + return F_data_not; } f_utf_string_length write_max = file.size_write; @@ -282,9 +282,9 @@ extern "C" { } f_status status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); - if (f_status_is_error(status)) return f_status_set_error(status); + if (F_status_is_error(status)) return F_status_set_error(status); - if (status == f_none && *written == buffer.used) return f_none_on_eos; + if (status == F_none && *written == buffer.used) return F_none_eos; return status; } @@ -293,15 +293,15 @@ extern "C" { #ifndef _di_fl_utf_file_write_until_ f_return_status fl_utf_file_write_until(const f_file file, const f_utf_string_dynamic buffer, const f_utf_string_length total, f_utf_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0 || total == 0) { *written = 0; - return f_no_data; + return F_data_not; } f_utf_string_length write_max = file.size_write; @@ -311,9 +311,9 @@ extern "C" { } f_status status = private_fl_utf_file_write_until(file, buffer.string, write_max, written); - if (f_status_is_error(status)) return f_status_set_error(status); + if (F_status_is_error(status)) return F_status_set_error(status); - if (status == f_none && *written == buffer.used) return f_none_on_eos; + if (status == F_none && *written == buffer.used) return F_none_eos; return status; } @@ -322,17 +322,17 @@ extern "C" { #ifndef _di_fl_utf_file_write_range_ f_return_status fl_utf_file_write_range(const f_file file, const f_utf_string_dynamic buffer, const f_utf_string_range range, f_utf_string_length *written) { #ifndef _di_level_0_parameter_checking_ - if (file.size_write == 0) return f_status_set_error(f_invalid_parameter); - if (buffer.used >= buffer.size) return f_status_set_error(f_invalid_parameter); - if (range.stop < range.start) return f_status_set_error(f_invalid_parameter); - if (range.start >= buffer.used) return f_status_set_error(f_invalid_parameter); + if (file.size_write == 0) return F_status_set_error(F_parameter); + if (buffer.used >= buffer.size) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (file.id <= 0) return f_status_set_error(f_file_not_open); + if (file.id <= 0) return F_status_set_error(F_file_open_not); if (buffer.used == 0) { *written = 0; - return f_no_data; + return F_data_not; } // @todo consider adding a custom status return for when an invalid UTF-8 is written due to range limitations. @@ -345,11 +345,11 @@ extern "C" { } f_status status = private_fl_utf_file_write_until(file, buffer.string + range.start, write_max, written); - if (f_status_is_error(status)) return f_status_set_error(status); + if (F_status_is_error(status)) return F_status_set_error(status); - if (status == f_none) { - if (range.start + *written == total) return f_none_on_stop; - if (range.start + *written == buffer.used) return f_none_on_eos; + if (status == F_none) { + if (range.start + *written == total) return F_none_stop; + if (range.start + *written == buffer.used) return F_none_eos; } return status; diff --git a/level_1/fl_utf_file/c/utf_file.h b/level_1/fl_utf_file/c/utf_file.h index 9472995..b93f4c3 100644 --- a/level_1/fl_utf_file/c/utf_file.h +++ b/level_1/fl_utf_file/c/utf_file.h @@ -37,17 +37,17 @@ extern "C" { * The contents of the file is appended into this buffer. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_eof (with error bit) if UTF-8 character was incomplete at the end of the file. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file. * * @see read() */ @@ -68,17 +68,17 @@ extern "C" { * The contents of the file is appended into this buffer. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_eof (with error bit) if UTF-8 character was incomplete at the end of the file. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file. * * @see read() */ @@ -100,17 +100,17 @@ extern "C" { * The total bytes to read, unless EOF is reached first. * * @return - * f_none on success. - * f_none_on_eof on success and EOF was reached. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_eof (with error bit) if UTF-8 character was incomplete at the end of the file. + * F_none on success. + * F_none_eof on success and EOF was reached. + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file. * * @see read */ @@ -130,18 +130,18 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_stop (with error bit) if UTF-8 character was incomplete at the stop location. - * f_incomplete_utf_on_eos (with error bit) if UTF-8 character was incomplete at the end of the string. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location. + * F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string. * * @see write() */ @@ -163,18 +163,18 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_stop (with error bit) if UTF-8 character was incomplete at the stop location. - * f_incomplete_utf_on_eos (with error bit) if UTF-8 character was incomplete at the end of the string. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location. + * F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string. * * @see write() */ @@ -196,19 +196,19 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_stop (with error bit) if UTF-8 character was incomplete at the stop location. - * f_incomplete_utf_on_eos (with error bit) if UTF-8 character was incomplete at the end of the string. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location. + * F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string. * * @see write() */ @@ -230,19 +230,19 @@ extern "C" { * The total bytes written. * * @return - * f_none on success. - * f_none_on_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). - * f_none_on_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. - * f_file_error_descriptor (with error bit) if the file descriptor is invalid. - * f_invalid_buffer (with error bit) if the buffer is invalid. - * f_interrupted (with error bit) if interrupt was received. - * f_error_input_output (with error bit) on I/O error. - * f_file_not_open (with error bit) if file is not open. - * f_file_is_type_directory (with error bit) if file descriptor represents a directory. - * f_incomplete_utf_on_stop (with error bit) if UTF-8 character was incomplete at the stop location. - * f_incomplete_utf_on_eos (with error bit) if UTF-8 character was incomplete at the end of the string. + * F_none on success. + * F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file). + * F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used). + * F_parameter (with error bit) if a parameter is invalid. + * F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation. + * F_file_descriptor (with error bit) if the file descriptor is invalid. + * F_buffer (with error bit) if the buffer is invalid. + * F_interrupted (with error bit) if interrupt was received. + * F_input_output (with error bit) on I/O error. + * F_file_open_not (with error bit) if file is not open. + * F_file_type_directory (with error bit) if file descriptor represents a directory. + * F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location. + * F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string. * * @see write() */ diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index e27dc4c..bf7aecf 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -8,52 +8,52 @@ extern "C" { #ifndef _di_fll_execute_arguments_add_ f_return_status fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (length == 0) return f_no_data; + if (length == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; status = private_fll_execute_arguments_add(source, length, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fll_execute_arguments_add_ #ifndef _di_fll_execute_arguments_add_parameter_ f_return_status fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (name_length == 0) return f_no_data; - if (value_length == 0) return f_no_data; + if (name_length == 0) return F_data_not; + if (value_length == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; status = private_fll_execute_arguments_add_parameter(prefix, prefix_length, name, name_length, value, value_length, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fll_execute_arguments_add_parameter_ #ifndef _di_fll_execute_arguments_add_parameter_set_ f_return_status fll_execute_arguments_add_parameter_set(const f_string prefix[], const f_string_length prefix_length[], const f_string name[], const f_string_length name_length[], const f_string value[], const f_string_length value_length[], const f_array_length size, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (size == 0) return f_no_data; + if (size == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; for (f_array_length i = 0; i < size; i++) { if (name_length[i] == 0) continue; @@ -61,7 +61,7 @@ extern "C" { status = private_fll_execute_arguments_add_parameter(prefix[i], prefix_length[i], name[i], name_length[i], value[i], value_length[i], arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for return status; @@ -71,20 +71,20 @@ extern "C" { #ifndef _di_fll_execute_arguments_add_set_ f_return_status fll_execute_arguments_add_set(const f_string source[], const f_string_length length[], const f_array_length size, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (size == 0) return f_no_data; + if (size == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; for (f_array_length i = 0; i < size; i++) { if (length[i] == 0) continue; status = private_fll_execute_arguments_add(source[i], length[i], arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for return status; @@ -94,56 +94,56 @@ extern "C" { #ifndef _di_fll_execute_arguments_dynamic_add_ f_return_status fll_execute_arguments_dynamic_add(const f_string_static source, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (source.used > source.size) return f_status_set_error(f_invalid_parameter); - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (source.used > source.size) return F_status_set_error(F_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (source.used == 0) return f_no_data; + if (source.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; status = private_fll_execute_arguments_add(source.string, source.used, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fll_execute_arguments_dynamic_add_ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_ f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static prefix, const f_string_static name, const f_string_static value, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (prefix.used > prefix.size) return f_status_set_error(f_invalid_parameter); - if (name.used > name.size) return f_status_set_error(f_invalid_parameter); - if (value.used > value.size) return f_status_set_error(f_invalid_parameter); - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (prefix.used > prefix.size) return F_status_set_error(F_parameter); + if (name.used > name.size) return F_status_set_error(F_parameter); + if (value.used > value.size) return F_status_set_error(F_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (name.used == 0) return f_no_data; - if (value.used == 0) return f_no_data; + if (name.used == 0) return F_data_not; + if (value.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; status = private_fll_execute_arguments_add_parameter(prefix.string, prefix.used, name.string, name.used, value.string, value.used, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - return f_none; + return F_none; } #endif // _di_fll_execute_arguments_dynamic_add_parameter_ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static prefix[], const f_string_static name[], const f_string_static value[], const f_array_length size, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (size == 0) return f_no_data; + if (size == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; for (f_array_length i = 0; i < size; i++) { if (prefix[i].used > prefix[i].size) continue; @@ -154,7 +154,7 @@ extern "C" { status = private_fll_execute_arguments_add_parameter(prefix[i].string, prefix[i].used, name[i].string, name[i].used, value[i].string, value[i].used, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for return status; @@ -164,13 +164,13 @@ extern "C" { #ifndef _di_fll_execute_arguments_dynamic_add_set_ f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static source[], const f_array_length size, f_string_dynamics *arguments) { #ifndef _di_level_2_parameter_checking_ - if (arguments == 0) return f_status_set_error(f_invalid_parameter); - if (arguments->used > arguments->size) return f_status_set_error(f_invalid_parameter); + if (arguments == 0) return F_status_set_error(F_parameter); + if (arguments->used > arguments->size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (size == 0) return f_no_data; + if (size == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; for (f_array_length i = 0; i < size; i++) { if (source[i].used == 0) continue; @@ -178,7 +178,7 @@ extern "C" { status = private_fll_execute_arguments_add(source[i].string, source[i].used, arguments); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for return status; @@ -188,8 +188,8 @@ extern "C" { #ifndef _di_fll_execute_path_ f_return_status fll_execute_path(const f_string program_path, const f_string_statics arguments, int *result) { #ifndef _di_level_2_parameter_checking_ - if (result == 0) return f_status_set_error(f_invalid_parameter); - if (arguments.used > arguments.size) return f_status_set_error(f_invalid_parameter); + if (result == 0) return F_status_set_error(F_parameter); + if (arguments.used > arguments.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. @@ -200,7 +200,7 @@ extern "C" { f_string_length name_size = 0; - f_status status = f_none; + f_status status = F_none; memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); @@ -212,7 +212,7 @@ extern "C" { if (name_size > 1) { f_macro_string_new(status, program_name, name_size + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(program_name, last_slash + 1, sizeof(f_string_length) * name_size); memset(program_name, name_size, 0); @@ -232,7 +232,7 @@ extern "C" { for (f_string_length i = 0; i < arguments.used; i++) { f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); for (f_string_length j = 0; j < i; j++) { @@ -250,11 +250,11 @@ extern "C" { fixed_arguments[arguments.used + 2] = 0; status = f_file_exists(program_path); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - else if (status == f_false) { - return f_status_set_error(f_file_not_found); + else if (status == F_false) { + return F_status_set_error(F_file_found_not); } pid_t process_id = 0; @@ -268,7 +268,7 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - return f_status_set_error(f_fork_failed); + return F_status_set_error(F_fork); } // child @@ -288,20 +288,20 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - if (result != 0 && *result != 0) return f_status_set_error(f_failure); + if (result != 0 && *result != 0) return F_status_set_error(F_failure); - return f_none; + return F_none; } #endif // _di_fll_execute_path_ #ifndef _di_fll_execute_path_environment_ f_return_status fll_execute_path_environment(const f_string program_path, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result) { #ifndef _di_level_2_parameter_checking_ - if (result == 0) return f_status_set_error(f_invalid_parameter); - if (arguments.used > arguments.size) return f_status_set_error(f_invalid_parameter); - if (names.used > names.size) return f_status_set_error(f_invalid_parameter); - if (values.used > values.size) return f_status_set_error(f_invalid_parameter); - if (names.used > values.used) return f_status_set_error(f_invalid_parameter); + if (result == 0) return F_status_set_error(F_parameter); + if (arguments.used > arguments.size) return F_status_set_error(F_parameter); + if (names.used > names.size) return F_status_set_error(F_parameter); + if (values.used > values.size) return F_status_set_error(F_parameter); + if (names.used > values.used) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. @@ -312,7 +312,7 @@ extern "C" { f_string_length name_size = 0; - f_status status = f_none; + f_status status = F_none; memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); @@ -324,7 +324,7 @@ extern "C" { if (name_size > 1) { f_macro_string_new(status, program_name, name_size + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; memcpy(program_name, last_slash + 1, sizeof(f_string_length) * name_size); memset(program_name, name_size, 0); @@ -344,7 +344,7 @@ extern "C" { for (f_string_length i = 0; i < arguments.used; i++) { f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { if (name_size > 0) f_macro_string_delete_simple(program_name, name_size); for (f_string_length j = 0; j < i; j++) { @@ -362,11 +362,11 @@ extern "C" { fixed_arguments[arguments.used + 2] = 0; status = f_file_exists(program_path); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } - else if (status == f_false) { - return f_status_set_error(f_file_not_found); + else if (status == F_false) { + return F_status_set_error(F_file_found_not); } pid_t process_id = 0; @@ -380,7 +380,7 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - return f_status_set_error(f_fork_failed); + return F_status_set_error(F_fork); } // child @@ -388,7 +388,7 @@ extern "C" { clearenv(); for (f_array_length i = 0; i < names.used; i++) { - f_environment_set_dynamic(names.array[i], values.array[i], f_true); + f_environment_set_dynamic(names.array[i], values.array[i], F_true); } // for execv(program_path, fixed_arguments); @@ -406,17 +406,17 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - if (result != 0 && *result != 0) return f_status_set_error(f_failure); + if (result != 0 && *result != 0) return F_status_set_error(F_failure); - return f_none; + return F_none; } #endif // _di_fll_execute_path_environment_ #ifndef _di_fll_execute_program_ f_return_status fll_execute_program(const f_string program_name, const f_string_statics arguments, int *result) { #ifndef _di_level_2_parameter_checking_ - if (result == 0) return f_status_set_error(f_invalid_parameter); - if (arguments.used > arguments.size) return f_status_set_error(f_invalid_parameter); + if (result == 0) return F_status_set_error(F_parameter); + if (arguments.used > arguments.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. @@ -425,13 +425,13 @@ extern "C" { memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); fixed_arguments[0] = program_name; - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; for (; i < arguments.used; i++) { f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { for (f_string_length j = 0; j < i; j++) { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); } // for @@ -455,7 +455,7 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - return f_status_set_error(f_fork_failed); + return F_status_set_error(F_fork); } // child @@ -473,20 +473,20 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - if (result != 0 && *result != 0) return f_status_set_error(f_failure); + if (result != 0 && *result != 0) return F_status_set_error(F_failure); - return f_none; + return F_none; } #endif // _di_fll_execute_program_ #ifndef _di_fll_execute_program_environment_ f_return_status fll_execute_program_environment(const f_string program_name, const f_string_statics arguments, const f_string_statics names, const f_string_statics values, int *result) { #ifndef _di_level_2_parameter_checking_ - if (result == 0) return f_status_set_error(f_invalid_parameter); - if (arguments.used > arguments.size) return f_status_set_error(f_invalid_parameter); - if (names.used > names.size) return f_status_set_error(f_invalid_parameter); - if (values.used > values.size) return f_status_set_error(f_invalid_parameter); - if (names.used > values.used) return f_status_set_error(f_invalid_parameter); + if (result == 0) return F_status_set_error(F_parameter); + if (arguments.used > arguments.size) return F_status_set_error(F_parameter); + if (names.used > names.size) return F_status_set_error(F_parameter); + if (values.used > values.size) return F_status_set_error(F_parameter); + if (names.used > values.used) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ // create a string array that is compatible with execv() calls. @@ -495,13 +495,13 @@ extern "C" { memset(&fixed_arguments, 0, sizeof(f_string) * (arguments.used + 2)); fixed_arguments[0] = program_name; - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; for (; i < arguments.used; i++) { f_macro_string_new(status, fixed_arguments[i + 1], arguments.array[i].used + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { for (f_string_length j = 0; j < i; j++) { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[j].used + 1); } // for @@ -521,24 +521,24 @@ extern "C" { status = f_environment_get("PATH", &path); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // Do not consider PATH is not available (or valid?) to be an error. - if (f_status_set_fine(status) == f_invalid || f_status_set_fine(status) == f_failure) { - status = f_none; + if (F_status_set_fine(status) == F_invalid || F_status_set_fine(status) == F_failure) { + status = F_none; } } else { status = f_path_explode_dynamic(path, &paths); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(path); f_macro_string_dynamics_delete_simple(paths); return status; } f_macro_string_dynamic_delete(status, path); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(paths); return status; } @@ -549,35 +549,35 @@ extern "C" { for (i = 0; i < paths.used; i++) { status = fl_string_append(program_name, program_name_length, &paths.array[i]); - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = fl_string_dynamic_terminate(&paths.array[i]); } - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = f_file_exists(paths.array[i].string); - if (status == f_true) { + if (status == F_true) { found = &paths.array[i]; break; } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); // don't consider bad/non-accessible paths an error, just ignore them. - if (status == f_invalid_name) { + if (status == F_name) { continue; } - else if (status == f_invalid_directory) { + else if (status == F_directory) { continue; } - else if (status == f_access_denied) { + else if (status == F_access_denied) { continue; } } } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(paths); return status; } @@ -585,7 +585,7 @@ extern "C" { if (found == 0) { f_macro_string_dynamics_delete_simple(paths); - return f_status_set_error(f_file_not_found); + return F_status_set_error(F_file_found_not); } char program_path[found->used]; @@ -593,7 +593,7 @@ extern "C" { memcpy(&program_path, found->string, found->used); f_macro_string_dynamics_delete(status, paths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } @@ -606,7 +606,7 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - return f_status_set_error(f_fork_failed); + return F_status_set_error(F_fork); } // child @@ -614,7 +614,7 @@ extern "C" { clearenv(); for (f_array_length i = 0; i < names.used; i++) { - f_environment_set_dynamic(names.array[i], values.array[i], f_true); + f_environment_set_dynamic(names.array[i], values.array[i], F_true); } execvp(program_path, fixed_arguments); @@ -630,9 +630,9 @@ extern "C" { f_macro_string_delete_simple(fixed_arguments[i + 1], arguments.array[i].used + 1); } // for - if (result != 0 && *result != 0) return f_status_set_error(f_failure); + if (result != 0 && *result != 0) return F_status_set_error(F_failure); - return f_none; + return F_none; } #endif // _di_fll_execute_program_environment_ diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index 3da6b74..ec7b0df 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -47,12 +47,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_add_ extern f_return_status fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments); @@ -85,12 +85,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_add_parameter_ extern f_return_status fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments); @@ -126,12 +126,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if size is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if size is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_add_parameter_set_ extern f_return_status fll_execute_arguments_add_parameter_set(const f_string prefix[], const f_string_length prefix_length[], const f_string name[], const f_string_length name_length[], const f_string value[], const f_string_length value_length[], const f_array_length size, f_string_dynamics *arguments); @@ -153,12 +153,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if size is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if size is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_add_set_ extern f_return_status fll_execute_arguments_add_set(const f_string source[], const f_string_length length[], const f_array_length size, f_string_dynamics *arguments); @@ -176,12 +176,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_dynamic_add_ extern f_return_status fll_execute_arguments_dynamic_add(const f_string_static source, f_string_dynamics *arguments); @@ -209,12 +209,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_ extern f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static prefix, const f_string_static name, const f_string_static value, f_string_dynamics *arguments); @@ -244,12 +244,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_ extern f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static prefix[], const f_string_static name[], const f_string_static value[], const f_array_length size, f_string_dynamics *arguments); @@ -269,12 +269,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if source length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if source length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. */ #ifndef _di_fll_execute_arguments_dynamic_add_set_ extern f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static source[], const f_array_length size, f_string_dynamics *arguments); @@ -293,19 +293,19 @@ extern "C" { * The code returned after finishing execution of program_path. * * @return - * f_none on success. - * f_failure (with error bit) if result is non-zero. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_file_not_found (with error bit) if file does not exist at the program_path. - * f_invalid_name (with error bit) if the program_path is too long. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory in program_path. - * f_access_denied (with error bit) on access denied for program_path. - * f_loop (with error bit) on loop error while checking the program_path. - * f_file_error_stat (with error bit) on stat error while checking the program_path. + * F_none on success. + * F_failure (with error bit) if result is non-zero. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_file_found_not (with error bit) if file does not exist at the program_path. + * F_name (with error bit) if the program_path is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory in program_path. + * F_access_denied (with error bit) on access denied for program_path. + * F_loop (with error bit) on loop error while checking the program_path. + * F_file_stat (with error bit) on stat error while checking the program_path. * * @see execv() */ @@ -336,19 +336,19 @@ extern "C" { * The code returned after finishing execution of program_path. * * @return - * f_none on success. - * f_failure (with error bit) if result is non-zero. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_file_not_found (with error bit) if file does not exist at the program_path. - * f_invalid_name (with error bit) if the program_path is too long. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory in program_path. - * f_access_denied (with error bit) on access denied for program_path. - * f_loop (with error bit) on loop error while checking the program_path. - * f_file_error_stat (with error bit) on stat error while checking the program_path. + * F_none on success. + * F_failure (with error bit) if result is non-zero. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_file_found_not (with error bit) if file does not exist at the program_path. + * F_name (with error bit) if the program_path is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory in program_path. + * F_access_denied (with error bit) on access denied for program_path. + * F_loop (with error bit) on loop error while checking the program_path. + * F_file_stat (with error bit) on stat error while checking the program_path. * * @see execv() */ @@ -369,13 +369,13 @@ extern "C" { * The code returned after finishing execution of program. * * @return - * f_none on success. - * f_failure (with error bit) if result is non-zero. - * f_fork_failed (with error bit) on fork failure. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_file_not_found (with error bit) if file does not exist at the program_path. + * F_none on success. + * F_failure (with error bit) if result is non-zero. + * F_fork (with error bit) on fork failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_file_found_not (with error bit) if file does not exist at the program_path. * f_string_length_size (with error bit) if the combined string (generated from PATH) is too large. * * @see execvp() @@ -409,20 +409,20 @@ extern "C" { * The code returned after finishing execution of program. * * @return - * f_none on success. - * f_failure (with error bit) if result is non-zero. - * f_fork_failed (with error bit) on fork failure. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_file_not_found (with error bit) if file does not exist at the program_path. - * f_invalid_name (with error bit) if the program_path is too long. - * f_out_of_memory (with error bit) if out of memory. - * f_number_overflow (with error bit) on overflow error. - * f_invalid_directory (with error bit) on invalid directory in program_path. - * f_access_denied (with error bit) on access denied for program_path. - * f_loop (with error bit) on loop error while checking the program_path. - * f_buffer_too_large (with error bit) if paths array (generated from PATH) is too large for further addressing. + * F_none on success. + * F_failure (with error bit) if result is non-zero. + * F_fork (with error bit) on fork failure. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_file_found_not (with error bit) if file does not exist at the program_path. + * F_name (with error bit) if the program_path is too long. + * F_memory_out (with error bit) if out of memory. + * F_number_overflow (with error bit) on overflow error. + * F_directory (with error bit) on invalid directory in program_path. + * F_access_denied (with error bit) on access denied for program_path. + * F_loop (with error bit) on loop error while checking the program_path. + * F_buffer_too_large (with error bit) if paths array (generated from PATH) is too large for further addressing. * f_string_length_size (with error bit) if the combined string (generated from PATH) is too large. * * @see execvpe() diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index 6f87b7f..b4ce1b8 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -7,30 +7,30 @@ extern "C" { #if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) f_return_status private_fll_execute_arguments_add(const f_string source, const f_string_length length, f_string_dynamics *arguments) { - f_status status = f_none; + f_status status = F_none; if (arguments->used >= arguments->size) { if (arguments->size + f_memory_default_allocation_step > f_array_length_size) { - if (arguments->size + 1 > f_array_length_size) return f_buffer_too_large; + if (arguments->size + 1 > f_array_length_size) return F_buffer_too_large; f_macro_string_dynamics_resize(status, (*arguments), arguments->size + 1); } else { f_macro_string_dynamics_resize(status, (*arguments), arguments->size + f_memory_default_allocation_step); } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } f_string_dynamic argument = f_string_dynamic_initialize; status = fl_string_append(source, length, &argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } @@ -40,44 +40,44 @@ extern "C" { arguments->array[arguments->used].size = argument.size; arguments->used++; - return f_none; + return F_none; } #endif // !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_) || !defined(_di_fll_execute_arguments_dynamic_add_) || !defined(_di_fll_execute_arguments_dynamic_add_set_) #if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) f_return_status private_fll_execute_arguments_add_parameter(const f_string prefix, const f_string_length prefix_length, const f_string name, const f_string_length name_length, const f_string value, const f_string_length value_length, f_string_dynamics *arguments) { - f_status status = f_none; + f_status status = F_none; if (arguments->used + 1 >= arguments->size) { if (arguments->size + f_memory_default_allocation_step > f_array_length_size) { - if (arguments->size + 2 > f_array_length_size) return f_buffer_too_large; + if (arguments->size + 2 > f_array_length_size) return F_buffer_too_large; f_macro_string_dynamics_resize(status, (*arguments), arguments->size + 2); } else { f_macro_string_dynamics_resize(status, (*arguments), arguments->size + f_memory_default_allocation_step + 1); } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } f_string_dynamic argument = f_string_dynamic_initialize; if (prefix_length > 0) { status = fl_string_append(prefix, prefix_length, &argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } } status = fl_string_append(name, name_length, &argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } @@ -90,13 +90,13 @@ extern "C" { f_macro_string_dynamic_clear(argument); status = fl_string_append(value, value_length, &argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } status = fl_string_dynamic_terminate(&argument); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); return status; } @@ -106,7 +106,7 @@ extern "C" { arguments->array[arguments->used].size = argument.size; arguments->used++; - return f_none; + return F_none; } #endif // !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_) || !defined(_di_fll_execute_arguments_dynamic_add_parameter_set_) diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index 9fb5458..49b7e73 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -43,12 +43,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. * * @see fll_execute_arguments_add() * @see fll_execute_arguments_add_set() @@ -80,12 +80,12 @@ extern "C" { * The array of string arguments intended to pass to the execute functions. * * @return - * f_none on success. - * f_no_data if name_length is 0. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on allocation error. - * f_error_reallocation (with error bit) on reallocation error. - * f_buffer_too_large (with error bit) if arguments array is too large for further allocation. + * F_none on success. + * F_data_not if name_length is 0. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on allocation error. + * F_memory_reallocation (with error bit) on reallocation error. + * F_buffer_too_large (with error bit) if arguments array is too large for further allocation. * * @see fll_execute_arguments_add_parameter() * @see fll_execute_arguments_add_parameter_set() diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c index 68fdd47..d71a867 100644 --- a/level_2/fll_file/c/file.c +++ b/level_2/fll_file/c/file.c @@ -7,59 +7,59 @@ extern "C" { #ifndef _di_fll_file_error_print_ f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(file, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_file_not_open) { + else if (status == F_file_open_not) { fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: The file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "' is no longer open."); } - else if (status == f_file_error_seek) { + else if (status == F_file_seek) { fl_color_print(file, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_file_error_read) { + else if (status == F_file_read) { fl_color_print(file, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print(file, context.error, context.reset, "ERROR: Unable to find the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print(file, context.error, context.reset, "ERROR: Unable to open the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_file_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print(file, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(file, context.notable, context.reset, "%s()", function_name); fl_color_print_line(file, context.error, context.reset, "."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print(file, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } - else if (status == f_number_underflow) { + else if (status == F_number_underflow) { fl_color_print(file, context.error, context.reset, "ERROR: Integer underflow while trying to buffer the file '"); fl_color_print(file, context.notable, context.reset, "%s", file_name); fl_color_print_line(file, context.error, context.reset, "'."); } else { - return f_false; + return F_false; } - return f_true; + return F_true; } #endif // _di_fll_file_error_print_ diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h index 2e926ae..5f7b664 100644 --- a/level_2/fll_file/c/file.h +++ b/level_2/fll_file/c/file.h @@ -40,11 +40,11 @@ extern "C" { * The name of the file with the error. * @param status * The status code representing the error. - * The status code should be passed through f_status_set_fine() if it contains error or warning bits. + * The status code should be passed through F_status_set_fine() if it contains error or warning bits. * * @return - * f_true if error message was printed. - * f_false if no error message was printed. + * F_true if error message was printed. + * F_false if no error message was printed. */ #ifndef _di_fll_file_error_print_ extern f_return_status fll_file_error_print(FILE *file, const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status); diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index bcce0c3..a000f52 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -7,14 +7,14 @@ extern "C" { #ifndef _di_fll_fss_snatch_ f_return_status fll_fss_snatch(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -27,34 +27,34 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; if (values[j]->used == 0) { for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], values[j]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for } } // for } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_ #ifndef _di_fll_fss_snatch_apart_ f_return_status fll_fss_snatch_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamics *values[], const f_string_length size) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -67,41 +67,41 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; - if (values[j]->used + contents.array[i].used > f_string_length_size) return f_status_set_error(f_buffer_too_large); + if (values[j]->used + contents.array[i].used > f_string_length_size) return F_status_set_error(F_buffer_too_large); if (values[j]->used + contents.array[i].used > values[j]->used) { f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + contents.array[i].used); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; values[j]->used++; } // for } // for } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_apart_ #ifndef _di_fll_fss_snatch_together_ f_return_status fll_fss_snatch_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -114,32 +114,32 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], values[j]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for } // for } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_together_ #ifndef _di_fll_fss_snatch_mash_ f_return_status fll_fss_snatch_mash(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size, const f_string glue, const f_string_length glue_length) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -152,34 +152,34 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; if (values[j]->used == 0) { for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for } } // for } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_mash_ #ifndef _di_fll_fss_snatch_mash_apart_ f_return_status fll_fss_snatch_mash_apart(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamics *values[], const f_string_length size, const f_string glue, const f_string_length glue_length) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -192,49 +192,49 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; if (values[j]->used + f_fss_default_allocation_step > f_string_length_size) { - if (values[j]->used + 1 > f_string_length_size) return f_status_set_error(f_buffer_too_large); + if (values[j]->used + 1 > f_string_length_size) return F_status_set_error(F_buffer_too_large); f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + 1); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } else if (values[j]->used + 1 > values[j]->used) { f_macro_string_dynamics_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; values[j]->used++; } // for - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_mash_apart_ #ifndef _di_fll_fss_snatch_mash_together_ f_return_status fll_fss_snatch_mash_together(const f_string_static buffer, const f_fss_objects objects, const f_fss_contents contents, const f_string names[], const f_string_length lengths[], f_string_dynamic *values[], const f_string_length size, const f_string glue, const f_string_length glue_length) { #ifndef _di_level_2_parameter_checking_ - if (size == 0) return f_status_set_error(f_invalid_parameter); + if (size == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - if (buffer.used == 0) return f_no_data; - if (objects.used == 0) return f_no_data; - if (contents.used == 0) return f_no_data; + if (buffer.used == 0) return F_data_not; + if (objects.used == 0) return F_data_not; + if (contents.used == 0) return F_data_not; - f_status status = f_none; + f_status status = F_none; f_string_length length_object = 0; f_array_length i = 0; @@ -247,18 +247,18 @@ extern "C" { for (j = 0; j < size; j++) { status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]); - if (f_status_is_error(status)) return status; - if (status == f_not_equal_to) continue; + if (F_status_is_error(status)) return status; + if (status == F_equal_to_not) continue; for (k = 0; k < contents.array[i].used; k++) { status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for } // for } // for - return f_none; + return F_none; } #endif // _di_fll_fss_snatch_mash_together_ diff --git a/level_2/fll_fss/c/fss.h b/level_2/fll_fss/c/fss.h index 1dde4da..40b4af1 100644 --- a/level_2/fll_fss/c/fss.h +++ b/level_2/fll_fss/c/fss.h @@ -59,10 +59,10 @@ extern "C" { * The total size of the names, lengths, and values arrays. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_ @@ -97,11 +97,11 @@ extern "C" { * The total size of the names, lengths, and values arrays. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_buffer_too_large (with error bit) on maximum buffer limit reached when processing values. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_buffer_too_large (with error bit) on maximum buffer limit reached when processing values. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_apart_ @@ -136,10 +136,10 @@ extern "C" { * The total size of the names, lengths, and values arrays. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_together_ @@ -179,10 +179,10 @@ extern "C" { * The length of the glue string. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_mash_ @@ -221,10 +221,10 @@ extern "C" { * The length of the glue string. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_mash_apart_ @@ -263,10 +263,10 @@ extern "C" { * The length of the glue string. * * @return - * f_none on success. - * f_no_data when there is no buffer, objects or contents to process. - * f_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not when there is no buffer, objects or contents to process. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. * f_string_length_size (with error bit) if any combined string is too large when processing values. */ #ifndef _di_fll_fss_snatch_mash_together_ diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index 24a9108..266aac6 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -7,27 +7,27 @@ extern "C" { #ifndef _di_fll_fss_basic_read_ f_return_status fll_fss_basic_read(f_string_dynamic *buffer, f_string_range *range, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (range == 0) return f_status_set_error(f_invalid_parameter); - if (objects == 0) return f_status_set_error(f_invalid_parameter); - if (contents == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (objects == 0) return F_status_set_error(F_parameter); + if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length initial_used = objects->used; - bool found_data = f_false; + bool found_data = F_false; do { if (objects->used >= objects->size) { f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -35,118 +35,118 @@ extern "C" { do { status = fl_fss_basic_object_read(buffer, range, &objects->array[objects->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (range->start >= range->stop || range->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } contents->used++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } if (found_data) { if (range->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } else { if (range->start >= buffer->used) { - return f_no_data_on_eos; + return F_data_no_eos; } - return f_no_data_on_stop; + return F_data_no_stop; } } - if (status == fl_fss_found_object) { - found_data = f_true; + if (status == FL_fss_found_object) { + found_data = F_true; status = fl_fss_basic_content_read(buffer, range, &contents->array[contents->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } break; } - else if (status == fl_fss_found_object_no_content) { - found_data = f_true; + else if (status == FL_fss_found_object_content_not) { + found_data = F_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } break; } - } while (status == fl_fss_found_no_object); + } while (status == FL_fss_found_object_not); - if (status == f_none_on_eos || status == f_none_on_stop) { + if (status == F_none_eos || status == F_none_stop) { contents->array[contents->used].used++; objects->used++; contents->used++; return status; } - else if (status == f_no_data_on_eos || status == f_no_data_on_stop) { + else if (status == F_data_no_eos || status == F_data_no_stop) { - // If at least some valid object was found, then return f_none equivelents. + // If at least some valid object was found, then return F_none equivelents. if (objects->used > initial_used) { - if (status == f_no_data_on_eos) return f_none_on_eos; - if (status == f_no_data_on_stop) return f_none_on_stop; + if (status == F_data_no_eos) return F_none_eos; + if (status == F_data_no_stop) return F_none_stop; } return status; } - else if (status != fl_fss_found_object && status != fl_fss_found_content && status != fl_fss_found_no_content && status != fl_fss_found_object_no_content) { + else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) { return status; } // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop. else if (range->start >= range->stop || range->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_content || status == fl_fss_found_no_content || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { objects->used++; contents->used++; } if (range->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } objects->used++; contents->used++; } while (range->start < f_string_length_size); - return f_status_is_error(f_number_overflow); + return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_basic_read_ #ifndef _di_fll_fss_basic_write_ f_return_status fll_fss_basic_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (contents.used > contents.size) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ f_status status = 0; @@ -158,24 +158,24 @@ extern "C" { status = fl_fss_basic_object_write(buffer, object, &range); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } - if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) { + if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { if (contents.used > 0) { range.start = 0; range.stop = contents.array[0].used - 1; status = fl_fss_basic_content_write(buffer, contents.array[0], &range); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } else { if (buffer->used >= buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), buffer->size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer->used] = f_string_eol; @@ -183,7 +183,7 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_fll_fss_basic_write_ diff --git a/level_2/fll_fss/c/fss_basic.h b/level_2/fll_fss/c/fss_basic.h index 1eda122..aed7a56 100644 --- a/level_2/fll_fss/c/fss_basic.h +++ b/level_2/fll_fss/c/fss_basic.h @@ -41,17 +41,17 @@ extern "C" { * This will be populated with all valid contents found. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_number_overflow (with error bit) if the maximimum buffer size is reached. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * 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_range *location, f_fss_objects *objects, f_fss_contents *contents); @@ -68,15 +68,15 @@ extern "C" { * The buffer to write to. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_basic_write_ extern f_return_status fll_fss_basic_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index 03768ce..58ebbd2 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -7,27 +7,27 @@ extern "C" { #ifndef _di_fll_fss_basic_list_read_ f_return_status fll_fss_basic_list_read(f_string_dynamic *buffer, f_string_range *location, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (objects == 0) return f_status_set_error(f_invalid_parameter); - if (contents == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (objects == 0) return F_status_set_error(F_parameter); + if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length initial_used = objects->used; - bool found_data = f_false; + bool found_data = F_false; do { if (objects->used >= objects->size) { f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -35,118 +35,118 @@ extern "C" { do { status = fl_fss_basic_list_object_read(buffer, location, &objects->array[objects->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (location->start >= location->stop || location->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } contents->used++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } if (found_data) { if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } else { if (location->start >= buffer->used) { - return f_no_data_on_eos; + return F_data_no_eos; } - return f_no_data_on_stop; + return F_data_no_stop; } } - if (status == fl_fss_found_object) { - found_data = f_true; + if (status == FL_fss_found_object) { + found_data = F_true; status = fl_fss_basic_list_content_read(buffer, location, &contents->array[contents->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } break; } - else if (status == fl_fss_found_object_no_content) { - found_data = f_true; + else if (status == FL_fss_found_object_content_not) { + found_data = F_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } break; } - } while (status == fl_fss_found_no_object); + } while (status == FL_fss_found_object_not); - if (status == f_none_on_eos || status == f_none_on_stop) { + if (status == F_none_eos || status == F_none_stop) { contents->array[contents->used].used++; objects->used++; contents->used++; return status; } - else if (status == f_no_data_on_eos || status == f_no_data_on_stop) { + else if (status == F_data_no_eos || status == F_data_no_stop) { - // If at least some valid object was found, then return f_none equivalents. + // If at least some valid object was found, then return F_none equivalents. if (objects->used > initial_used) { - if (status == f_no_data_on_eos) return f_none_on_eos; - if (status == f_no_data_on_stop) return f_none_on_stop; + if (status == F_data_no_eos) return F_none_eos; + if (status == F_data_no_stop) return F_none_stop; } return status; } - else if (status != fl_fss_found_object && status != fl_fss_found_content && status != fl_fss_found_no_content && status != fl_fss_found_object_no_content) { + else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) { return status; } // When content is found, the location->start is incremented, if content is found at location->stop, then location->start will be > location.stop. else if (location->start >= location->stop || location->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_content || status == fl_fss_found_no_content || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { objects->used++; contents->used++; } if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } objects->used++; contents->used++; } while (location->start < f_string_length_size); - return f_status_is_error(f_number_overflow); + return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_basic_list_read_ #ifndef _di_fll_fss_basic_list_write_ f_return_status fll_fss_basic_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (contents.used > contents.size) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ f_status status = 0; @@ -158,24 +158,24 @@ extern "C" { status = fl_fss_basic_list_object_write(object, &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } - if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) { + if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { if (contents.used > 0) { range.start = 0; range.stop = contents.array[0].used - 1; status = fl_fss_basic_list_content_write(contents.array[0], &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } } else { if (buffer->used >= buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), buffer->size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer->used] = f_string_eol; @@ -183,7 +183,7 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_fll_fss_basic_list_write_ diff --git a/level_2/fll_fss/c/fss_basic_list.h b/level_2/fll_fss/c/fss_basic_list.h index f201b2a..73aefd7 100644 --- a/level_2/fll_fss/c/fss_basic_list.h +++ b/level_2/fll_fss/c/fss_basic_list.h @@ -40,17 +40,17 @@ extern "C" { * This will be populated with all valid contents found. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_number_overflow (with error bit) if the maximimum buffer size is reached. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * 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_range *location, f_fss_objects *objects, f_fss_contents *contents); @@ -67,15 +67,15 @@ extern "C" { * The buffer to write to. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_basic_list_write_ extern f_return_status fll_fss_basic_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index abbbbbd..31d3945 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -7,27 +7,27 @@ extern "C" { #ifndef _di_fll_fss_extended_read_ f_return_status fll_fss_extended_read(f_string_dynamic *buffer, f_string_range *location, f_fss_objects *objects, f_fss_contents *contents) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (objects == 0) return f_status_set_error(f_invalid_parameter); - if (contents == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (objects == 0) return F_status_set_error(F_parameter); + if (contents == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length initial_used = objects->used; - bool found_data = f_false; + bool found_data = F_false; do { if (objects->used >= objects->size) { f_macro_fss_objects_resize(status, (*objects), objects->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } f_macro_fss_contents_resize(status, (*contents), contents->used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -35,118 +35,118 @@ extern "C" { do { status = fl_fss_extended_object_read(buffer, location, &objects->array[objects->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (location->start >= location->stop || location->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { objects->used++; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } contents->used++; - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } if (found_data) { if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } else { if (location->start >= buffer->used) { - return f_no_data_on_eos; + return F_data_no_eos; } - return f_no_data_on_stop; + return F_data_no_stop; } } - if (status == fl_fss_found_object) { - found_data = f_true; + if (status == FL_fss_found_object) { + found_data = F_true; status = fl_fss_extended_content_read(buffer, location, &contents->array[contents->used]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } break; } - else if (status == fl_fss_found_object_no_content) { - found_data = f_true; + else if (status == FL_fss_found_object_content_not) { + found_data = F_true; if (contents->array[contents->used].used >= contents->array[contents->used].size) { - f_status status = f_none; + f_status status = F_none; f_macro_fss_content_resize(status, contents->array[contents->used], contents->array[contents->used].size + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } break; } - } while (status == fl_fss_found_no_object); + } while (status == FL_fss_found_object_not); - if (status == f_none_on_eos || status == f_none_on_stop) { + if (status == F_none_eos || status == F_none_stop) { contents->array[contents->used].used++; objects->used++; contents->used++; return status; } - else if (status == f_no_data_on_eos || status == f_no_data_on_stop) { + else if (status == F_data_no_eos || status == F_data_no_stop) { - // If at least some valid object was found, then return f_none equivelents. + // If at least some valid object was found, then return F_none equivelents. if (objects->used > initial_used) { - if (status == f_no_data_on_eos) return f_none_on_eos; - if (status == f_no_data_on_stop) return f_none_on_stop; + if (status == F_data_no_eos) return F_none_eos; + if (status == F_data_no_stop) return F_none_stop; } return status; } - else if (status != fl_fss_found_object && status != fl_fss_found_content && status != fl_fss_found_no_content && status != fl_fss_found_object_no_content) { + else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) { return status; } // When content is found, the location->start is incremented, if content is found at location->stop, then location->start will be > location.stop. else if (location->start >= location->stop || location->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_content || status == fl_fss_found_no_content || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { objects->used++; contents->used++; } if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } objects->used++; contents->used++; } while (location->start < f_string_length_size); - return f_status_is_error(f_number_overflow); + return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_extended_read_ #ifndef _di_fll_fss_extended_write_ f_return_status fll_fss_extended_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { #ifndef _di_level_2_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (contents.used > contents.size) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ f_status status = 0; @@ -158,17 +158,17 @@ extern "C" { status = fl_fss_extended_object_write(object, &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } - if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) { + if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { while (current < contents.used) { range.start = 0; range.stop = contents.array[current].used - 1; status = fl_fss_extended_content_write(contents.array[current], &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } @@ -179,7 +179,7 @@ extern "C" { buffer->string[buffer->used - 1] = f_string_eol; } - return f_none; + return F_none; } #endif // _di_fll_fss_extended_write_ diff --git a/level_2/fll_fss/c/fss_extended.h b/level_2/fll_fss/c/fss_extended.h index 8d1dde7..dfce830 100644 --- a/level_2/fll_fss/c/fss_extended.h +++ b/level_2/fll_fss/c/fss_extended.h @@ -40,17 +40,17 @@ extern "C" { * This will be populated with all valid contents found. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_number_overflow (with error bit) if the maximimum buffer size is reached. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * 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_range *location, f_fss_objects *objects, f_fss_contents *contents); @@ -67,15 +67,15 @@ extern "C" { * The buffer to write to. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_extended_write_ extern f_return_status fll_fss_extended_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index dcfeaa8..b9fe26f 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -7,14 +7,14 @@ extern "C" { #ifndef _di_fll_fss_extended_list_read_ f_return_status fll_fss_extended_list_read(f_string_dynamic *buffer, f_string_range *location, f_fss_nest *nest) { #ifndef _di_level_3_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (location == 0) return f_status_set_error(f_invalid_parameter); - if (nest == 0) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (location == 0) return F_status_set_error(F_parameter); + if (nest == 0) return F_status_set_error(F_parameter); #endif // _di_level_3_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length initial_used = 0; - bool found_data = f_false; + bool found_data = F_false; if (nest->used == 0) { f_macro_fss_nest_resize(status, (*nest), f_fss_default_allocation_step); @@ -28,86 +28,86 @@ extern "C" { if (nest->depth[0].used >= nest->depth[0].size) { f_macro_fss_items_resize(status, nest->depth[0], nest->depth[0].used + f_fss_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } status = fl_fss_extended_list_object_read(buffer, location, &nest->depth[0].array[nest->depth[0].used].object); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (location->start >= location->stop || location->start >= buffer->used) { - if (status == fl_fss_found_object || status == fl_fss_found_object_no_content) { + if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { // extended list requires content closure, so this could be an error. - return fl_fss_found_object_no_content; + return FL_fss_found_object_content_not; } if (found_data) { if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } else { if (location->start >= buffer->used) { - return f_no_data_on_eos; + return F_data_no_eos; } - return f_no_data_on_stop; + return F_data_no_stop; } } - if (status == fl_fss_found_object) { - found_data = f_true; + if (status == FL_fss_found_object) { + found_data = F_true; status = fl_fss_extended_list_content_read(buffer, location, nest); break; } - else if (status == fl_fss_found_object_no_content) { - found_data = f_true; + else if (status == FL_fss_found_object_content_not) { + found_data = F_true; break; } - } while (status == fl_fss_found_no_object); + } while (status == FL_fss_found_object_not); - if (status == f_none_on_eos || status == f_none_on_stop) { + if (status == F_none_eos || status == F_none_stop) { return status; } - else if (status == f_no_data_on_eos || status == f_no_data_on_stop) { - // If at least some valid object was found, then return f_none equivalents. + else if (status == F_data_no_eos || status == F_data_no_stop) { + // If at least some valid object was found, then return F_none equivalents. if (nest->depth[0].used > initial_used) { - if (status == f_no_data_on_eos) return f_none_on_eos; - if (status == f_no_data_on_stop) return f_none_on_stop; + if (status == F_data_no_eos) return F_none_eos; + if (status == F_data_no_stop) return F_none_stop; } return status; } - else if (status == f_unterminated_on_eos || status == f_unterminated_on_stop || status == f_unterminated_nest_on_eos || status == f_unterminated_nest_on_stop) { - // If at least some valid object was found, then return f_none equivalents. + else if (status == F_unterminated_eos || status == F_unterminated_stop || status == F_unterminated_nest_eos || status == F_unterminated_nest_stop) { + // If at least some valid object was found, then return F_none equivalents. if (nest->depth[0].used > initial_used) { - if (status == f_no_data_on_eos) return f_none_on_eos; - if (status == f_no_data_on_stop) return f_none_on_stop; + if (status == F_data_no_eos) return F_none_eos; + if (status == F_data_no_stop) return F_none_stop; } return status; } - else if (status != fl_fss_found_object && status != fl_fss_found_content && status != fl_fss_found_no_content && status != fl_fss_found_object_no_content) { + else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) { return status; } // When content is found, the location->start is incremented, if content is found at location->stop, then location->start will be > location.stop. else if (location->start >= location->stop || location->start >= buffer->used) { if (location->start >= buffer->used) { - return f_none_on_eos; + return F_none_eos; } - return f_none_on_stop; + return F_none_stop; } } while (location->start < f_string_length_size); - return f_status_is_error(f_number_overflow); + return F_status_is_error(F_number_overflow); } #endif // _di_fll_fss_extended_list_read_ @@ -115,8 +115,8 @@ extern "C" { #ifndef _di_fll_fss_extended_list_write_ f_return_status fll_fss_extended_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer) { #ifndef _di_level_3_parameter_checking_ - if (buffer == 0) return f_status_set_error(f_invalid_parameter); - if (contents.used > contents.size) return f_status_set_error(f_invalid_parameter); + if (buffer == 0) return F_status_set_error(F_parameter); + if (contents.used > contents.size) return F_status_set_error(F_parameter); #endif // _di_level_3_parameter_checking_ f_status status = 0; @@ -128,24 +128,24 @@ extern "C" { status = fl_fss_extended_list_object_write(object, &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } - if (status == f_none || status == f_none_on_stop || status == f_none_on_eos || status == f_none_on_eol) { + if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { if (contents.used > 0) { range.start = 0; range.stop = contents.array[0].used - 1; status = fl_fss_extended_list_content_write(contents.array[0], &range, buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { return status; } } else { if (buffer->used >= buffer->size) { f_macro_string_dynamic_resize(status, (*buffer), buffer->size + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } buffer->string[buffer->used] = f_string_eol; @@ -153,7 +153,7 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_fll_fss_extended_list_write_ */ diff --git a/level_2/fll_fss/c/fss_extended_list.h b/level_2/fll_fss/c/fss_extended_list.h index f3c6354..2f43322 100644 --- a/level_2/fll_fss/c/fss_extended_list.h +++ b/level_2/fll_fss/c/fss_extended_list.h @@ -38,24 +38,24 @@ extern "C" { * An nested set of all objects and content. * * @return - * f_none on success (both valid object and valid content found with start location is at end of content). - * f_none_on_stop on success after reaching stopping point (both valid object and valid content found with start location is at stop point). - * f_none_on_eos on success after reaching the end of the buffer (both valid object and valid content found with start location is at end of buffer). - * f_no_data_on_stop no data to write due start location being greater than stop location. - * f_no_data_on_eos no data to write due start location being greater than or equal to buffer size. - * 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). - * fl_fss_found_object_no_content on success and object was found but no content was found (start location is at end of object). - * f_unterminated_on_eos (with error bit) if end of buffer is reached before a closing bracket is found (object was found). - * f_unterminated_on_stop (with error bit) if stop location is reached before a closing bracket is found (object was found). - * f_unterminated_nest_on_eos (with error bit) if end of buffer is reached while inside a nested list before a closing bracket is found (object was found). - * f_unterminated_nest_on_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found (object was found). - * 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 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_number_overflow (with error bit) if the maximimum buffer size is reached. + * F_none on success (both valid object and valid content found with start location is at end of content). + * F_none_stop on success after reaching stopping point (both valid object and valid content found with start location is at stop point). + * F_none_eos on success after reaching the end of the buffer (both valid object and valid content found with start location is at end of buffer). + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_eos no data to write due start location being greater than or equal to buffer size. + * F_data_no_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing). + * FL_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object). + * F_unterminated_eos (with error bit) if end of buffer is reached before a closing bracket is found (object was found). + * F_unterminated_stop (with error bit) if stop location is reached before a closing bracket is found (object was found). + * F_unterminated_nest_eos (with error bit) if end of buffer is reached while inside a nested list before a closing bracket is found (object was found). + * F_unterminated_nest_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found (object was found). + * F_incomplete_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed. + * F_incomplete_utf_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * 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_range *location, f_fss_nest *nest); @@ -72,15 +72,15 @@ extern "C" { * The buffer to write to. * * @return - * f_none on success. - * f_none_on_stop on success after reaching stopping point . - * f_none_on_eos on success after reaching the end of the buffer. - * f_no_data_on_stop no data to write due start location being greater than stop location. - * 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_error_reallocation (with error bit) on reallocation error. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_none_stop on success after reaching stopping point . + * F_none_eos on success after reaching the end of the buffer. + * F_data_no_stop no data to write due start location being greater than stop location. + * F_data_no_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_utf (with error bit) is returned on failure to read/process a UTF-8 character. + * F_memory_reallocation (with error bit) on reallocation error. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_fss_extended_list_write_ //extern f_return_status fll_fss_extended_list_write(const f_string_static object, const f_string_statics contents, f_string_dynamic *buffer); diff --git a/level_2/fll_fss/c/fss_status.c b/level_2/fll_fss/c/fss_status.c index f7da963..8ef22e0 100644 --- a/level_2/fll_fss/c/fss_status.c +++ b/level_2/fll_fss/c/fss_status.c @@ -7,169 +7,169 @@ extern "C" { #ifndef _di_fll_fss_status_from_string_ f_return_status fll_fss_status_from_string(const f_string string, f_status *code) { #ifndef _di_level_1_parameter_checking_ - if (code == 0) return f_status_set_error(f_invalid_parameter); + if (code == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = strlen(string); if (length == 0) { - return f_no_data; + return F_data_not; } // Numbers are not valid status code strings. - if ((status = f_conversion_character_is_decimal(string[0])) == f_true) { - return f_status_set_error(f_invalid_data); + if ((status = f_conversion_character_is_decimal(string[0])) == F_true) { + return F_status_set_error(F_data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } #ifndef _di_fll_fss_status_error_ - if (fl_string_compare(string, fll_fss_status_string_invalid_format, length, fll_fss_status_string_invalid_format_length) == f_equal_to) { - *code = fl_fss_invalid_format; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_format, length, fll_fss_status_string_format_length) == F_equal_to) { + *code = FL_fss_format; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_invalid_format_eos, length, fll_fss_status_string_invalid_format_eos_length) == f_equal_to) { - *code = fl_fss_invalid_format_eos; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_format_eos, length, fll_fss_status_string_format_eos_length) == F_equal_to) { + *code = FL_fss_format_eos; + return F_none; } #endif // _di_fll_fss_status_error_ #ifndef _di_fll_fss_status_warning_ - if (fl_string_compare(string, fll_fss_status_string_no_header, length, fll_fss_status_string_no_header_length) == f_equal_to) { - *code = fl_fss_no_header; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_header_not, length, fll_fss_status_string_header_not_length) == F_equal_to) { + *code = FL_fss_header_not; + return F_none; } - 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_invalid_but_accepted; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_accepted_invalid, length, fll_fss_status_string_accepted_invalid_length) == F_equal_to) { + *code = FL_fss_accepted_invalid; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_no_header_eos, length, fll_fss_status_string_no_header_eos_length) == f_equal_to) { - *code = fl_fss_no_header_eos; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_header_not_eos, length, fll_fss_status_string_header_not_eos_length) == F_equal_to) { + *code = FL_fss_header_not_eos; + return F_none; } - 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_invalid_but_accepted_eos; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_accepted_invalid_eos, length, fll_fss_status_string_accepted_invalid_eos_length) == F_equal_to) { + *code = FL_fss_accepted_invalid_eos; + return F_none; } #endif // _di_fll_fss_status_warning_ #ifndef _di_fll_fss_status_success_ - if (fl_string_compare(string, fll_fss_status_string_found_object, length, fll_fss_status_string_found_object_length) == f_equal_to) { - *code = fl_fss_found_object; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_object, length, fll_fss_status_string_found_object_length) == F_equal_to) { + *code = FL_fss_found_object; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_found_content, length, fll_fss_status_string_found_content_length) == f_equal_to) { - *code = fl_fss_found_content; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_content, length, fll_fss_status_string_found_content_length) == F_equal_to) { + *code = FL_fss_found_content; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_found_no_object, length, fll_fss_status_string_found_no_object_length) == f_equal_to) { - *code = fl_fss_found_no_object; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_object_not, length, fll_fss_status_string_found_object_not_length) == F_equal_to) { + *code = FL_fss_found_object_not; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_found_no_content, length, fll_fss_status_string_found_no_content_length) == f_equal_to) { - *code = fl_fss_found_no_content; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_content_not, length, fll_fss_status_string_found_content_not_length) == F_equal_to) { + *code = FL_fss_found_content_not; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_found_object_no_content, length, fll_fss_status_string_found_object_no_content_length) == f_equal_to) { - *code = fl_fss_found_object_no_content; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_object_content_not, length, fll_fss_status_string_found_object_content_not_length) == F_equal_to) { + *code = FL_fss_found_object_content_not; + return F_none; } #endif // _di_fll_fss_status_success_ #ifndef _di_fll_fss_status_codes_ - if (fl_string_compare(string, fll_fss_status_string_found_comment, length, fll_fss_status_string_found_comment_length) == f_equal_to) { - *code = fl_fss_found_object; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_found_comment, length, fll_fss_status_string_found_comment_length) == F_equal_to) { + *code = FL_fss_found_object; + return F_none; } #endif // _di_fll_fss_status_codes_ - if (fl_string_compare(string, fll_fss_status_string_status_code_first, length, fll_fss_status_string_status_code_first_length) == f_equal_to) { - *code = fl_fss_status_code_first; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_status_code_first, length, fll_fss_status_string_status_code_first_length) == F_equal_to) { + *code = FL_fss_status_code_first; + return F_none; } - if (fl_string_compare(string, fll_fss_status_string_status_code_last, length, fll_fss_status_string_status_code_last_length) == f_equal_to) { - *code = fl_fss_status_code_last; - return f_none; + if (fl_string_compare(string, fll_fss_status_string_status_code_last, length, fll_fss_status_string_status_code_last_length) == F_equal_to) { + *code = FL_fss_status_code_last; + return F_none; } - return f_status_set_error(f_invalid_data); + return F_status_set_error(F_data); } #endif // _di_fll_fss_status_from_string_ #ifndef _di_fll_fss_status_to_string_ f_return_status fll_fss_status_to_string(const f_status code, f_string *string) { #ifndef _di_level_2_parameter_checking_ - if (string == 0) return f_status_set_error(f_invalid_parameter); + if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status unmasked_code = f_status_set_fine(code); + f_status unmasked_code = F_status_set_fine(code); switch (unmasked_code) { #ifndef _di_fll_fss_status_error_ - case fl_fss_invalid_format: - *string = fll_fss_status_string_invalid_format; + case FL_fss_format: + *string = fll_fss_status_string_format; break; - case fl_fss_invalid_format_eos: - *string = fll_fss_status_string_invalid_format_eos; + case FL_fss_format_eos: + *string = fll_fss_status_string_format_eos; break; #endif // _di_fll_fss_status_error_ #ifndef _di_fll_fss_status_warning_ - case fl_fss_no_header: - *string = fll_fss_status_string_no_header; + case FL_fss_header_not: + *string = fll_fss_status_string_header_not; break; - case fl_fss_invalid_but_accepted: - *string = fll_fss_status_string_accepted_but_invalid; + case FL_fss_accepted_invalid: + *string = fll_fss_status_string_accepted_invalid; break; - case fl_fss_no_header_eos: - *string = fll_fss_status_string_no_header_eos; + case FL_fss_header_not_eos: + *string = fll_fss_status_string_header_not_eos; break; - case fl_fss_invalid_but_accepted_eos: - *string = fll_fss_status_string_accepted_but_invalid_eos; + case FL_fss_accepted_invalid_eos: + *string = fll_fss_status_string_accepted_invalid_eos; break; #endif // _di_fll_fss_status_warning_ #ifndef _di_fll_fss_status_success_ - case fl_fss_found_object: + case FL_fss_found_object: *string = fll_fss_status_string_found_object; break; - case fl_fss_found_content: + case FL_fss_found_content: *string = fll_fss_status_string_found_content; break; - case fl_fss_found_no_object: - *string = fll_fss_status_string_found_no_object; + case FL_fss_found_object_not: + *string = fll_fss_status_string_found_object_not; break; - case fl_fss_found_no_content: - *string = fll_fss_status_string_found_no_content; + case FL_fss_found_content_not: + *string = fll_fss_status_string_found_content_not; break; - case fl_fss_found_object_no_content: - *string = fll_fss_status_string_found_object_no_content; + case FL_fss_found_object_content_not: + *string = fll_fss_status_string_found_object_content_not; break; #endif // _di_fll_fss_status_success_ #ifndef _di_fll_fss_status_codes_ - case fl_fss_found_comment: + case FL_fss_found_comment: *string = fll_fss_status_string_found_comment; break; #endif // _di_fll_fss_status_codes_ - case fl_fss_status_code_first: + case FL_fss_status_code_first: *string = fll_fss_status_string_status_code_first; break; - case fl_fss_status_code_last: + case FL_fss_status_code_last: *string = fll_fss_status_string_status_code_last; break; @@ -177,20 +177,20 @@ extern "C" { return fl_status_to_string(code, string); } - return f_none; + return F_none; } #endif // _di_fll_status_to_string_ #ifndef _di_fll_fss_status_is_error_ f_return_status fll_fss_status_is_error(const f_status code) { - if (fll_fss_status_is_fine(code) == f_true) { - return f_false; + if (fll_fss_status_is_fine(code) == F_true) { + return F_false; } - else if (fll_fss_status_is_warning(code) == f_true) { - return f_false; + else if (fll_fss_status_is_warning(code) == F_true) { + return F_false; } - return f_true; + return F_true; } #endif // _di_fll_fss_status_is_error_ @@ -198,27 +198,27 @@ extern "C" { f_return_status fll_fss_status_is_warning(const f_status code) { switch (code) { #ifndef _di_fll_fss_status_basic_ - case f_no_data: - return f_true; + case F_data_not: + return F_true; #endif // _di_fll_fss_status_basic_ #ifndef _di_f_status_buffers_ - case f_no_data_on_eof: - return f_true; - case f_no_data_on_eos: - return f_true; - case f_no_data_on_stop: - return f_true; - case f_none_on_eof: - return f_true; - case f_none_on_eos: - return f_true; - case f_none_on_stop: - return f_true; + case F_data_no_eof: + return F_true; + case F_data_no_eos: + return F_true; + case F_data_no_stop: + return F_true; + case F_none_eof: + return F_true; + case F_none_eos: + return F_true; + case F_none_stop: + return F_true; #endif // _di_f_status_buffers_ } - return f_false; + return F_false; } #endif // _di_fll_fss_status_is_warning_ @@ -226,32 +226,32 @@ extern "C" { f_return_status fll_fss_status_is_fine(const f_status code) { switch (code) { #ifndef _di_fll_fss_status_booleans_ - case f_false: - return f_true; - case f_true: - return f_true; + case F_false: + return F_true; + case F_true: + return F_true; #endif // _di_fll_fss_status_booleans_ #ifndef _di_fll_fss_status_basic_ - case f_none: - return f_true; - case f_dummy: - return f_true; + case F_none: + return F_true; + case F_dummy: + return F_true; #endif // _di_fll_fss_status_basic_ #ifndef _di_fll_error_non_ - case f_less_than: - return f_true; - case f_equal_to: - return f_true; - case f_not_equal_to: - return f_true; - case f_greater_than: - return f_true; + case F_than_less: + return F_true; + case F_equal_to: + return F_true; + case F_equal_to_not: + return F_true; + case F_than_greater: + return F_true; #endif // _di_fll_fss_status_non_ } - return f_false; + return F_false; } #endif // _di_fll_fss_status_is_fine_ diff --git a/level_2/fll_fss/c/fss_status.h b/level_2/fll_fss/c/fss_status.h index 8a8bc74..6c5e3ac 100644 --- a/level_2/fll_fss/c/fss_status.h +++ b/level_2/fll_fss/c/fss_status.h @@ -32,53 +32,53 @@ extern "C" { #ifndef _di_fll_fss_status_string_ #ifndef _di_fll_fss_status_error_ - #define fll_fss_status_string_invalid_format "fl_fss_invalid_format" - #define fll_fss_status_string_invalid_format_length 21 + #define fll_fss_status_string_format "FL_fss_format" + #define fll_fss_status_string_format_length 13 - #define fll_fss_status_string_invalid_format_eos "fl_fss_invalid_format_eos" - #define fll_fss_status_string_invalid_format_eos_length 25 + #define fll_fss_status_string_format_eos "FL_fss_format_eos" + #define fll_fss_status_string_format_eos_length 17 #endif // _di_fll_fss_status_error_ #ifndef _di_fll_fss_status_warning_ - #define fll_fss_status_string_no_header "fl_fss_no_header" - #define fll_fss_status_string_no_header_length 16 + #define fll_fss_status_string_header_not "FL_fss_header_not" + #define fll_fss_status_string_header_not_length 17 - #define fll_fss_status_string_accepted_but_invalid "fl_fss_invalid_but_accepted" - #define fll_fss_status_string_accepted_but_invalid_length 27 + #define fll_fss_status_string_accepted_invalid "FL_fss_accepted_invalid" + #define fll_fss_status_string_accepted_invalid_length 23 - #define fll_fss_status_string_no_header_eos "fl_fss_no_header_eos" - #define fll_fss_status_string_no_header_eos_length 20 + #define fll_fss_status_string_header_not_eos "FL_fss_header_not_eos" + #define fll_fss_status_string_header_not_eos_length 21 - #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 31 + #define fll_fss_status_string_accepted_invalid_eos "FL_fss_accepted_invalid_eos" + #define fll_fss_status_string_accepted_invalid_eos_length 27 #endif // _di_fll_fss_status_warning_ #ifndef _di_fll_fss_status_success_ - #define fll_fss_status_string_found_object "fl_fss_found_object" + #define fll_fss_status_string_found_object "FL_fss_found_object" #define fll_fss_status_string_found_object_length 19 - #define fll_fss_status_string_found_content "fl_fss_found_content" + #define fll_fss_status_string_found_content "FL_fss_found_content" #define fll_fss_status_string_found_content_length 20 - #define fll_fss_status_string_found_no_object "fl_fss_found_no_object" - #define fll_fss_status_string_found_no_object_length 22 + #define fll_fss_status_string_found_object_not "FL_fss_found_object_not" + #define fll_fss_status_string_found_object_not_length 23 - #define fll_fss_status_string_found_no_content "fl_fss_found_no_content" - #define fll_fss_status_string_found_no_content_length 23 + #define fll_fss_status_string_found_content_not "FL_fss_found_content_not" + #define fll_fss_status_string_found_content_not_length 24 - #define fll_fss_status_string_found_object_no_content "fl_fss_found_object_no_content" - #define fll_fss_status_string_found_object_no_content_length 30 + #define fll_fss_status_string_found_object_content_not "FL_fss_found_object_content_not" + #define fll_fss_status_string_found_object_content_not_length 31 #endif // _di_fll_fss_status_success_ #ifndef _di_fll_fss_status_codes_ - #define fll_fss_status_string_found_comment "fl_fss_found_comment" + #define fll_fss_status_string_found_comment "FL_fss_found_comment" #define fll_fss_status_string_found_comment_length 14 #endif // _di_fll_fss_status_codes_ - #define fll_fss_status_string_status_code_first "fl_fss_status_code_first" + #define fll_fss_status_string_status_code_first "FL_fss_status_code_first" #define fll_fss_status_string_status_code_first_length 24 - #define fll_fss_status_string_status_code_last "fl_fss_status_code_last" + #define fll_fss_status_string_status_code_last "FL_fss_status_code_last" #define fll_fss_status_string_status_code_last_length 22 #endif // _di_fll_fss_status_string_ @@ -95,10 +95,10 @@ extern "C" { * The code code a matched string represents. * * @return - * f_none on success. - * f_no_data if string is empty. - * f_invalid_data (with error bit) if not found. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not if string is empty. + * F_data (with error bit) if not found. + * F_parameter (with error bit) if a parameter is invalid. * * @see fll_status_from_string */ diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 39ce242..5d7972f 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -15,7 +15,7 @@ extern "C" { printf("%c%c", f_string_eol, f_string_eol); fl_color_print(f_type_output, context.important, context.reset, " Available Options: "); - return f_none; + return F_none; } #endif // _di_fll_program_print_help_header_ @@ -29,7 +29,7 @@ extern "C" { fl_color_print(f_type_output, context.standout, context.reset, option_long); printf(" %s", description); - return f_none; + return F_none; } #endif // _di_fll_program_print_help_option_ @@ -40,7 +40,7 @@ extern "C" { fl_color_print(f_type_output, context.standout, context.reset, option_long); printf(" %s", description); - return f_none; + return F_none; } #endif // _di_fll_program_print_help_option_long_ @@ -51,7 +51,7 @@ extern "C" { printf(" %s", description); - return f_none; + return F_none; } #endif // _di_fll_program_print_help_option_other_ @@ -85,36 +85,36 @@ extern "C" { f_return_status fll_program_print_version(const f_string version) { printf("%s%c", version, f_string_eol); - return f_none; + return F_none; } #endif // _di_fll_program_print_version_ #ifndef _di_fll_program_parameter_process_ f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) { - f_status status = f_none; + f_status status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_no_data) { + if (status == F_data_not) { fl_color_print_line(f_type_error, context->error, context->reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass."); // @todo there is a way to identify which parameter is incorrect // 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_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process"); fl_color_print_line(f_type_error, context->error, context->reset, ")."); } - else if (status == f_invalid_utf) { + else if (status == F_utf) { fl_color_print(f_type_error, context->error, context->reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling "); fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()"); fl_color_print_line(f_type_error, context->error, context->reset, "."); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()"); fl_color_print_line(f_type_error, context->error, context->reset, "."); @@ -127,7 +127,7 @@ extern "C" { fl_color_print_line(f_type_error, context->error, context->reset, "."); } - return f_status_set_error(status); + return F_status_set_error(status); } f_console_parameter_id decision = choices.id[2]; @@ -143,15 +143,15 @@ extern "C" { status = f_console_parameter_prioritize_left(parameters, choices, &decision); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); fl_color_print(f_type_error, context->notable, context->reset, "%s", function); fl_color_print_line(f_type_error, context->error, context->reset, ")."); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context->notable, context->reset, "%s", function); fl_color_print_line(f_type_error, context->error, context->reset, "()."); @@ -164,16 +164,16 @@ extern "C" { fl_color_print_line(f_type_error, context->error, context->reset, "()."); } - return f_status_set_error(status); + return F_status_set_error(status); } // load colors unless told not to. if (decision != choices.id[0]) { - f_status allocation_status = f_none; + f_status allocation_status = F_none; fl_macro_color_context_new(allocation_status, (*context)); - if (f_status_is_error(allocation_status)) { + if (F_status_is_error(allocation_status)) { fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); fl_color_print(f_type_error, context->notable, context->reset, "fl_macro_color_context_new"); fl_color_print_line(f_type_error, context->error, context->reset, "()."); @@ -193,11 +193,11 @@ extern "C" { #ifndef _di_fll_program_parameter_process_quietly_ f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context) { - f_status status = f_none; + f_status status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; f_console_parameter_id decision = choices.id[2]; @@ -208,15 +208,15 @@ extern "C" { status = f_console_parameter_prioritize_left(parameters, choices, &decision); } - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; // load colors unless told not to. if (decision != choices.id[0]) { - f_status allocation_status = f_none; + f_status allocation_status = F_none; fl_macro_color_context_new(allocation_status, (*context)); - if (f_status_is_error(allocation_status)) return allocation_status; + if (F_status_is_error(allocation_status)) return allocation_status; status = fl_color_load_context(context, decision == choices.id[1]); } @@ -228,11 +228,11 @@ extern "C" { #ifndef _di_fll_program_parameter_additional_append_ f_return_status fll_program_parameter_additional_append(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination) { #ifndef _di_level_2_parameter_checking_ - if (argv == 0) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (argv == 0) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = 0; f_string_length start = destination->used; @@ -245,16 +245,16 @@ extern "C" { status = fl_string_append(argv[additional.array[i]], length, &ripped); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if (status == f_no_data) { - status = f_none; + if (status == F_data_not) { + status = F_none; } else { if (destination->used >= destination->size) { f_macro_string_dynamics_resize(status, (*destination), destination->size + f_console_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } destination->array[destination->used] = ripped; @@ -263,8 +263,8 @@ extern "C" { } } // for - if (status == f_none && start == destination->used) { - return f_no_data; + if (status == F_none && start == destination->used) { + return F_data_not; } return status; @@ -274,12 +274,12 @@ extern "C" { #ifndef _di_fll_program_parameter_additional_mash_ f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) { #ifndef _di_level_2_parameter_checking_ - if (argv == 0) return f_status_set_error(f_invalid_parameter); - if (glue_length < 1) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (argv == 0) return F_status_set_error(F_parameter); + if (glue_length < 1) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = 0; f_string_length start = destination->used; @@ -290,12 +290,12 @@ extern "C" { if (length > 0) { status = fl_string_mash(glue, glue_length, argv[additional.array[i]], length, destination); - if (f_status_is_error(status)) return f_status_set_error(f_string_too_large); + if (F_status_is_error(status)) return F_status_set_error(F_string_too_large); } } // for - if (status == f_none && start == destination->used) { - return f_no_data; + if (status == F_none && start == destination->used) { + return F_data_not; } return status; @@ -305,11 +305,11 @@ extern "C" { #ifndef _di_fll_program_parameter_additional_rip_ f_return_status fll_program_parameter_additional_rip(const f_string *argv, const f_string_lengths additional, f_string_dynamics *destination) { #ifndef _di_level_2_parameter_checking_ - if (argv == 0) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (argv == 0) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = 0; f_string_length start = destination->used; @@ -321,16 +321,16 @@ extern "C" { status = fl_string_rip(argv[additional.array[i]], length, &ripped); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; - if (status == f_no_data) { - status = f_none; + if (status == F_data_not) { + status = F_none; } else { if (destination->used >= destination->size) { f_macro_string_dynamics_resize(status, (*destination), destination->size + f_console_default_allocation_step); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } destination->array[destination->used] = ripped; @@ -339,8 +339,8 @@ extern "C" { } } // for - if (status == f_none && start == destination->used) { - return f_no_data; + if (status == F_none && start == destination->used) { + return F_data_not; } return status; @@ -350,12 +350,12 @@ extern "C" { #ifndef _di_fll_program_parameter_additional_rip_mash_ f_return_status fll_program_parameter_additional_rip_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination) { #ifndef _di_level_2_parameter_checking_ - if (argv == 0) return f_status_set_error(f_invalid_parameter); - if (glue_length < 1) return f_status_set_error(f_invalid_parameter); - if (destination == 0) return f_status_set_error(f_invalid_parameter); + if (argv == 0) return F_status_set_error(F_parameter); + if (glue_length < 1) return F_status_set_error(F_parameter); + if (destination == 0) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = 0; f_string_length start = destination->used; @@ -367,7 +367,7 @@ extern "C" { if (length > 0) { status = fl_string_rip(argv[additional.array[i]], length, &ripped); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(ripped); return status; } @@ -375,9 +375,9 @@ extern "C" { if (ripped.used > 0) { status = fl_string_dynamic_mash(glue, glue_length, ripped, destination); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(ripped); - return f_status_set_error(f_string_too_large); + return F_status_set_error(F_string_too_large); } } } @@ -387,8 +387,8 @@ extern "C" { f_macro_string_dynamic_delete(status, ripped); } - if (status == f_none && start == destination->used) { - return f_no_data; + if (status == F_none && start == destination->used) { + return F_data_not; } return status; diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 8c390a1..ac06ccf 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -38,7 +38,7 @@ extern "C" { * The version number of the program. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_help_header_ extern f_return_status fll_program_print_help_header(const fl_color_context context, const f_string name, const f_string version); @@ -61,7 +61,7 @@ extern "C" { * A desciption associated with the option. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_help_option_ extern f_return_status fll_program_print_help_option(const fl_color_context context, const f_string option_short, const f_string option_long, const f_string symbol_short, const f_string symbol_long, const f_string description); @@ -80,7 +80,7 @@ extern "C" { * A desciption associated with the option. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_help_option_long_ extern f_return_status fll_program_print_help_option_long(const fl_color_context context, const f_string option_long, const f_string symbol_long, const f_string description); @@ -97,7 +97,7 @@ extern "C" { * A desciption associated with the option. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_help_option_other_ extern f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description); @@ -115,7 +115,7 @@ extern "C" { * Set the first array value to EOS to disable printing of parameters. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_help_usage_ extern f_return_status fll_program_print_help_usage(const fl_color_context context, const f_string name, const f_string parameters); @@ -128,7 +128,7 @@ extern "C" { * The version number of the program. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fll_program_print_version_ extern f_return_status fll_program_print_version(const f_string version); @@ -152,10 +152,10 @@ extern "C" { * The color context. * * @return - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if "additional" parameters were expected but not found. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fll_program_parameter_process_ extern f_return_status fll_program_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context); @@ -178,10 +178,10 @@ extern "C" { * The color context. * * @return - * 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_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if "additional" parameters were expected but not found. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fll_program_parameter_process_quietly_ extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments arguments, f_console_parameters parameters, const f_console_parameter_ids choices, const bool right, f_string_lengths *remaining, fl_color_context *context); @@ -202,11 +202,11 @@ extern "C" { * An array of dynamic strings each representing a console parameter. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_append() */ @@ -229,12 +229,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if nothing to rip, no allocations or reallocations are performed. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fll_program_parameter_additional_mash_ extern f_return_status fll_program_parameter_additional_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination); @@ -253,11 +253,11 @@ extern "C" { * An array of dynamic strings each representing a console parameter. * * @return - * 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_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. * * @see fl_string_rip() */ @@ -281,12 +281,12 @@ extern "C" { * The destination string the source and glue are appended onto. * * @return - * f_none on success. - * f_no_data if nothing to rip, no allocations or reallocations are performed. + * F_none on success. + * F_data_not if nothing to rip, no allocations or reallocations are performed. * f_string_length_size (with error bit) if the combined string is too large. - * f_invalid_parameter (with error bit) if a parameter is invalid. - * f_error_allocation (with error bit) on memory allocation error. - * f_error_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_memory_allocation (with error bit) on memory allocation error. + * F_memory_reallocation (with error bit) on memory reallocation error. */ #ifndef _di_fll_program_parameter_additional_rip_mash_ extern f_return_status fll_program_parameter_additional_rip_mash(const f_string glue, const f_string_length glue_length, const f_string *argv, const f_string_lengths additional, f_string_dynamic *destination); diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index 22c9dd9..991989a 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -7,1373 +7,1363 @@ extern "C" { #ifndef _di_fll_status_from_string_ f_return_status fll_status_from_string(const f_string string, f_status *code) { #ifndef _di_level_1_parameter_checking_ - if (code == 0) return f_status_set_error(f_invalid_parameter); + if (code == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - f_status status = f_none; + f_status status = F_none; f_string_length length = strlen(string); if (length == 0) { - return f_no_data; + return F_data_not; } // Numbers are not valid status code strings. - if ((status = f_conversion_character_is_decimal(string[0])) == f_true) { - return f_status_set_error(f_invalid_data); + if ((status = f_conversion_character_is_decimal(string[0])) == F_true) { + return F_status_set_error(F_data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } #ifndef _di_fll_status_booleans_ - if (fl_string_compare(string, fl_status_string_false, length, fl_status_string_false_length) == f_equal_to) { - *code = f_false; - return f_none; + if (fl_string_compare(string, fl_status_string_false, length, fl_status_string_false_length) == F_equal_to) { + *code = F_false; + return F_none; } - if (fl_string_compare(string, fl_status_string_true, length, fl_status_string_true_length) == f_equal_to) { - *code = f_true; - return f_none; + if (fl_string_compare(string, fl_status_string_true, length, fl_status_string_true_length) == F_equal_to) { + *code = F_true; + return F_none; } #endif // _di_fll_status_booleans_ #ifndef _di_fll_status_signals_ - if (fl_string_compare(string, fl_status_string_signal_hangup, length, fl_status_string_signal_hangup_length) == f_equal_to) { - *code = f_signal_hangup; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_hangup, length, fl_status_string_signal_hangup_length) == F_equal_to) { + *code = F_signal_hangup; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_interrupt, length, fl_status_string_signal_interrupt_length) == f_equal_to) { - *code = f_signal_interrupt; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_interrupt, length, fl_status_string_signal_interrupt_length) == F_equal_to) { + *code = F_signal_interrupt; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_quit, length, fl_status_string_signal_quit_length) == f_equal_to) { - *code = f_signal_quit; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_quit, length, fl_status_string_signal_quit_length) == F_equal_to) { + *code = F_signal_quit; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_illegal, length, fl_status_string_signal_illegal_length) == f_equal_to) { - *code = f_signal_illegal; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_illegal, length, fl_status_string_signal_illegal_length) == F_equal_to) { + *code = F_signal_illegal; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_trap, length, fl_status_string_signal_trap_length) == f_equal_to) { - *code = f_signal_trap; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_trap, length, fl_status_string_signal_trap_length) == F_equal_to) { + *code = F_signal_trap; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_abort, length, fl_status_string_signal_abort_length) == f_equal_to) { - *code = f_signal_abort; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_abort, length, fl_status_string_signal_abort_length) == F_equal_to) { + *code = F_signal_abort; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_bus_error, length, fl_status_string_signal_bus_error_length) == f_equal_to) { - *code = f_signal_bus_error; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_bus_error, length, fl_status_string_signal_bus_error_length) == F_equal_to) { + *code = F_signal_bus_error; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_floating_point_exception, length, fl_status_string_signal_floating_point_exception_length) == f_equal_to) { - *code = f_signal_floating_point_exception; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_floating_point_exception, length, fl_status_string_signal_floating_point_exception_length) == F_equal_to) { + *code = F_signal_floating_point_exception; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_kill, length, fl_status_string_signal_kill_length) == f_equal_to) { - *code = f_signal_kill; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_kill, length, fl_status_string_signal_kill_length) == F_equal_to) { + *code = F_signal_kill; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_user_1, length, fl_status_string_signal_user_1_length) == f_equal_to) { - *code = f_signal_user_1; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_user_1, length, fl_status_string_signal_user_1_length) == F_equal_to) { + *code = F_signal_user_1; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_segmentation_fault, length, fl_status_string_signal_segmentation_fault_length) == f_equal_to) { - *code = f_signal_segmentation_fault; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_segmentation_fault, length, fl_status_string_signal_segmentation_fault_length) == F_equal_to) { + *code = F_signal_segmentation_fault; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_user_2, length, fl_status_string_signal_user_2_length) == f_equal_to) { - *code = f_signal_user_2; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_user_2, length, fl_status_string_signal_user_2_length) == F_equal_to) { + *code = F_signal_user_2; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_broken_pipe, length, fl_status_string_signal_broken_pipe_length) == f_equal_to) { - *code = f_signal_broken_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_broken_pipe, length, fl_status_string_signal_broken_pipe_length) == F_equal_to) { + *code = F_signal_broken_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_alarm_clock, length, fl_status_string_signal_alarm_clock_length) == f_equal_to) { - *code = f_signal_alarm_clock; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_alarm_clock, length, fl_status_string_signal_alarm_clock_length) == F_equal_to) { + *code = F_signal_alarm_clock; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_termination, length, fl_status_string_signal_termination_length) == f_equal_to) { - *code = f_signal_termination; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_termination, length, fl_status_string_signal_termination_length) == F_equal_to) { + *code = F_signal_termination; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_stack_fault, length, fl_status_string_signal_stack_fault_length) == f_equal_to) { - *code = f_signal_stack_fault; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_stack_fault, length, fl_status_string_signal_stack_fault_length) == F_equal_to) { + *code = F_signal_stack_fault; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_child, length, fl_status_string_signal_child_length) == f_equal_to) { - *code = f_signal_child; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_child, length, fl_status_string_signal_child_length) == F_equal_to) { + *code = F_signal_child; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_continue, length, fl_status_string_signal_continue_length) == f_equal_to) { - *code = f_signal_continue; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_continue, length, fl_status_string_signal_continue_length) == F_equal_to) { + *code = F_signal_continue; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_stop, length, fl_status_string_signal_stop_length) == f_equal_to) { - *code = f_signal_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_stop, length, fl_status_string_signal_stop_length) == F_equal_to) { + *code = F_signal_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_keyboard_stop, length, fl_status_string_signal_keyboard_stop_length) == f_equal_to) { - *code = f_signal_keyboard_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_keyboard_stop, length, fl_status_string_signal_keyboard_stop_length) == F_equal_to) { + *code = F_signal_keyboard_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_tty_in, length, fl_status_string_signal_tty_in_length) == f_equal_to) { - *code = f_signal_tty_in; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_tty_in, length, fl_status_string_signal_tty_in_length) == F_equal_to) { + *code = F_signal_tty_in; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_tty_out, length, fl_status_string_signal_tty_out_length) == f_equal_to) { - *code = f_signal_tty_out; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_tty_out, length, fl_status_string_signal_tty_out_length) == F_equal_to) { + *code = F_signal_tty_out; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_urgent, length, fl_status_string_signal_urgent_length) == f_equal_to) { - *code = f_signal_urgent; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_urgent, length, fl_status_string_signal_urgent_length) == F_equal_to) { + *code = F_signal_urgent; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_cpu_limit, length, fl_status_string_signal_cpu_limit_length) == f_equal_to) { - *code = f_signal_cpu_limit; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_cpu_limit, length, fl_status_string_signal_cpu_limit_length) == F_equal_to) { + *code = F_signal_cpu_limit; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_file_size_limit, length, fl_status_string_signal_file_size_limit_length) == f_equal_to) { - *code = f_signal_file_size_limit; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_file_size_limit, length, fl_status_string_signal_file_size_limit_length) == F_equal_to) { + *code = F_signal_file_size_limit; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_virtual_alarm_clock, length, fl_status_string_signal_virtual_alarm_clock_length) == f_equal_to) { - *code = f_signal_virtual_alarm_clock; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_virtual_alarm_clock, length, fl_status_string_signal_virtual_alarm_clock_length) == F_equal_to) { + *code = F_signal_virtual_alarm_clock; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_profile_alarm_clock, length, fl_status_string_signal_profile_alarm_clock_length) == f_equal_to) { - *code = f_signal_profile_alarm_clock; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_profile_alarm_clock, length, fl_status_string_signal_profile_alarm_clock_length) == F_equal_to) { + *code = F_signal_profile_alarm_clock; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_window_size_change, length, fl_status_string_signal_window_size_change_length) == f_equal_to) { - *code = f_signal_window_size_change; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_window_size_change, length, fl_status_string_signal_window_size_change_length) == F_equal_to) { + *code = F_signal_window_size_change; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_pollable_event, length, fl_status_string_signal_pollable_event_length) == f_equal_to) { - *code = f_signal_pollable_event; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_pollable_event, length, fl_status_string_signal_pollable_event_length) == F_equal_to) { + *code = F_signal_pollable_event; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_power_failure, length, fl_status_string_signal_power_failure_length) == f_equal_to) { - *code = f_signal_power_failure; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_power_failure, length, fl_status_string_signal_power_failure_length) == F_equal_to) { + *code = F_signal_power_failure; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_bad_system_call, length, fl_status_string_signal_bad_system_call_length) == f_equal_to) { - *code = f_signal_bad_system_call; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_bad_system_call, length, fl_status_string_signal_bad_system_call_length) == F_equal_to) { + *code = F_signal_bad_system_call; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_32, length, fl_status_string_signal_reserved_32_length) == f_equal_to) { - *code = f_signal_reserved_32; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_32, length, fl_status_string_signal_reserved_32_length) == F_equal_to) { + *code = F_signal_reserved_32; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_33, length, fl_status_string_signal_reserved_33_length) == f_equal_to) { - *code = f_signal_reserved_33; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_33, length, fl_status_string_signal_reserved_33_length) == F_equal_to) { + *code = F_signal_reserved_33; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_34, length, fl_status_string_signal_reserved_34_length) == f_equal_to) { - *code = f_signal_reserved_34; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_34, length, fl_status_string_signal_reserved_34_length) == F_equal_to) { + *code = F_signal_reserved_34; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_35, length, fl_status_string_signal_reserved_35_length) == f_equal_to) { - *code = f_signal_reserved_35; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_35, length, fl_status_string_signal_reserved_35_length) == F_equal_to) { + *code = F_signal_reserved_35; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_36, length, fl_status_string_signal_reserved_36_length) == f_equal_to) { - *code = f_signal_reserved_36; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_36, length, fl_status_string_signal_reserved_36_length) == F_equal_to) { + *code = F_signal_reserved_36; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_37, length, fl_status_string_signal_reserved_37_length) == f_equal_to) { - *code = f_signal_reserved_37; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_37, length, fl_status_string_signal_reserved_37_length) == F_equal_to) { + *code = F_signal_reserved_37; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_38, length, fl_status_string_signal_reserved_38_length) == f_equal_to) { - *code = f_signal_reserved_38; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_38, length, fl_status_string_signal_reserved_38_length) == F_equal_to) { + *code = F_signal_reserved_38; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_39, length, fl_status_string_signal_reserved_39_length) == f_equal_to) { - *code = f_signal_reserved_39; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_39, length, fl_status_string_signal_reserved_39_length) == F_equal_to) { + *code = F_signal_reserved_39; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_40, length, fl_status_string_signal_reserved_40_length) == f_equal_to) { - *code = f_signal_reserved_40; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_40, length, fl_status_string_signal_reserved_40_length) == F_equal_to) { + *code = F_signal_reserved_40; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_41, length, fl_status_string_signal_reserved_41_length) == f_equal_to) { - *code = f_signal_reserved_41; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_41, length, fl_status_string_signal_reserved_41_length) == F_equal_to) { + *code = F_signal_reserved_41; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_42, length, fl_status_string_signal_reserved_42_length) == f_equal_to) { - *code = f_signal_reserved_42; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_42, length, fl_status_string_signal_reserved_42_length) == F_equal_to) { + *code = F_signal_reserved_42; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_43, length, fl_status_string_signal_reserved_43_length) == f_equal_to) { - *code = f_signal_reserved_43; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_43, length, fl_status_string_signal_reserved_43_length) == F_equal_to) { + *code = F_signal_reserved_43; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_44, length, fl_status_string_signal_reserved_44_length) == f_equal_to) { - *code = f_signal_reserved_44; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_44, length, fl_status_string_signal_reserved_44_length) == F_equal_to) { + *code = F_signal_reserved_44; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_45, length, fl_status_string_signal_reserved_45_length) == f_equal_to) { - *code = f_signal_reserved_45; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_45, length, fl_status_string_signal_reserved_45_length) == F_equal_to) { + *code = F_signal_reserved_45; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_46, length, fl_status_string_signal_reserved_46_length) == f_equal_to) { - *code = f_signal_reserved_46; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_46, length, fl_status_string_signal_reserved_46_length) == F_equal_to) { + *code = F_signal_reserved_46; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_47, length, fl_status_string_signal_reserved_47_length) == f_equal_to) { - *code = f_signal_reserved_47; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_47, length, fl_status_string_signal_reserved_47_length) == F_equal_to) { + *code = F_signal_reserved_47; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_48, length, fl_status_string_signal_reserved_48_length) == f_equal_to) { - *code = f_signal_reserved_48; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_48, length, fl_status_string_signal_reserved_48_length) == F_equal_to) { + *code = F_signal_reserved_48; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_49, length, fl_status_string_signal_reserved_49_length) == f_equal_to) { - *code = f_signal_reserved_49; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_49, length, fl_status_string_signal_reserved_49_length) == F_equal_to) { + *code = F_signal_reserved_49; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_50, length, fl_status_string_signal_reserved_50_length) == f_equal_to) { - *code = f_signal_reserved_50; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_50, length, fl_status_string_signal_reserved_50_length) == F_equal_to) { + *code = F_signal_reserved_50; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_51, length, fl_status_string_signal_reserved_51_length) == f_equal_to) { - *code = f_signal_reserved_51; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_51, length, fl_status_string_signal_reserved_51_length) == F_equal_to) { + *code = F_signal_reserved_51; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_52, length, fl_status_string_signal_reserved_52_length) == f_equal_to) { - *code = f_signal_reserved_52; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_52, length, fl_status_string_signal_reserved_52_length) == F_equal_to) { + *code = F_signal_reserved_52; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_53, length, fl_status_string_signal_reserved_53_length) == f_equal_to) { - *code = f_signal_reserved_53; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_53, length, fl_status_string_signal_reserved_53_length) == F_equal_to) { + *code = F_signal_reserved_53; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_54, length, fl_status_string_signal_reserved_54_length) == f_equal_to) { - *code = f_signal_reserved_54; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_54, length, fl_status_string_signal_reserved_54_length) == F_equal_to) { + *code = F_signal_reserved_54; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_55, length, fl_status_string_signal_reserved_55_length) == f_equal_to) { - *code = f_signal_reserved_55; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_55, length, fl_status_string_signal_reserved_55_length) == F_equal_to) { + *code = F_signal_reserved_55; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_56, length, fl_status_string_signal_reserved_56_length) == f_equal_to) { - *code = f_signal_reserved_56; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_56, length, fl_status_string_signal_reserved_56_length) == F_equal_to) { + *code = F_signal_reserved_56; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_57, length, fl_status_string_signal_reserved_57_length) == f_equal_to) { - *code = f_signal_reserved_57; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_57, length, fl_status_string_signal_reserved_57_length) == F_equal_to) { + *code = F_signal_reserved_57; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_58, length, fl_status_string_signal_reserved_58_length) == f_equal_to) { - *code = f_signal_reserved_58; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_58, length, fl_status_string_signal_reserved_58_length) == F_equal_to) { + *code = F_signal_reserved_58; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_59, length, fl_status_string_signal_reserved_59_length) == f_equal_to) { - *code = f_signal_reserved_59; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_59, length, fl_status_string_signal_reserved_59_length) == F_equal_to) { + *code = F_signal_reserved_59; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_60, length, fl_status_string_signal_reserved_60_length) == f_equal_to) { - *code = f_signal_reserved_60; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_60, length, fl_status_string_signal_reserved_60_length) == F_equal_to) { + *code = F_signal_reserved_60; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_61, length, fl_status_string_signal_reserved_61_length) == f_equal_to) { - *code = f_signal_reserved_61; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_61, length, fl_status_string_signal_reserved_61_length) == F_equal_to) { + *code = F_signal_reserved_61; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_62, length, fl_status_string_signal_reserved_62_length) == f_equal_to) { - *code = f_signal_reserved_62; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_62, length, fl_status_string_signal_reserved_62_length) == F_equal_to) { + *code = F_signal_reserved_62; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_63, length, fl_status_string_signal_reserved_63_length) == f_equal_to) { - *code = f_signal_reserved_63; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_63, length, fl_status_string_signal_reserved_63_length) == F_equal_to) { + *code = F_signal_reserved_63; + return F_none; } - if (fl_string_compare(string, fl_status_string_signal_reserved_64, length, fl_status_string_signal_reserved_64_length) == f_equal_to) { - *code = f_signal_reserved_64; - return f_none; + if (fl_string_compare(string, fl_status_string_signal_reserved_64, length, fl_status_string_signal_reserved_64_length) == F_equal_to) { + *code = F_signal_reserved_64; + return F_none; } #endif // _di_fll_status_signals_ #ifndef _di_fll_status_basic_ - if (fl_string_compare(string, fl_status_string_none, length, fl_status_string_none_length) == f_equal_to) { - *code = f_none; - return f_none; + if (fl_string_compare(string, fl_status_string_none, length, fl_status_string_none_length) == F_equal_to) { + *code = F_none; + return F_none; } - if (fl_string_compare(string, fl_status_string_maybe, length, fl_status_string_maybe_length) == f_equal_to) { - *code = f_maybe; - return f_none; + if (fl_string_compare(string, fl_status_string_maybe, length, fl_status_string_maybe_length) == F_equal_to) { + *code = F_maybe; + return F_none; } - if (fl_string_compare(string, fl_status_string_dummy, length, fl_status_string_dummy_length) == f_equal_to) { - *code = f_dummy; - return f_none; + if (fl_string_compare(string, fl_status_string_dummy, length, fl_status_string_dummy_length) == F_equal_to) { + *code = F_dummy; + return F_none; } - if (fl_string_compare(string, fl_status_string_warn, length, fl_status_string_warn_length) == f_equal_to) { - *code = f_warn; - return f_none; + if (fl_string_compare(string, fl_status_string_warn, length, fl_status_string_warn_length) == F_equal_to) { + *code = F_warn; + return F_none; } - if (fl_string_compare(string, fl_status_string_block, length, fl_status_string_block_length) == f_equal_to) { - *code = f_block; - return f_none; + if (fl_string_compare(string, fl_status_string_block, length, fl_status_string_block_length) == F_equal_to) { + *code = F_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_critical, length, fl_status_string_critical_length) == f_equal_to) { - *code = f_critical; - return f_none; + if (fl_string_compare(string, fl_status_string_critical, length, fl_status_string_critical_length) == F_equal_to) { + *code = F_critical; + return F_none; } - if (fl_string_compare(string, fl_status_string_unknown, length, fl_status_string_unknown_length) == f_equal_to) { - *code = f_unknown; - return f_none; + if (fl_string_compare(string, fl_status_string_unknown, length, fl_status_string_unknown_length) == F_equal_to) { + *code = F_unknown; + return F_none; } - if (fl_string_compare(string, fl_status_string_unsupported, length, fl_status_string_unsupported_length) == f_equal_to) { - *code = f_unsupported; - return f_none; + if (fl_string_compare(string, fl_status_string_unsupported, length, fl_status_string_unsupported_length) == F_equal_to) { + *code = F_unsupported; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_data, length, fl_status_string_no_data_length) == f_equal_to) { - *code = f_no_data; - return f_none; + if (fl_string_compare(string, fl_status_string_no_data, length, fl_status_string_no_data_length) == F_equal_to) { + *code = F_data_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_space, length, fl_status_string_no_space_length) == f_equal_to) { - *code = f_no_space; - return f_none; + if (fl_string_compare(string, fl_status_string_no_space, length, fl_status_string_no_space_length) == F_equal_to) { + *code = F_space_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_out_of_bound, length, fl_status_string_out_of_bound_length) == f_equal_to) { - *code = f_out_of_bound; - return f_none; + if (fl_string_compare(string, fl_status_string_bound_out, length, fl_status_string_bound_out_length) == F_equal_to) { + *code = F_bound_out; + return F_none; } - if (fl_string_compare(string, fl_status_string_out_of_memory, length, fl_status_string_out_of_memory_length) == f_equal_to) { - *code = f_out_of_memory; - return f_none; + if (fl_string_compare(string, fl_status_string_memory_out, length, fl_status_string_memory_out_length) == F_equal_to) { + *code = F_memory_out; + return F_none; } - if (fl_string_compare(string, fl_status_string_prohibited, length, fl_status_string_prohibited_length) == f_equal_to) { - *code = f_prohibited; - return f_none; + if (fl_string_compare(string, fl_status_string_prohibited, length, fl_status_string_prohibited_length) == F_equal_to) { + *code = F_prohibited; + return F_none; } - if (fl_string_compare(string, fl_status_string_read_only, length, fl_status_string_read_only_length) == f_equal_to) { - *code = f_read_only; - return f_none; + if (fl_string_compare(string, fl_status_string_read_only, length, fl_status_string_read_only_length) == F_equal_to) { + *code = F_read_only; + return F_none; } - if (fl_string_compare(string, fl_status_string_input_error, length, fl_status_string_input_error_length) == f_equal_to) { - *code = f_error_input; - return f_none; + if (fl_string_compare(string, fl_status_string_input, length, fl_status_string_input_length) == F_equal_to) { + *code = F_input; + return F_none; } - if (fl_string_compare(string, fl_status_string_output_error, length, fl_status_string_output_error_length) == f_equal_to) { - *code = f_error_output; - return f_none; + if (fl_string_compare(string, fl_status_string_output, length, fl_status_string_output_length) == F_equal_to) { + *code = F_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_error_input_output; - return f_none; + if (fl_string_compare(string, fl_status_string_input_output, length, fl_status_string_input_output_length) == F_equal_to) { + *code = F_input_output; + return F_none; } - if (fl_string_compare(string, fl_status_string_does_not_exist, length, fl_status_string_does_not_exist_length) == f_equal_to) { - *code = f_does_not_exist; - return f_none; + if (fl_string_compare(string, fl_status_string_exist_not, length, fl_status_string_exist_not_length) == F_equal_to) { + *code = F_exist_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_not_connected, length, fl_status_string_not_connected_length) == f_equal_to) { - *code = f_not_connected; - return f_none; + if (fl_string_compare(string, fl_status_string_connected_not, length, fl_status_string_connected_not_length) == F_equal_to) { + *code = F_connected_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_failure, length, fl_status_string_failure_length) == f_equal_to) { - *code = f_failure; - return f_none; + if (fl_string_compare(string, fl_status_string_failure, length, fl_status_string_failure_length) == F_equal_to) { + *code = F_failure; + return F_none; } - if (fl_string_compare(string, fl_status_string_interrupted, length, fl_status_string_interrupted_length) == f_equal_to) { - *code = f_interrupted; - return f_none; + if (fl_string_compare(string, fl_status_string_interrupted, length, fl_status_string_interrupted_length) == F_equal_to) { + *code = F_interrupted; + return F_none; } - if (fl_string_compare(string, fl_status_string_loop, length, fl_status_string_loop_length) == f_equal_to) { - *code = f_loop; - return f_none; + if (fl_string_compare(string, fl_status_string_loop, length, fl_status_string_loop_length) == F_equal_to) { + *code = F_loop; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete, length, fl_status_string_incomplete_length) == f_equal_to) { - *code = f_incomplete; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete, length, fl_status_string_incomplete_length) == F_equal_to) { + *code = F_incomplete; + return F_none; } - if (fl_string_compare(string, fl_status_string_write_only, length, fl_status_string_write_only_length) == f_equal_to) { - *code = f_write_only; - return f_none; + if (fl_string_compare(string, fl_status_string_write_only, length, fl_status_string_write_only_length) == F_equal_to) { + *code = F_write_only; + return F_none; } #endif // _di_fll_status_basic_ #ifndef _di_fll_status_invalid_ - if (fl_string_compare(string, fl_status_string_invalid, length, fl_status_string_invalid_length) == f_equal_to) { - *code = f_invalid; - return f_none; + if (fl_string_compare(string, fl_status_string_invalid, length, fl_status_string_length) == F_equal_to) { + *code = F_invalid; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_name, length, fl_status_string_invalid_name_length) == f_equal_to) { - *code = f_invalid_name; - return f_none; + if (fl_string_compare(string, fl_status_string_name, length, fl_status_string_name_length) == F_equal_to) { + *code = F_name; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_parameter, length, fl_status_string_invalid_parameter_length) == f_equal_to) { - *code = f_invalid_parameter; - return f_none; + if (fl_string_compare(string, fl_status_string_parameter, length, fl_status_string_parameter_length) == F_equal_to) { + *code = F_parameter; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_syntax, length, fl_status_string_invalid_syntax_length) == f_equal_to) { - *code = f_invalid_syntax; - return f_none; + if (fl_string_compare(string, fl_status_string_syntax, length, fl_status_string_syntax_length) == F_equal_to) { + *code = F_syntax; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_data, length, fl_status_string_invalid_data_length) == f_equal_to) { - *code = f_invalid_data; - return f_none; + if (fl_string_compare(string, fl_status_string_data, length, fl_status_string_data_length) == F_equal_to) { + *code = F_data; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_file, length, fl_status_string_invalid_file_length) == f_equal_to) { - *code = f_invalid_file; - return f_none; + if (fl_string_compare(string, fl_status_string_descriptor, length, fl_status_string_descriptor_length) == F_equal_to) { + *code = F_descriptor; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_directory, length, fl_status_string_invalid_directory_length) == f_equal_to) { - *code = f_invalid_directory; - return f_none; + if (fl_string_compare(string, fl_status_string_socket, length, fl_status_string_socket_length) == F_equal_to) { + *code = F_socket; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_descriptor, length, fl_status_string_invalid_descriptor_length) == f_equal_to) { - *code = f_invalid_descriptor; - return f_none; + if (fl_string_compare(string, fl_status_string_device, length, fl_status_string_device_length) == F_equal_to) { + *code = F_device; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_socket, length, fl_status_string_invalid_socket_length) == f_equal_to) { - *code = f_invalid_socket; - return f_none; + if (fl_string_compare(string, fl_status_string_link, length, fl_status_string_link_length) == F_equal_to) { + *code = F_link; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_device, length, fl_status_string_invalid_device_length) == f_equal_to) { - *code = f_invalid_device; - return f_none; + if (fl_string_compare(string, fl_status_string_pipe, length, fl_status_string_pipe_length) == F_equal_to) { + *code = F_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_link, length, fl_status_string_invalid_link_length) == f_equal_to) { - *code = f_invalid_link; - return f_none; + if (fl_string_compare(string, fl_status_string_address, length, fl_status_string_address_length) == F_equal_to) { + *code = F_address; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_pipe, length, fl_status_string_invalid_pipe_length) == f_equal_to) { - *code = f_invalid_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_port, length, fl_status_string_port_length) == F_equal_to) { + *code = F_port; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_address, length, fl_status_string_invalid_address_length) == f_equal_to) { - *code = f_invalid_address; - return f_none; + if (fl_string_compare(string, fl_status_string_value, length, fl_status_string_value_length) == F_equal_to) { + *code = F_value; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_port, length, fl_status_string_invalid_port_length) == f_equal_to) { - *code = f_invalid_port; - return f_none; + if (fl_string_compare(string, fl_status_string_buffer, length, fl_status_string_buffer_length) == F_equal_to) { + *code = F_buffer; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_value, length, fl_status_string_invalid_value_length) == f_equal_to) { - *code = f_invalid_value; - return f_none; + if (fl_string_compare(string, fl_status_string_process, length, fl_status_string_process_length) == F_equal_to) { + *code = F_process; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_buffer, length, fl_status_string_invalid_buffer_length) == f_equal_to) { - *code = f_invalid_buffer; - return f_none; + if (fl_string_compare(string, fl_status_string_utf, length, fl_status_string_utf_length) == F_equal_to) { + *code = F_utf; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_process, length, fl_status_string_invalid_process_length) == f_equal_to) { - *code = f_invalid_process; - return f_none; + if (fl_string_compare(string, fl_status_string_eof, length, fl_status_string_eof_length) == F_equal_to) { + *code = F_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_utf, length, fl_status_string_invalid_utf_length) == f_equal_to) { - *code = f_invalid_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_eol, length, fl_status_string_eol_length) == F_equal_to) { + *code = F_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_on_eof, length, fl_status_string_invalid_on_eof_length) == f_equal_to) { - *code = f_invalid_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_eos, length, fl_status_string_eos_length) == F_equal_to) { + *code = F_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_invalid_on_eol, length, fl_status_string_invalid_on_eol_length) == f_equal_to) { - *code = f_invalid_on_eol; - return f_none; - } - - if (fl_string_compare(string, fl_status_string_invalid_on_eos, length, fl_status_string_invalid_on_eos_length) == f_equal_to) { - *code = f_invalid_on_eos; - return f_none; - } - - if (fl_string_compare(string, fl_status_string_invalid_on_stop, length, fl_status_string_invalid_on_stop_length) == f_equal_to) { - *code = f_invalid_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_stop, length, fl_status_string_stop_length) == F_equal_to) { + *code = F_stop; + return F_none; } #endif // _di_fll_status_invalid_ #ifndef _di_fll_status_busy_ - if (fl_string_compare(string, fl_status_string_busy, length, fl_status_string_busy_length) == f_equal_to) { - *code = f_busy; - return f_none; + if (fl_string_compare(string, fl_status_string_busy, length, fl_status_string_busy_length) == F_equal_to) { + *code = F_busy; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_address, length, fl_status_string_busy_address_length) == f_equal_to) { - *code = f_busy_address; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_address, length, fl_status_string_busy_address_length) == F_equal_to) { + *code = F_busy_address; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_port, length, fl_status_string_busy_port_length) == f_equal_to) { - *code = f_busy_port; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_port, length, fl_status_string_busy_port_length) == F_equal_to) { + *code = F_busy_port; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_socket, length, fl_status_string_busy_socket_length) == f_equal_to) { - *code = f_busy_socket; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_socket, length, fl_status_string_busy_socket_length) == F_equal_to) { + *code = F_busy_socket; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_device, length, fl_status_string_busy_device_length) == f_equal_to) { - *code = f_busy_device; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_device, length, fl_status_string_busy_device_length) == F_equal_to) { + *code = F_busy_device; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_pipe, length, fl_status_string_busy_pipe_length) == f_equal_to) { - *code = f_busy_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_pipe, length, fl_status_string_busy_pipe_length) == F_equal_to) { + *code = F_busy_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_buffer, length, fl_status_string_busy_buffer_length) == f_equal_to) { - *code = f_busy_buffer; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_buffer, length, fl_status_string_busy_buffer_length) == F_equal_to) { + *code = F_busy_buffer; + return F_none; } - if (fl_string_compare(string, fl_status_string_busy_process, length, fl_status_string_busy_process_length) == f_equal_to) { - *code = f_busy_process; - return f_none; + if (fl_string_compare(string, fl_status_string_busy_process, length, fl_status_string_busy_process_length) == F_equal_to) { + *code = F_busy_process; + return F_none; } #endif // _di_fll_status_busy_ #ifndef _di_fll_status_unavailable_ - if (fl_string_compare(string, fl_status_string_unavailable, length, fl_status_string_unavailable_length) == f_equal_to) { - *code = f_unavailable; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable, length, fl_status_string_unavailable_length) == F_equal_to) { + *code = F_unavailable; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_address, length, fl_status_string_unavailable_address_length) == f_equal_to) { - *code = f_unavailable_address; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_address, length, fl_status_string_unavailable_address_length) == F_equal_to) { + *code = F_unavailable_address; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_port, length, fl_status_string_unavailable_port_length) == f_equal_to) { - *code = f_unavailable_port; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_port, length, fl_status_string_unavailable_port_length) == F_equal_to) { + *code = F_unavailable_port; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_socket, length, fl_status_string_unavailable_socket_length) == f_equal_to) { - *code = f_unavailable_socket; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_socket, length, fl_status_string_unavailable_socket_length) == F_equal_to) { + *code = F_unavailable_socket; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_device, length, fl_status_string_unavailable_device_length) == f_equal_to) { - *code = f_unavailable_device; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_device, length, fl_status_string_unavailable_device_length) == F_equal_to) { + *code = F_unavailable_device; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_pipe, length, fl_status_string_unavailable_pipe_length) == f_equal_to) { - *code = f_unavailable_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_pipe, length, fl_status_string_unavailable_pipe_length) == F_equal_to) { + *code = F_unavailable_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_buffer, length, fl_status_string_unavailable_buffer_length) == f_equal_to) { - *code = f_unavailable_buffer; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_buffer, length, fl_status_string_unavailable_buffer_length) == F_equal_to) { + *code = F_unavailable_buffer; + return F_none; } - if (fl_string_compare(string, fl_status_string_unavailable_process, length, fl_status_string_unavailable_process_length) == f_equal_to) { - *code = f_unavailable_process; - return f_none; + if (fl_string_compare(string, fl_status_string_unavailable_process, length, fl_status_string_unavailable_process_length) == F_equal_to) { + *code = F_unavailable_process; + return F_none; } #endif // _di_fll_status_unavailable_ #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_number_underflow; - return f_none; + if (fl_string_compare(string, fl_status_string_underflow, length, fl_status_string_underflow_length) == F_equal_to) { + *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_number_overflow; - return f_none; + if (fl_string_compare(string, fl_status_string_overflow, length, fl_status_string_overflow_length) == F_equal_to) { + *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_number_divide_by_zero; - 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_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_number_negative; - 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_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_number_positive; - 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_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_number_zero; - 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_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_number_decimal; - 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_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_number_whole; - 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_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_number_invalid; - return f_none; + if (fl_string_compare(string, fl_status_string_number, length, fl_status_string_number_length) == F_equal_to) { + *code = F_number_invalid; + return F_none; } #endif // _di_fll_status_digits_ #ifndef _di_fll_status_buffers_ - if (fl_string_compare(string, fl_status_string_no_data_on_eof, length, fl_status_string_no_data_on_eof_length) == f_equal_to) { - *code = f_no_data_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_data_no_eof, length, fl_status_string_data_no_eof_length) == F_equal_to) { + *code = F_data_no_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_data_on_eol, length, fl_status_string_no_data_on_eol_length) == f_equal_to) { - *code = f_no_data_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_data_no_eol, length, fl_status_string_data_no_eol_length) == F_equal_to) { + *code = F_data_no_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_data_on_eos, length, fl_status_string_no_data_on_eos_length) == f_equal_to) { - *code = f_no_data_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_data_no_eos, length, fl_status_string_data_no_eos_length) == F_equal_to) { + *code = F_data_no_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_data_on_stop, length, fl_status_string_no_data_on_stop_length) == f_equal_to) { - *code = f_no_data_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_data_no_stop, length, fl_status_string_data_no_stop_length) == F_equal_to) { + *code = F_data_no_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_no_data_on_block, length, fl_status_string_no_data_on_block_length) == f_equal_to) { - *code = f_no_data_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_data_no_block, length, fl_status_string_data_no_block_length) == F_equal_to) { + *code = F_data_block_no; + return F_none; } - if (fl_string_compare(string, fl_status_string_none_on_eof, length, fl_status_string_none_on_eof_length) == f_equal_to) { - *code = f_none_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_none_eof, length, fl_status_string_none_eof_length) == F_equal_to) { + *code = F_none_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_none_on_eol, length, fl_status_string_none_on_eol_length) == f_equal_to) { - *code = f_none_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_none_eol, length, fl_status_string_none_eol_length) == F_equal_to) { + *code = F_none_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_none_on_eos, length, fl_status_string_none_on_eos_length) == f_equal_to) { - *code = f_none_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_none_eos, length, fl_status_string_none_eos_length) == F_equal_to) { + *code = F_none_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_none_on_stop, length, fl_status_string_none_on_stop_length) == f_equal_to) { - *code = f_none_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_none_stop, length, fl_status_string_none_stop_length) == F_equal_to) { + *code = F_none_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_none_on_block, length, fl_status_string_none_on_block_length) == f_equal_to) { - *code = f_none_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_none_block, length, fl_status_string_none_block_length) == F_equal_to) { + *code = F_none_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_error_on_eof, length, fl_status_string_error_on_eof_length) == f_equal_to) { - *code = f_error_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_eof, length, fl_status_string_eof_length) == F_equal_to) { + *code = F_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_error_on_eol, length, fl_status_string_error_on_eol_length) == f_equal_to) { - *code = f_error_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_eol, length, fl_status_string_eol_length) == F_equal_to) { + *code = F_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_error_on_eos, length, fl_status_string_error_on_eos_length) == f_equal_to) { - *code = f_error_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_error_on_eos, length, fl_status_string_error_on_eos_length) == F_equal_to) { + *code = F_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_error_on_stop, length, fl_status_string_error_on_stop_length) == f_equal_to) { - *code = f_error_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_stop, length, fl_status_string_stop_length) == F_equal_to) { + *code = F_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_error_on_block, length, fl_status_string_error_on_block_length) == f_equal_to) { - *code = f_error_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_block, length, fl_status_string_block_length) == F_equal_to) { + *code = F_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_buffer_too_small, length, fl_status_string_buffer_too_small_length) == f_equal_to) { - *code = f_buffer_too_small; - return f_none; + if (fl_string_compare(string, fl_status_string_buffer_too_small, length, fl_status_string_buffer_too_small_length) == F_equal_to) { + *code = F_buffer_too_small; + return F_none; } - if (fl_string_compare(string, fl_status_string_buffer_too_large, length, fl_status_string_buffer_too_large_length) == f_equal_to) { - *code = f_buffer_too_large; - return f_none; + if (fl_string_compare(string, fl_status_string_buffer_too_large, length, fl_status_string_buffer_too_large_length) == F_equal_to) { + *code = F_buffer_too_large; + return F_none; } - if (fl_string_compare(string, fl_status_string_string_too_small, length, fl_status_string_string_too_small_length) == f_equal_to) { - *code = f_string_too_small; - return f_none; + if (fl_string_compare(string, fl_status_string_string_too_small, length, fl_status_string_string_too_small_length) == F_equal_to) { + *code = F_string_too_small; + return F_none; } - if (fl_string_compare(string, fl_status_string_string_too_large, length, fl_status_string_string_too_large_length) == f_equal_to) { - *code = f_string_too_large; - return f_none; + if (fl_string_compare(string, fl_status_string_string_too_large, length, fl_status_string_string_too_large_length) == F_equal_to) { + *code = F_string_too_large; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated, length, fl_status_string_unterminated_length) == f_equal_to) { - *code = f_unterminated; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated, length, fl_status_string_unterminated_length) == F_equal_to) { + *code = F_unterminated; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_on_eof, length, fl_status_string_unterminated_on_eof_length) == f_equal_to) { - *code = f_unterminated_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_eof, length, fl_status_string_unterminated_eof_length) == F_equal_to) { + *code = F_unterminated_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_on_eol, length, fl_status_string_unterminated_on_eol_length) == f_equal_to) { - *code = f_unterminated_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_eol, length, fl_status_string_unterminated_eol_length) == F_equal_to) { + *code = F_unterminated_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_on_eos, length, fl_status_string_unterminated_on_eos_length) == f_equal_to) { - *code = f_unterminated_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_eos, length, fl_status_string_unterminated_eos_length) == F_equal_to) { + *code = F_unterminated_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_on_stop, length, fl_status_string_unterminated_on_stop_length) == f_equal_to) { - *code = f_unterminated_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_stop, length, fl_status_string_unterminated_stop_length) == F_equal_to) { + *code = F_unterminated_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_on_block, length, fl_status_string_unterminated_on_block_length) == f_equal_to) { - *code = f_unterminated_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_block, length, fl_status_string_unterminated_block_length) == F_equal_to) { + *code = F_unterminated_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group, length, fl_status_string_unterminated_group_length) == f_equal_to) { - *code = f_unterminated_group; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group, length, fl_status_string_unterminated_group_length) == F_equal_to) { + *code = F_unterminated_group; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group_on_eof, length, fl_status_string_unterminated_group_on_eof_length) == f_equal_to) { - *code = f_unterminated_group_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group_on_eof, length, fl_status_string_unterminated_group_on_eof_length) == F_equal_to) { + *code = F_unterminated_group_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group_on_eol, length, fl_status_string_unterminated_group_on_eol_length) == f_equal_to) { - *code = f_unterminated_group_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group_on_eol, length, fl_status_string_unterminated_group_on_eol_length) == F_equal_to) { + *code = F_unterminated_group_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group_on_eos, length, fl_status_string_unterminated_group_on_eos_length) == f_equal_to) { - *code = f_unterminated_group_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group_on_eos, length, fl_status_string_unterminated_group_on_eos_length) == F_equal_to) { + *code = F_unterminated_group_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group_on_stop, length, fl_status_string_unterminated_group_on_stop_length) == f_equal_to) { - *code = f_unterminated_group_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group_on_stop, length, fl_status_string_unterminated_group_on_stop_length) == F_equal_to) { + *code = F_unterminated_group_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_group_on_block, length, fl_status_string_unterminated_group_on_block_length) == f_equal_to) { - *code = f_unterminated_group_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_group_on_block, length, fl_status_string_unterminated_group_on_block_length) == F_equal_to) { + *code = F_unterminated_group_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest, length, fl_status_string_unterminated_nest_length) == f_equal_to) { - *code = f_unterminated_nest; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest, length, fl_status_string_unterminated_nest_length) == F_equal_to) { + *code = F_unterminated_nest; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eof, length, fl_status_string_unterminated_nest_on_eof_length) == f_equal_to) { - *code = f_unterminated_nest_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest_eof, length, fl_status_string_unterminated_nest_eof_length) == F_equal_to) { + *code = F_unterminated_nest_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eol, length, fl_status_string_unterminated_nest_on_eol_length) == f_equal_to) { - *code = f_unterminated_nest_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest_eol, length, fl_status_string_unterminated_nest_eol_length) == F_equal_to) { + *code = F_unterminated_nest_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eos, length, fl_status_string_unterminated_nest_on_eos_length) == f_equal_to) { - *code = f_unterminated_nest_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest_eos, length, fl_status_string_unterminated_nest_eos_length) == F_equal_to) { + *code = F_unterminated_nest_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_stop, length, fl_status_string_unterminated_nest_on_stop_length) == f_equal_to) { - *code = f_unterminated_nest_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest_stop, length, fl_status_string_unterminated_nest_stop_length) == F_equal_to) { + *code = F_unterminated_nest_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_block, length, fl_status_string_unterminated_nest_on_block_length) == f_equal_to) { - *code = f_unterminated_nest_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_unterminated_nest_block, length, fl_status_string_unterminated_nest_block_length) == F_equal_to) { + *code = F_unterminated_nest_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf, length, fl_status_string_incomplete_utf_length) == f_equal_to) { - *code = f_incomplete_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf, length, fl_status_string_incomplete_utf_length) == F_equal_to) { + *code = F_incomplete_utf; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eof, length, fl_status_string_incomplete_utf_on_eof_length) == f_equal_to) { - *code = f_incomplete_utf_on_eof; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eof, length, fl_status_string_incomplete_utf_on_eof_length) == F_equal_to) { + *code = F_incomplete_utf_eof; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eol, length, fl_status_string_incomplete_utf_on_eol_length) == f_equal_to) { - *code = f_incomplete_utf_on_eol; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eol, length, fl_status_string_incomplete_utf_on_eol_length) == F_equal_to) { + *code = F_incomplete_utf_eol; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eos, length, fl_status_string_incomplete_utf_on_eos_length) == f_equal_to) { - *code = f_incomplete_utf_on_eos; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf_on_eos, length, fl_status_string_incomplete_utf_on_eos_length) == F_equal_to) { + *code = F_incomplete_utf_eos; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf_on_stop, length, fl_status_string_incomplete_utf_on_stop_length) == f_equal_to) { - *code = f_incomplete_utf_on_stop; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf_on_stop, length, fl_status_string_incomplete_utf_on_stop_length) == F_equal_to) { + *code = F_incomplete_utf_stop; + return F_none; } - if (fl_string_compare(string, fl_status_string_incomplete_utf_on_block, length, fl_status_string_incomplete_utf_on_block_length) == f_equal_to) { - *code = f_incomplete_utf_on_block; - return f_none; + if (fl_string_compare(string, fl_status_string_incomplete_utf_on_block, length, fl_status_string_incomplete_utf_on_block_length) == F_equal_to) { + *code = F_incomplete_utf_block; + return F_none; } #endif // _di_fll_status_buffers_ #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_error_allocation; - return f_none; + if (fl_string_compare(string, fl_status_string_memory_allocation, length, fl_status_string_memory_allocation_length) == F_equal_to) { + *code = F_memory_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_error_reallocation; - return f_none; + if (fl_string_compare(string, fl_status_string_memory_reallocation, length, fl_status_string_memory_reallocation_length) == F_equal_to) { + *code = F_memory_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_error_deallocation; - return f_none; + if (fl_string_compare(string, fl_status_string_memory_deallocation, length, fl_status_string_memory_deallocation_length) == F_equal_to) { + *code = F_memory_deallocation; + return F_none; } #endif // _di_fll_status_allocation_ #ifndef _di_fll_status_fork_ - if (fl_string_compare(string, fl_status_string_fork_failed, length, fl_status_string_fork_failed_length) == f_equal_to) { - *code = f_fork_failed; - return f_none; + if (fl_string_compare(string, fl_status_string_fork, length, fl_status_string_fork_length) == F_equal_to) { + *code = F_fork; + return F_none; } - if (fl_string_compare(string, fl_status_string_too_many_processes, length, fl_status_string_too_many_processes_length) == f_equal_to) { - *code = f_too_many_processes; - return f_none; + if (fl_string_compare(string, fl_status_string_process_too_many, length, fl_status_string_process_too_many_length) == F_equal_to) { + *code = F_process_too_many; + return F_none; } #endif // _di_fll_status_fork_ #ifndef _di_fll_status_file_ - if (fl_string_compare(string, fl_status_string_file_closed, length, fl_status_string_file_closed_length) == f_equal_to) { - *code = f_file_closed; - return f_none; + if (fl_string_compare(string, fl_status_string_file_closed, length, fl_status_string_file_closed_length) == F_equal_to) { + *code = F_file_closed; + return F_none; } - 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_error_seek; - return f_none; + if (fl_string_compare(string, fl_status_string_file_seek, length, fl_status_string_file_seek_length) == F_equal_to) { + *code = F_file_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_error_read; - return f_none; + if (fl_string_compare(string, fl_status_string_file_read, length, fl_status_string_file_read_length) == F_equal_to) { + *code = F_file_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_error_write; - return f_none; + if (fl_string_compare(string, fl_status_string_file_write, length, fl_status_string_file_write_length) == F_equal_to) { + *code = F_file_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_error_flush; - return f_none; + if (fl_string_compare(string, fl_status_string_file_flush, length, fl_status_string_file_flush_length) == F_equal_to) { + *code = F_file_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_error_purge; - return f_none; + if (fl_string_compare(string, fl_status_string_file_purge, length, fl_status_string_file_purge_length) == F_equal_to) { + *code = F_file_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_error_open; - return f_none; + if (fl_string_compare(string, fl_status_string_file_open, length, fl_status_string_file_open_length) == F_equal_to) { + *code = F_file_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_error_close; - return f_none; + if (fl_string_compare(string, fl_status_string_file_close, length, fl_status_string_file_close_length) == F_equal_to) { + *code = F_file_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_error_synchronize; - return f_none; + if (fl_string_compare(string, fl_status_string_file_synchronize, length, fl_status_string_file_synchronize_length) == F_equal_to) { + *code = F_file_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_error_descriptor; - return f_none; + if (fl_string_compare(string, fl_status_string_file_descriptor, length, fl_status_string_file_descriptor_length) == F_equal_to) { + *code = F_file_descriptor; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_found, length, fl_status_string_file_not_found_length) == f_equal_to) { - *code = f_file_not_found; - return f_none; + if (fl_string_compare(string, fl_status_string_file_found_not, length, fl_status_string_file_found_not_length) == F_equal_to) { + *code = F_file_found_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_empty, length, fl_status_string_file_empty_length) == f_equal_to) { - *code = f_file_empty; - return f_none; + if (fl_string_compare(string, fl_status_string_file_empty, length, fl_status_string_file_empty_length) == F_equal_to) { + *code = F_file_empty; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_found, length, fl_status_string_file_found_length) == f_equal_to) { - *code = f_file_found; - return f_none; + if (fl_string_compare(string, fl_status_string_file_found, length, fl_status_string_file_found_length) == F_equal_to) { + *code = F_file_found; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_block, length, fl_status_string_file_is_type_block_length) == f_equal_to) { - *code = f_file_is_type_block; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_block, length, fl_status_string_file_type_block_length) == F_equal_to) { + *code = F_file_type_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_character, length, fl_status_string_file_is_type_character_length) == f_equal_to) { - *code = f_file_is_type_character; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_character, length, fl_status_string_file_type_character_length) == F_equal_to) { + *code = F_file_type_character; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_directory, length, fl_status_string_file_is_type_directory_length) == f_equal_to) { - *code = f_file_is_type_directory; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_directory, length, fl_status_string_file_type_directory_length) == F_equal_to) { + *code = F_file_type_directory; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_file, length, fl_status_string_file_is_type_file_length) == f_equal_to) { - *code = f_file_is_type_file; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_file, length, fl_status_string_file_type_file_length) == F_equal_to) { + *code = F_file_type_file; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_link, length, fl_status_string_file_is_type_link_length) == f_equal_to) { - *code = f_file_is_type_link; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_link, length, fl_status_string_file_type_link_length) == F_equal_to) { + *code = F_file_type_link; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_pipe, length, fl_status_string_file_is_type_pipe_length) == f_equal_to) { - *code = f_file_is_type_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_pipe, length, fl_status_string_file_type_pipe_length) == F_equal_to) { + *code = F_file_type_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_socket, length, fl_status_string_file_is_type_socket_length) == f_equal_to) { - *code = f_file_is_type_socket; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_socket, length, fl_status_string_file_type_socket_length) == F_equal_to) { + *code = F_file_type_socket; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_is_type_unknown, length, fl_status_string_file_is_type_unknown_length) == f_equal_to) { - *code = f_file_is_type_unknown; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_unknown, length, fl_status_string_file_type_unknown_length) == F_equal_to) { + *code = F_file_type_unknown; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_open, length, fl_status_string_file_not_open_length) == f_equal_to) { - *code = f_file_not_open; - return f_none; + if (fl_string_compare(string, fl_status_string_file_open_not, length, fl_status_string_file_open_not_length) == F_equal_to) { + *code = F_file_open_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_block, length, fl_status_string_file_not_type_block_length) == f_equal_to) { - *code = f_file_not_type_block; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_not_block, length, fl_status_string_file_type_not_block_length) == F_equal_to) { + *code = F_file_type_not_block; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_character, length, fl_status_string_file_not_type_character_length) == f_equal_to) { - *code = f_file_not_type_character; - return f_none; + if (fl_string_compare(string, fl_status_string_file_type_not_character, length, fl_status_string_file_type_not_character_length) == F_equal_to) { + *code = F_file_type_not_character; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_directory, length, fl_status_string_file_not_type_directory_length) == f_equal_to) { - *code = f_file_not_type_directory; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_directory, length, fl_status_string_file_not_type_directory_length) == F_equal_to) { + *code = F_file_type_not_directory; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_file, length, fl_status_string_file_not_type_file_length) == f_equal_to) { - *code = f_file_not_type_file; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_file, length, fl_status_string_file_not_type_file_length) == F_equal_to) { + *code = F_file_type_not_file; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_link, length, fl_status_string_file_not_type_link_length) == f_equal_to) { - *code = f_file_not_type_link; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_link, length, fl_status_string_file_not_type_link_length) == F_equal_to) { + *code = F_file_type_not_link; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_pipe, length, fl_status_string_file_not_type_pipe_length) == f_equal_to) { - *code = f_file_not_type_pipe; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_pipe, length, fl_status_string_file_not_type_pipe_length) == F_equal_to) { + *code = F_file_type_not_pipe; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_socket, length, fl_status_string_file_not_type_socket_length) == f_equal_to) { - *code = f_file_not_type_socket; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_socket, length, fl_status_string_file_not_type_socket_length) == F_equal_to) { + *code = F_file_type_not_socket; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_type_unknown, length, fl_status_string_file_not_type_unknown_length) == f_equal_to) { - *code = f_file_not_type_unknown; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_type_unknown, length, fl_status_string_file_not_type_unknown_length) == F_equal_to) { + *code = F_file_type_not_unknown; + return F_none; } - 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_error_allocation; - return f_none; + if (fl_string_compare(string, fl_status_string_file_allocation, length, fl_status_string_file_allocation_length) == F_equal_to) { + *code = F_file_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_error_reallocation; - return f_none; + if (fl_string_compare(string, fl_status_string_file_reallocation, length, fl_status_string_file_reallocation_length) == F_equal_to) { + *code = F_file_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_error_deallocation; - return f_none; + if (fl_string_compare(string, fl_status_string_file_deallocation, length, fl_status_string_file_deallocation_length) == F_equal_to) { + *code = F_file_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_error_stat; - return f_none; + if (fl_string_compare(string, fl_status_string_file_stat, length, fl_status_string_file_stat_length) == F_equal_to) { + *code = F_file_stat; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_error, length, fl_status_string_file_error_length) == f_equal_to) { - *code = f_file_error; - return f_none; + if (fl_string_compare(string, fl_status_string_file, length, fl_status_string_file_length) == F_equal_to) { + *code = F_file_error; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_not_utf, length, fl_status_string_file_not_utf_length) == f_equal_to) { - *code = f_file_not_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_file_not_utf, length, fl_status_string_file_not_utf_length) == F_equal_to) { + *code = F_file_not_utf; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_max_descriptors, length, fl_status_string_file_max_descriptors_length) == f_equal_to) { - *code = f_file_max_descriptors; - return f_none; + if (fl_string_compare(string, fl_status_string_file_descriptors_max, length, fl_status_string_file_descriptors_max_length) == F_equal_to) { + *code = F_file_descriptors_max; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_max_open, length, fl_status_string_file_max_open_length) == f_equal_to) { - *code = f_file_max_open; - return f_none; + if (fl_string_compare(string, fl_status_string_file_open_max, length, fl_status_string_file_open_max_length) == F_equal_to) { + *code = F_file_open_max; + return F_none; } - if (fl_string_compare(string, fl_status_string_file_utf, length, fl_status_string_file_utf_length) == f_equal_to) { - *code = f_file_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_file_utf, length, fl_status_string_file_utf_length) == F_equal_to) { + *code = F_file_utf; + return F_none; } #endif // _di_fll_status_file_ #ifndef _di_f_status_filesystem_ - if (fl_string_compare(string, fl_status_string_filesystem_error, length, fl_status_string_filesystem_error_length) == f_equal_to) { - *code = f_filesystem_error; - return f_none; + if (fl_string_compare(string, fl_status_string_filesystem_error, length, fl_status_string_filesystem_error_length) == F_equal_to) { + *code = F_filesystem; + return F_none; } - if (fl_string_compare(string, fl_status_string_filesystem_quota_blocks, length, fl_status_string_filesystem_quota_blocks_length) == f_equal_to) { - *code = f_filesystem_quota_blocks; - return f_none; + if (fl_string_compare(string, fl_status_string_filesystem_quota_blocks, length, fl_status_string_filesystem_quota_blocks_length) == F_equal_to) { + *code = F_filesystem_quota_blocks; + return F_none; } - if (fl_string_compare(string, fl_status_string_filesystem_quota_reached, length, fl_status_string_filesystem_quota_reached_length) == f_equal_to) { - *code = f_filesystem_quota_reached; - return f_none; + if (fl_string_compare(string, fl_status_string_filesystem_quota_reached, length, fl_status_string_filesystem_quota_reached_length) == F_equal_to) { + *code = F_filesystem_quota_reached; + return F_none; } #endif // _di_f_status_filesystem_ #ifndef _di_fll_status_directory_ - if (fl_string_compare(string, fl_status_string_directory_closed, length, fl_status_string_directory_closed_length) == f_equal_to) { - *code = f_directory_closed; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_closed, length, fl_status_string_directory_closed_length) == F_equal_to) { + *code = F_directory_closed; + return F_none; } - 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_error_read; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_read, length, fl_status_string_directory_read_length) == F_equal_to) { + *code = F_directory_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_error_write; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_write, length, fl_status_string_directory_write_length) == F_equal_to) { + *code = F_directory_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_error_flush; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_flush, length, fl_status_string_directory_flush_length) == F_equal_to) { + *code = F_directory_flush; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_error_link_max, length, fl_status_string_directory_error_link_max_length) == f_equal_to) { - *code = f_directory_error_link_max; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_link_max, length, fl_status_string_directory_link_max_length) == F_equal_to) { + *code = F_directory_link_max; + 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_error_purge; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_purge, length, fl_status_string_directory_purge_length) == F_equal_to) { + *code = F_directory_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_error_open; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_open, length, fl_status_string_directory_open_length) == F_equal_to) { + *code = F_directory_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_error_close; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_close, length, fl_status_string_directory_close_length) == F_equal_to) { + *code = F_directory_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_error_synchronize; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_synchronize, length, fl_status_string_directory_synchronize_length) == F_equal_to) { + *code = F_directory_synchronize; + 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_error_descriptor; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_descriptor, length, fl_status_string_directory_descriptor_length) == F_equal_to) { + *code = F_directory_descriptor; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_found, length, fl_status_string_directory_found_length) == f_equal_to) { - *code = f_directory_found; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_found, length, fl_status_string_directory_found_length) == F_equal_to) { + *code = F_directory_found; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_empty, length, fl_status_string_directory_empty_length) == f_equal_to) { - *code = f_directory_empty; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_empty, length, fl_status_string_directory_empty_length) == F_equal_to) { + *code = F_directory_empty; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_not_found, length, fl_status_string_directory_not_found_length) == f_equal_to) { - *code = f_directory_not_found; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_not_found, length, fl_status_string_directory_not_found_length) == F_equal_to) { + *code = F_directory_not_found; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_not_open, length, fl_status_string_directory_not_open_length) == f_equal_to) { - *code = f_directory_not_open; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_not_open, length, fl_status_string_directory_not_open_length) == F_equal_to) { + *code = F_directory_not_open; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_error, length, fl_status_string_directory_error_length) == f_equal_to) { - *code = f_directory_error; - return f_none; + if (fl_string_compare(string, fl_status_string_directory, length, fl_status_string_directory_length) == F_equal_to) { + *code = F_directory; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_not_utf, length, fl_status_string_directory_not_utf_length) == f_equal_to) { - *code = f_directory_not_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_not_utf, length, fl_status_string_directory_not_utf_length) == F_equal_to) { + *code = F_directory_utf_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_error_unsupported, length, fl_status_string_directory_error_unsupported_length) == f_equal_to) { - *code = f_directory_error_unsupported; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_unsupported, length, fl_status_string_directory_unsupported_length) == F_equal_to) { + *code = F_directory_unsupported; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_error_stream, length, fl_status_string_directory_error_stream_length) == f_equal_to) { - *code = f_directory_error_stream; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_stream, length, fl_status_string_directory_stream_length) == F_equal_to) { + *code = F_directory_stream; + return F_none; } - if (fl_string_compare(string, fl_status_string_directory_utf, length, fl_status_string_directory_utf_length) == f_equal_to) { - *code = f_directory_utf; - return f_none; + if (fl_string_compare(string, fl_status_string_directory_utf, length, fl_status_string_directory_utf_length) == F_equal_to) { + *code = F_directory_utf; + return F_none; } #endif // _di_fll_status_directory_ #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_error_connection_client; - return f_none; + if (fl_string_compare(string, fl_status_string_socket_connection_client, length, fl_status_string_socket_connection_client_length) == F_equal_to) { + *code = F_socket_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_error_connection_target; - return f_none; + if (fl_string_compare(string, fl_status_string_socket_connection_target, length, fl_status_string_socket_connection_target_length) == F_equal_to) { + *code = F_socket_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_error_receive; - return f_none; + if (fl_string_compare(string, fl_status_string_socket_receive, length, fl_status_string_socket_receive_length) == F_equal_to) { + *code = F_socket_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_error_send; - return f_none; + if (fl_string_compare(string, fl_status_string_socket_send, length, fl_status_string_socket_send_length) == F_equal_to) { + *code = F_socket_send; + return F_none; } #endif // _di_fll_status_socket_ #ifndef _di_fll_status_non_ - if (fl_string_compare(string, fl_status_string_less_than, length, fl_status_string_less_than_length) == f_equal_to) { - *code = f_less_than; - return f_none; + if (fl_string_compare(string, fl_status_string_than_less, length, fl_status_string_than_less_length) == F_equal_to) { + *code = F_than_less; + return F_none; } - if (fl_string_compare(string, fl_status_string_equal_to, length, fl_status_string_equal_to_length) == f_equal_to) { - *code = f_equal_to; - return f_none; + if (fl_string_compare(string, fl_status_string_equal_to, length, fl_status_string_equal_to_length) == F_equal_to) { + *code = F_equal_to; + return F_none; } - if (fl_string_compare(string, fl_status_string_not_equal_to, length, fl_status_string_not_equal_to_length) == f_equal_to) { - *code = f_not_equal_to; - return f_none; + if (fl_string_compare(string, fl_status_string_equal_to_not, length, fl_status_string_equal_to_not_length) == F_equal_to) { + *code = F_equal_to_not; + return F_none; } - if (fl_string_compare(string, fl_status_string_greater_than, length, fl_status_string_greater_than_length) == f_equal_to) { - *code = f_greater_than; - return f_none; + if (fl_string_compare(string, fl_status_string_than_greater, length, fl_status_string_than_greater_length) == F_equal_to) { + *code = F_than_greater; + return F_none; } #endif // _di_fll_status_non_ #ifndef _di_fll_status_access_denied_ - if (fl_string_compare(string, fl_status_string_access_denied, length, fl_status_string_access_denied_length) == f_equal_to) { - *code = f_access_denied; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied, length, fl_status_string_access_denied_length) == F_equal_to) { + *code = F_access_denied; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_user, length, fl_status_string_access_denied_user_length) == f_equal_to) { - *code = f_access_denied_user; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_user, length, fl_status_string_access_denied_user_length) == F_equal_to) { + *code = F_access_denied_user; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_group, length, fl_status_string_access_denied_group_length) == f_equal_to) { - *code = f_access_denied_group; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_group, length, fl_status_string_access_denied_group_length) == F_equal_to) { + *code = F_access_denied_group; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_world, length, fl_status_string_access_denied_world_length) == f_equal_to) { - *code = f_access_denied_world; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_world, length, fl_status_string_access_denied_world_length) == F_equal_to) { + *code = F_access_denied_world; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_read, length, fl_status_string_access_denied_read_length) == f_equal_to) { - *code = f_access_denied_read; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_read, length, fl_status_string_access_denied_read_length) == F_equal_to) { + *code = F_access_denied_read; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_write, length, fl_status_string_access_denied_write_length) == f_equal_to) { - *code = f_access_denied_write; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_write, length, fl_status_string_access_denied_write_length) == F_equal_to) { + *code = F_access_denied_write; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_execute, length, fl_status_string_access_denied_execute_length) == f_equal_to) { - *code = f_access_denied_execute; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_execute, length, fl_status_string_access_denied_execute_length) == F_equal_to) { + *code = F_access_denied_execute; + return F_none; } - if (fl_string_compare(string, fl_status_string_access_denied_super, length, fl_status_string_access_denied_super_length) == f_equal_to) { - *code = f_access_denied_super; - return f_none; + if (fl_string_compare(string, fl_status_string_access_denied_super, length, fl_status_string_access_denied_super_length) == F_equal_to) { + *code = F_access_denied_super; + return F_none; } #endif // _di_fll_status_access_denied_ - if (fl_string_compare(string, fl_status_string_status_code_last, length, fl_status_string_status_code_last_length) == f_equal_to) { - *code = f_status_code_last; - return f_none; + if (fl_string_compare(string, fl_status_string_status_code_last, length, fl_status_string_status_code_last_length) == F_equal_to) { + *code = F_status_code_last; + return F_none; } - return f_status_set_error(f_invalid_data); + return F_status_set_error(F_data); } #endif // _di_fll_status_from_string_ diff --git a/level_2/fll_status/c/status.h b/level_2/fll_status/c/status.h index 573d1ec..a729eb7 100644 --- a/level_2/fll_status/c/status.h +++ b/level_2/fll_status/c/status.h @@ -38,10 +38,10 @@ extern "C" { * The status code a matched string represents. * * @return - * f_none on success. - * f_no_data if string is empty. - * f_invalid_data (with error bit) if not found. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not if string is empty. + * F_data (with error bit) if not found. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fll_status_from_string_ extern f_return_status fll_status_from_string(const f_string string, f_status *code); diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index fd85a28..332c5c6 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -64,13 +64,13 @@ extern "C" { printf("%c%c", f_string_eol, f_string_eol); - return f_none; + return F_none; } #endif // _di_byte_dump_print_help_ #ifndef _di_byte_dump_main_ f_return_status byte_dump_main(const f_console_arguments arguments, byte_dump_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, byte_dump_total_parameters }; @@ -83,14 +83,14 @@ extern "C" { choices.id = ids; choices.used = 3; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } // Identify priority of mode parameters. @@ -103,9 +103,9 @@ extern "C" { status = f_console_parameter_prioritize_right(parameters, choices, &choice); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } if (choice == byte_dump_parameter_hexidecimal) { @@ -135,9 +135,9 @@ extern "C" { status = f_console_parameter_prioritize_right(parameters, choices, &choice); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } if (choice == byte_dump_parameter_normal) { @@ -152,7 +152,7 @@ extern "C" { } } - status = f_none; + status = F_none; if (data->parameters[byte_dump_parameter_help].result == f_console_result_found) { byte_dump_print_help(data->context); @@ -167,13 +167,13 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_width].result == f_console_result_additional) { f_number_unsigned number = 0; status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_width].additional.array[data->parameters[byte_dump_parameter_width].additional.used - 1]], &number); - if (f_status_is_error(status) || number < 1 || number >= 0xfb) { + if (F_status_is_error(status) || number < 1 || number >= 0xfb) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number between "); @@ -183,7 +183,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } data->width = (uint8_t) number; @@ -195,13 +195,13 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_first].result == f_console_result_additional) { f_number_unsigned number = 0; status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_first].additional.array[data->parameters[byte_dump_parameter_first].additional.used - 1]], &number); - if (f_status_is_error(status) || number > f_type_number_size_unsigned) { + if (F_status_is_error(status) || number > f_type_number_size_unsigned) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); @@ -211,7 +211,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } data->first = number; @@ -223,13 +223,13 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } else if (data->parameters[byte_dump_parameter_last].result == f_console_result_additional) { f_number_unsigned number = 0; status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_last].additional.array[data->parameters[byte_dump_parameter_last].additional.used - 1]], &number); - if (f_status_is_error(status) || number < 0 || number > f_type_number_size_unsigned) { + if (F_status_is_error(status) || number < 0 || number > f_type_number_size_unsigned) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); @@ -239,7 +239,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } data->last = number; @@ -254,7 +254,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' value."); byte_dump_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } // store last position as a relative offset from first instead of an absolute position. @@ -289,7 +289,7 @@ extern "C" { status = byte_dump_file(*data, "-", file); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { byte_dump_delete_data(data); return status; } @@ -298,21 +298,21 @@ extern "C" { if (data->remaining.used > 0) { // pre-process remaining arguments to ensure that they all files exist before processing. { - f_status missing_files = f_none; + f_status missing_files = F_none; for (f_array_length counter = 0; counter < data->remaining.used; counter++) { status = f_file_exists(arguments.argv[data->remaining.array[counter]]); - if (status == f_false || f_status_is_error(status)) { - if (missing_files == f_none) { + if (status == F_false || F_status_is_error(status)) { + if (missing_files == F_none) { missing_files = status; } - byte_dump_print_file_error(data->context, "f_file_exists", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + byte_dump_print_file_error(data->context, "f_file_exists", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); } } // for - if (missing_files != f_none) { - status = f_status_set_error(missing_files); + if (missing_files != F_none) { + status = F_status_set_error(missing_files); byte_dump_delete_data(data); return status; @@ -323,8 +323,8 @@ extern "C" { f_file file = f_file_initialize; status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file); - if (f_status_is_error(status)) { - byte_dump_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + byte_dump_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); byte_dump_delete_data(data); return status; } @@ -356,19 +356,19 @@ extern "C" { f_file_close(&file.id); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { byte_dump_delete_data(data); return status; } } // for } else { - status = f_false; + status = F_false; } } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more filenames."); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } byte_dump_delete_data(data); @@ -387,7 +387,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_byte_dump_delete_data_ diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index c21b5ef..9114083 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -216,7 +216,7 @@ extern "C" { { \ byte_dump_console_parameter_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ 0, \ 0, \ 8, \ @@ -233,7 +233,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_byte_dump_print_help_ extern f_return_status byte_dump_print_help(const fl_color_context context); @@ -250,7 +250,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see byte_dump_delete_data() @@ -268,7 +268,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see byte_dump_main() diff --git a/level_3/byte_dump/c/main.c b/level_3/byte_dump/c/main.c index 027dacb..0b81a2f 100644 --- a/level_3/byte_dump/c/main.c +++ b/level_3/byte_dump/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { byte_dump_data data = byte_dump_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = byte_dump_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 9937147..ab61a6a 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_byte_dump_file_ f_return_status byte_dump_file(const byte_dump_data data, const f_string file_name, f_file file) { - f_status status = f_none; + f_status status = F_none; uint64_t position = 0; uint8_t size = 0; @@ -22,7 +22,7 @@ extern "C" { byte_dump_previous previous = byte_dump_previous_initialize; bool character_reset = 0; - bool found_invalid_utf = f_false; + bool found_invalid_utf = F_false; // Store the current character data until it can be printed. f_utf_string_dynamic characters = f_utf_string_dynamic_initialize; @@ -53,7 +53,7 @@ extern "C" { // The character is reset, the characters.used is to be reset. if (character_reset) { characters.used = 0; - character_reset = f_false; + character_reset = F_false; memset(&invalid, 0, sizeof(uint8_t) * data.width); } @@ -70,7 +70,7 @@ extern "C" { // The first character in a UTF-8 sequence cannot have a width of 1. if (width_utf == 1) { - found_invalid_utf = f_true; + found_invalid_utf = F_true; invalid[character_current] = 1; } // Process the UTF-8 character. @@ -100,36 +100,36 @@ extern "C" { if (width_count < width_utf) continue; } else { - found_invalid_utf = f_true; + found_invalid_utf = F_true; invalid[character_current] = width_utf; } } // At this point: an ASCII character is collected, the entire UTF-8 character sequence is collected, or an invalid UTF-8 was processed. if (!invalid[character_current] && width_utf > 1) { - if (f_utf_character_is_valid(characters.string[character_current]) == f_false) { - found_invalid_utf = f_true; + if (f_utf_character_is_valid(characters.string[character_current]) == F_false) { + found_invalid_utf = F_true; invalid[character_current] = width_utf; } } - if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 1, &previous, &cell, &offset) == f_true) { - character_reset = f_true; + if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 1, &previous, &cell, &offset) == F_true) { + character_reset = F_true; } if (width_utf > 1) { - if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 2, &previous, &cell, &offset) == f_true) { - character_reset = f_true; + if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 2, &previous, &cell, &offset) == F_true) { + character_reset = F_true; } if (width_utf > 2) { - if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 3, &previous, &cell, &offset) == f_true) { - character_reset = f_true; + if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 3, &previous, &cell, &offset) == F_true) { + character_reset = F_true; } if (width_utf > 3) { - if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 4, &previous, &cell, &offset) == f_true) { - character_reset = f_true; + if (byte_dump_print_character_fragment(data, characters, invalid, width_utf, 4, &previous, &cell, &offset) == F_true) { + character_reset = F_true; } } } @@ -218,7 +218,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", file_name); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); printf("%c", f_string_eol); - status = f_status_set_error(f_failure); + status = F_status_set_error(F_failure); } fflush(f_type_error); @@ -231,7 +231,7 @@ extern "C" { bool byte_dump_print_character_fragment(const byte_dump_data data, const f_utf_string_static characters, const uint8_t invalid[], const int8_t width_utf, const int8_t byte_current, byte_dump_previous *previous, byte_dump_cell *cell, uint8_t *offset) { uint8_t byte = 0; - bool reset = f_false; + bool reset = F_false; f_utf_string_length character_current = characters.used - 1; @@ -386,7 +386,7 @@ extern "C" { bytes = width_utf - byte_current; } - reset = f_true; + reset = F_true; if (data.parameters[byte_dump_parameter_text].result == f_console_result_found) { byte_dump_print_text(data, characters, invalid, previous, offset); @@ -432,7 +432,7 @@ extern "C" { uint8_t j = 0; uint8_t output = 0; uint8_t width_utf = 0; - bool printed = f_false; + bool printed = F_false; fl_color_print(f_type_output, data.context.notable, data.context.reset, " %s ", byte_dump_character_wall); @@ -617,7 +617,7 @@ extern "C" { printf("."); } } - else if (f_utf_character_is_whitespace(characters.string[i]) == f_true) { + else if (f_utf_character_is_whitespace(characters.string[i]) == F_true) { if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } @@ -625,7 +625,7 @@ extern "C" { fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space); } } - else if (f_utf_character_is_zero_width(characters.string[i]) == f_true) { + else if (f_utf_character_is_zero_width(characters.string[i]) == F_true) { if (data.presentation == byte_dump_presentation_classic) { printf("."); } @@ -636,7 +636,7 @@ extern "C" { printf(" "); } } - else if (f_utf_character_is_control(characters.string[i]) == f_true) { + else if (f_utf_character_is_control(characters.string[i]) == F_true) { // print a space (or '.') for control characters. if (data.presentation == byte_dump_presentation_classic) { fl_color_print(f_type_output, data.context.warning, data.context.reset, "."); @@ -825,14 +825,14 @@ extern "C" { #ifndef _di_byte_dump_print_file_error_ void byte_dump_print_file_error(const fl_color_context context, const f_string function, const f_string file_name, const f_status status) { - if (status == f_false) { + if (status == F_false) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ", function, file_name); fl_color_print(f_type_error, context.notable, context.reset, "%s", function); fl_color_print(f_type_error, context.error, context.reset, "() for the file '"); @@ -841,42 +841,42 @@ extern "C" { return; } - if (status == f_invalid_name) { + if (status == F_name) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid filename '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_out_of_memory) { + if (status == F_memory_out) { fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to access file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_number_overflow) { + if (status == F_number_overflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to access file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_invalid_directory) { + if (status == F_directory) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to access file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_access_denied) { + if (status == F_access_denied) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to access file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); return; } - if (status == f_loop) { + if (status == F_loop) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to access file '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); diff --git a/level_3/byte_dump/c/private-byte_dump.h b/level_3/byte_dump/c/private-byte_dump.h index 8f8a852..fe2f676 100644 --- a/level_3/byte_dump/c/private-byte_dump.h +++ b/level_3/byte_dump/c/private-byte_dump.h @@ -66,8 +66,8 @@ extern "C" { * Data for the file to print. * * @return - * f_none on success. - * f_failure (with error bit) on failure, usually when read() fails. + * F_none on success. + * F_failure (with error bit) on failure, usually when read() fails. */ #ifndef _di_byte_dump_file_ extern f_return_status byte_dump_file(const byte_dump_data data, const f_string file_name, f_file file) f_gcc_attribute_visibility_internal; @@ -105,8 +105,8 @@ extern "C" { * Will be reduced to 0 once used. * * @return - * f_true is returned to designate that a reset is needed. - * f_false is returned to designate that a reset is not needed. + * F_true is returned to designate that a reset is needed. + * F_false is returned to designate that a reset is not needed. * * @see byte_dump_print_text() */ @@ -151,8 +151,8 @@ extern "C" { * The status code representing the error. * * @param - * f_true if error has been printed. - * f_false if error has not been printed. + * F_true if error has been printed. + * F_false if error has not been printed. */ #ifndef _di_byte_dump_print_file_error_ extern void byte_dump_print_file_error(const fl_color_context context, const f_string function, const f_string file_name, const f_status status) f_gcc_attribute_visibility_internal; diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 6b3e4a5..28a93c6 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -70,13 +70,13 @@ extern "C" { printf("%c%c", f_string_eol, f_string_eol); - return f_none; + return F_none; } #endif // _di_fake_print_help_ #ifndef _di_fake_main_ f_return_status fake_main(const f_console_arguments arguments, fake_data *data) { - f_status status = f_none; + f_status status = F_none; uint8_t operations[fake_operations_total]; f_string operations_name[fake_operations_total]; @@ -95,10 +95,10 @@ extern "C" { choices.id = ids; choices.used = 3; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fll_program_parameter_process", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fll_program_parameter_process", F_true); fake_delete_data(data); return status; } @@ -115,8 +115,8 @@ extern "C" { status = f_console_parameter_prioritize_right(parameters, choices, &choice); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_console_parameter_prioritize_right", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); fake_delete_data(data); return status; } @@ -132,7 +132,7 @@ extern "C" { } } - status = f_none; + status = F_none; // Determine order of operations. // @todo: this should probably implemented as a standard function, such as: f_console_parameter_prioritize_set_right(). @@ -250,7 +250,7 @@ extern "C" { } } - status = f_none; + status = F_none; if (data->parameters[fake_parameter_help].result == f_console_result_found) { fake_print_help(data->context); @@ -259,17 +259,17 @@ extern "C" { fll_program_print_version(fake_version); } else if (operations[0]) { - bool validate_parameter_directories = f_true; + bool validate_parameter_directories = F_true; status = fake_process_console_parameters(arguments, data); - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = fake_path_generate(data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fake_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } for (uint8_t i = 0; i < fake_operations_total && operations[i]; i++) { @@ -278,27 +278,27 @@ extern "C" { if (operations[i] == fake_operation_build) { if (validate_parameter_directories) { status = fake_validate_parameter_directories(arguments, *data); - validate_parameter_directories = f_false; + validate_parameter_directories = F_false; } - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = fake_build_operate(*data); } } else if (operations[i] == fake_operation_clean) { if (validate_parameter_directories) { status = fake_validate_parameter_directories(arguments, *data); - validate_parameter_directories = f_false; + validate_parameter_directories = F_false; } - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = fake_clean_operate(*data); } } else if (operations[i] == fake_operation_make) { if (validate_parameter_directories) { status = fake_validate_parameter_directories(arguments, *data); - validate_parameter_directories = f_false; + validate_parameter_directories = F_false; } if (data->verbosity != fake_verbosity_quiet) { @@ -312,7 +312,7 @@ extern "C" { status = fake_skeleton_operate(*data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the operation '"); @@ -326,7 +326,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quite mode. if (data->verbosity != fake_verbosity_quiet) { - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fprintf(f_type_error, "%c", f_string_eol); } else { @@ -341,7 +341,7 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol); } - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } fake_delete_data(data); @@ -410,7 +410,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fake_delete_data_ diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 447bd51..07eaa18 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -475,7 +475,7 @@ extern "C" { { \ fake_console_parameter_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ 0, \ fake_verbosity_normal, \ f_string_dynamic_initialize, \ @@ -529,7 +529,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fake_print_help_ extern f_return_status fake_print_help(const fl_color_context context); @@ -546,7 +546,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fake_delete_data() @@ -564,7 +564,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fake_main() diff --git a/level_3/fake/c/main.c b/level_3/fake/c/main.c index 0cfad3f..e5cb91a 100644 --- a/level_3/fake/c/main.c +++ b/level_3/fake/c/main.c @@ -6,7 +6,7 @@ int main(const unsigned long argc, const f_string *argv) { f_status status = fake_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index fa99e7d..676a516 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -8,15 +8,15 @@ extern "C" { #ifndef _di_fake_build_execute_process_script_ f_return_status fake_build_execute_process_script(const fake_data data, const fake_build_settings settings, const f_string_static process_script) { - if (process_script.used == 0) return f_none; + if (process_script.used == 0) return F_none; - f_status status = f_none; + f_status status = F_none; f_string_dynamics arguments = f_string_dynamics_initialize; status = fll_execute_arguments_add(fake_other_operation_build, fake_other_operation_build_length, &arguments); // ensure console color mode is passed to the scripts so that they can also react to color mode. - if (!f_status_is_error(status) && data.context.mode != f_color_mode_none) { + if (!F_status_is_error(status) && data.context.mode != f_color_mode_none) { char argument[3] = { f_console_symbol_disable, 0, 0 }; if (data.context.mode == f_color_mode_dark) { @@ -33,7 +33,7 @@ extern "C" { } // ensure verbosity level is passed to the scripts so that they can also react to requested verbosity. - if (!f_status_is_error(status) && data.verbosity != fake_verbosity_normal) { + if (!F_status_is_error(status) && data.verbosity != fake_verbosity_normal) { char argument[3] = { f_console_symbol_disable, 0, 0 }; if (data.verbosity == fake_verbosity_quiet) { @@ -49,8 +49,8 @@ extern "C" { status = fll_execute_arguments_add(argument, 2, &arguments); } - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_execute_arguments_add", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_arguments_add", F_true); f_macro_string_dynamics_delete_simple(arguments); return status; @@ -119,8 +119,8 @@ extern "C" { status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_prefix_length, parameters_name, parameters_name_length, parameters_value, parameters_value_length, 7, &arguments); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_execute_arguments_add_parameter_set", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_arguments_add_parameter_set", F_true); f_macro_string_dynamics_delete_simple(arguments); return status; @@ -137,17 +137,17 @@ extern "C" { status = fl_string_dynamic_append_nulless(data.path_data_build, &path); } - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { status = fl_string_dynamic_append_nulless(process_script, &path); } - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { function = "fl_string_dynamic_terminate"; status = fl_string_dynamic_terminate(&path); } - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), function, f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), function, F_true); f_macro_string_dynamic_delete_simple(path); f_macro_string_dynamics_delete_simple(arguments); @@ -172,8 +172,8 @@ extern "C" { }; f_macro_string_dynamics_new(status, names, 2); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "f_macro_string_dynamics_new", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true); f_macro_string_dynamic_delete_simple(path); f_macro_string_dynamics_delete_simple(arguments); @@ -185,7 +185,7 @@ extern "C" { for (uint8_t i = 0; i < 2; i++) { status = fl_string_append(variables_name[i], variables_length[i], &part); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; names.array[names.used].string = part.string; names.array[names.used].used = part.used; @@ -195,7 +195,7 @@ extern "C" { f_macro_string_dynamic_clear(part); } // for - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { if (names.used + settings.environment.used > names.size) { if (names.used + settings.environment.used > f_array_length_size) { if (data.verbosity != fake_verbosity_quiet) { @@ -210,12 +210,12 @@ extern "C" { f_macro_string_dynamic_delete_simple(part); f_macro_string_dynamics_delete_simple(arguments); f_macro_string_dynamics_delete_simple(names); - return f_status_set_error(f_buffer_too_large); + return F_status_set_error(F_buffer_too_large); } f_macro_string_dynamics_resize(status, names, names.used + settings.environment.used); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "f_macro_string_dynamics_resize", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_macro_string_dynamics_resize", F_true); f_macro_string_dynamic_delete_simple(part); f_macro_string_dynamics_delete_simple(arguments); @@ -226,7 +226,7 @@ extern "C" { for (f_string_length i = 0; i < settings.environment.used; i++) { status = fl_string_dynamic_append_nulless(settings.environment.array[i], &part); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; names.array[names.used].string = part.string; names.array[names.used].used = part.used; @@ -239,8 +239,8 @@ extern "C" { f_macro_string_dynamic_delete_simple(part); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fl_string_append", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_append", F_true); f_macro_string_dynamic_delete_simple(path); f_macro_string_dynamics_delete_simple(arguments); @@ -257,10 +257,10 @@ extern "C" { for (f_string_length i = 0; i < names.used; i++) { status = f_environment_get_dynamic(names.array[i], &variable_value); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_reallocation) { + if (status == F_memory_reallocation) { function = "f_macro_string_dynamics_resize"; break; } @@ -269,11 +269,11 @@ extern "C" { if (environment_names.used + 1 > environment_names.size) { f_macro_string_dynamics_resize(status, environment_names, environment_names.size + f_memory_default_allocation_step); - if (!f_status_is_error(status)) { + if (!F_status_is_error(status)) { f_macro_string_dynamics_resize(status, environment_values, environment_values.size + f_memory_default_allocation_step); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { function = "f_macro_string_dynamics_resize"; break; } @@ -281,7 +281,7 @@ extern "C" { status = fl_string_dynamic_append(names.array[i], &variable_name); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { function = "fl_string_append"; break; } @@ -302,8 +302,8 @@ extern "C" { f_macro_string_dynamics_delete_simple(names); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, status, function, f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, status, function, F_true); f_macro_string_dynamic_delete_simple(variable_name); f_macro_string_dynamic_delete_simple(variable_value); @@ -323,8 +323,8 @@ extern "C" { f_macro_string_dynamics_delete_simple(arguments); } - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_failure) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_failure) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to execute script: "); @@ -333,7 +333,7 @@ extern "C" { } } else { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_execute_path_environment", f_true); + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_execute_path_environment", F_true); } } @@ -350,18 +350,18 @@ extern "C" { fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Building project."); } - f_status status = f_none; + f_status status = F_none; fake_build_settings settings = fake_build_settings_initialize; status = fake_build_settings_load(data, &settings); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fake_macro_build_settings_delete_simple(settings); return status; } status = fake_build_execute_process_script(data, settings, settings.process_pre); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fake_macro_build_settings_delete_simple(settings); return status; } @@ -387,7 +387,7 @@ extern "C" { #ifndef _di_fake_build_settings_load_ f_return_status fake_build_settings_load(const fake_data data, fake_build_settings *settings) { - f_status status = f_none; + f_status status = F_none; f_file file = f_file_initialize; f_string_dynamic buffer = f_string_dynamic_initialize; @@ -397,23 +397,23 @@ extern "C" { name_function = "f_file_exists"; status = f_file_exists(data.file_data_build_settings.string); - if (status == f_true) { + if (status == F_true) { name_function = "f_file_open"; status = f_file_open(data.file_data_build_settings.string, 0, &file); - if (status == f_none) { + if (status == F_none) { name_function = "f_file_read"; status = f_file_read(file, &buffer); f_file_close(&file.id); } } - else if (status == f_false) { - status = f_status_set_error(f_file_not_found); + else if (status == F_false) { + status = F_status_set_error(F_file_found_not); } - if (f_status_is_error(status)) { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), name_function, data.file_data_build_settings.string, "create", f_true, f_true); + if (F_status_is_error(status)) { + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), name_function, data.file_data_build_settings.string, "create", F_true, F_true); f_macro_string_dynamic_delete_simple(buffer); return status; @@ -424,19 +424,19 @@ extern "C" { f_fss_objects objects = f_fss_objects_initialize; f_fss_contents contents = f_fss_contents_initialize; f_string_range range = f_string_range_initialize; - bool error_printed = f_false; + bool error_printed = F_false; range.start = 0; range.stop = buffer.used - 1; status = fll_fss_extended_read(&buffer, &range, &objects, &contents); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_fss_objects_delete_simple(objects); f_macro_fss_contents_delete_simple(contents); f_macro_string_dynamic_delete_simple(buffer); - if (status == f_status_set_error(f_incomplete_utf_on_stop)) { + if (status == F_status_set_error(F_incomplete_utf_stop)) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); @@ -446,7 +446,7 @@ extern "C" { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "')."); } } - else if (status == f_status_set_error(f_incomplete_utf_on_stop)) { + else if (status == F_status_set_error(F_incomplete_utf_stop)) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); @@ -457,7 +457,7 @@ extern "C" { } } else { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_fss_extended_read", f_true); + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fll_fss_extended_read", F_true); } f_macro_fss_objects_delete_simple(objects); @@ -599,13 +599,13 @@ extern "C" { status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, settings_length, settings_value, fake_build_settings_total); - if (status == f_none) { + if (status == F_none) { f_string_dynamic settings_mode_name_dynamic[fake_build_settings_total]; f_string settings_mode_names[fake_build_settings_total]; f_string_length setting_mode_lengths[fake_build_settings_total]; const f_string_dynamics *modes = &settings->modes_default; - bool found = f_false; + bool found = F_false; f_array_length i = 0; f_array_length j = 0; @@ -616,16 +616,16 @@ extern "C" { } for (; i < modes->used; i++) { - found = f_false; + found = F_false; for (j = 0; j < settings->modes.used; j++) { - if (fl_string_dynamic_compare_trim(modes->array[i], settings->modes.array[j]) == f_equal_to) { - found = f_true; + if (fl_string_dynamic_compare_trim(modes->array[i], settings->modes.array[j]) == F_equal_to) { + found = F_true; break; } } // for - if (found == f_false) { + if (found == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: the specified mode '"); @@ -635,8 +635,8 @@ extern "C" { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); } - error_printed = f_true; - status = f_status_set_error(f_invalid_parameter); + error_printed = F_true; + status = F_status_set_error(F_parameter); break; } @@ -648,7 +648,7 @@ extern "C" { setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used; f_macro_string_dynamic_new(status, settings_mode_name_dynamic[j], setting_mode_lengths[j]); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { function = "f_macro_string_dynamic_new"; break; } @@ -660,10 +660,10 @@ extern "C" { settings_mode_names[j] = settings_mode_name_dynamic[j].string; } // for - if (status == f_none) { + if (status == F_none) { status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, setting_mode_lengths, settings_value, fake_build_settings_total); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { function = "fll_fss_snatch_apart"; } } @@ -672,12 +672,12 @@ extern "C" { f_macro_string_dynamic_delete_simple(settings_mode_name_dynamic[j]); } // for - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } // for } - if (f_status_is_error(status)) { - if (status == f_status_set_error(f_string_too_large)) { + if (F_status_is_error(status)) { + if (status == F_status_set_error(F_string_too_large)) { if (data.verbosity != fake_verbosity_quiet) { // @todo update FSS functions to return which setting index the problem happened on. fprintf(f_type_error, "%c", f_string_eol); @@ -687,7 +687,7 @@ extern "C" { } } else if (!error_printed) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), function, f_true); + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), function, F_true); } } else { @@ -785,14 +785,14 @@ extern "C" { } if (settings_single_type[i] == 1) { - if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_settings_bool_yes, settings_single_source[i]->array[0].used, fake_build_settings_bool_yes_length) == f_equal_to) { - *settings_single_bool[i] = f_true; + if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_settings_bool_yes, settings_single_source[i]->array[0].used, fake_build_settings_bool_yes_length) == F_equal_to) { + *settings_single_bool[i] = F_true; } - else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_settings_bool_no, settings_single_source[i]->array[0].used, fake_build_settings_bool_no_length) == f_equal_to) { - *settings_single_bool[i] = f_false; + else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_settings_bool_no, settings_single_source[i]->array[0].used, fake_build_settings_bool_no_length) == F_equal_to) { + *settings_single_bool[i] = F_false; } else { - *settings_single_bool[i] = f_true; + *settings_single_bool[i] = F_true; if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_warning, "%c", f_string_eol); @@ -812,22 +812,22 @@ extern "C" { } else { status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fl_string_dynamic_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); break; } if (settings_single_type[i] == 2) { status = fl_string_append_assure(f_path_separator, f_path_separator_length, settings_single_destination[i]); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fl_string_dynamic_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); break; } } status = fl_string_dynamic_terminate(settings_single_destination[i]); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fl_string_dynamic_terminate", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true); break; } } diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index 0d36fc5..b8b4905 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -53,8 +53,8 @@ extern "C" { } fake_build_settings; #define fake_build_settings_initialize { \ - f_true, \ - f_true, \ + F_true, \ + F_true, \ f_string_dynamic_initialize, \ f_string_dynamic_initialize, \ f_string_dynamic_initialize, \ @@ -214,7 +214,7 @@ extern "C" { * This is expected to be either settings.process_pre or settings.process_post. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_execute_process_script_ @@ -228,7 +228,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_operate_ @@ -245,7 +245,7 @@ extern "C" { * These settings will have any specified mode property applied. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_settings_load_ diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index 7090943..27da46a 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fake_clean_operate_ f_return_status fake_clean_operate(const fake_data data) { - f_status status = f_none; + f_status status = F_none; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol); @@ -18,18 +18,18 @@ extern "C" { } if (data.verbosity == fake_verbosity_verbose) { - status = f_directory_remove_custom(data.path_build.string, f_directory_descriptors_max, f_true, fake_clean_remove_recursively_verbosely); + status = f_directory_remove_custom(data.path_build.string, f_directory_descriptors_max, F_true, fake_clean_remove_recursively_verbosely); } else { - status = f_directory_remove(data.path_build.string, f_directory_descriptors_max, f_true); + status = f_directory_remove(data.path_build.string, f_directory_descriptors_max, F_true); } - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "f_directory_remove", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_directory_remove", F_true); return status; } - return f_none; + return F_none; } #endif // _di_fake_clean_operate_ diff --git a/level_3/fake/c/private-clean.h b/level_3/fake/c/private-clean.h index 140c850..86863c8 100644 --- a/level_3/fake/c/private-clean.h +++ b/level_3/fake/c/private-clean.h @@ -19,7 +19,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_clean_operate_ diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 9166395..9ca204f 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_path_generate_ f_return_status fake_path_generate(fake_data *data) { - f_status status = f_none; + f_status status = F_none; uint8_t i = 0; { @@ -52,8 +52,8 @@ extern "C" { for (i = 0; i < 3; i++) { status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_length[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fake_path_generate_string_dynamic", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true); return status; } } // for @@ -111,8 +111,8 @@ extern "C" { for (i = 0; i < 13; i++) { status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); return status; } } // for @@ -165,8 +165,8 @@ extern "C" { for (i = 0; i < 4; i++) { status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_length[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fake_path_generate_string_dynamic", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true); return status; } } // for @@ -215,8 +215,8 @@ extern "C" { for (i = 0; i < 10; i++) { status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); return status; } } // for @@ -233,8 +233,8 @@ extern "C" { for (i = 0; i < 3; i++) { status = fl_string_dynamic_append_nulless(data->path_work, parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_dynamic_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_dynamic_append_nulless", F_true); return status; } } // for @@ -262,8 +262,8 @@ extern "C" { for (i = 0; i < 3; i++) { status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); return status; } } // for @@ -300,8 +300,8 @@ extern "C" { for (i = 0; i < 2; i++) { status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_length[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fake_path_generate_string_dynamic", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true); return status; } } // for @@ -338,8 +338,8 @@ extern "C" { for (i = 0; i < 6; i++) { status = fl_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_append_nulless", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true); return status; } } // for @@ -386,34 +386,34 @@ extern "C" { status = fl_string_dynamic_terminate(parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_dynamic_terminate", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true); return status; } } // for } - return f_none; + return F_none; } #endif // _di_fake_path_generate_ #ifndef _di_fake_path_generate_string_dynamic_ f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *destination[], const uint8_t length) { - f_status status = f_none; + f_status status = F_none; for (uint8_t i = 0; i < length; i++) { status = fl_string_dynamic_append_nulless(source, destination[i]); - if (f_status_is_error(status)) return status; + if (F_status_is_error(status)) return status; } // for - return f_none; + return F_none; } #endif // _di_fake_path_generate_string_dynamic_ #ifndef _di_fake_print_error_ f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function "); @@ -421,10 +421,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "()."); } - return f_none; + return F_none; } - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function "); @@ -432,7 +432,7 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "()."); } - return f_none; + return F_none; } if (fallback && verbosity != fake_verbosity_quiet) { @@ -444,7 +444,7 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "()."); } - return f_unknown; + return F_unknown; } #endif // _di_fake_print_error_ @@ -455,7 +455,7 @@ extern "C" { if (is_file) file_or_directory = "file"; else file_or_directory = "directory"; - if (status == f_file_not_found) { + if (status == F_file_found_not) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find %s '", file_or_directory); @@ -463,10 +463,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_invalid_parameter) { + if (status == F_parameter) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); @@ -476,10 +476,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_invalid_name) { + if (status == F_name) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory); @@ -487,10 +487,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_out_of_memory) { + if (status == F_memory_out) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory); @@ -498,10 +498,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_number_overflow) { + if (status == F_number_overflow) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory); @@ -509,10 +509,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_invalid_directory) { + if (status == F_directory) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory); @@ -520,10 +520,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_access_denied) { + if (status == F_access_denied) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory); @@ -531,10 +531,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } - if (status == f_loop) { + if (status == F_loop) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory); @@ -542,11 +542,11 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } if (is_file) { - if (status == f_directory_not_found) { + if (status == F_directory_not_found) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory); @@ -554,11 +554,11 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); } - return f_none; + return F_none; } } else { - if (status == f_directory_not_found) { + if (status == F_directory_not_found) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory); @@ -566,10 +566,10 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); } - return f_none; + return F_none; } - if (status == f_failure) { + if (status == F_failure) { if (verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory); @@ -577,11 +577,11 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_none; + return F_none; } } - if (fake_print_error(context, verbosity, status, function, f_false) == f_unknown && fallback && verbosity != fake_verbosity_quiet) { + if (fake_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); fl_color_print(f_type_error, context.notable, context.reset, "%d", status); @@ -590,7 +590,7 @@ extern "C" { fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - return f_unknown; + return F_unknown; } #endif // _di_fake_print_error_file_ @@ -618,7 +618,7 @@ extern "C" { #ifndef _di_fake_process_console_parameters_ f_return_status fake_process_console_parameters(const f_console_arguments arguments, fake_data *data) { - f_status status = f_none; + f_status status = F_none; // @todo move as many of the inline error printing code into more general functions where possible to provide more accurate error reporting. @@ -646,7 +646,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' specified too many times."); } - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } @@ -680,12 +680,12 @@ extern "C" { for (uint8_t i = 0; i < 2; i++) { if (data->parameters[parameters_id[i]].result == f_console_result_found) { fake_print_error_parameter_missing_value(data->context, data->verbosity, parameters_name[i]); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (data->parameters[parameters_id[i]].result == f_console_result_additional) { if (data->parameters[parameters_id[i]].total > 1) { fake_print_error_parameter_too_many(data->context, data->verbosity, parameters_name[i]); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } f_string_length location = data->parameters[parameters_id[i]].additional.array[0]; @@ -694,8 +694,8 @@ extern "C" { if (length > 0) { status = fl_string_append(arguments.argv[location], length, parameters_value[i]); - if (f_status_is_error(status)) { - if (status == f_status_set_error(f_string_too_large)) { + if (F_status_is_error(status)) { + if (status == F_status_set_error(F_string_too_large)) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the parameter '"); @@ -704,17 +704,17 @@ extern "C" { } } else { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_string_append", f_true); + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append", F_true); } return status; } else { - status = f_none; + status = F_none; } } - if (length == 0 || status == f_no_data) { + if (length == 0 || status == F_data_not) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the parameter '"); @@ -726,8 +726,8 @@ extern "C" { else if (parameter_default_lengths[i] > 0) { f_macro_string_dynamic_resize(status, (*parameters_value[i]), parameter_default_lengths[i]); - if (f_status_is_error(status)) { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_macro_string_dynamic_resize", f_true); + if (F_status_is_error(status)) { + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "f_macro_string_dynamic_resize", F_true); return status; } @@ -739,7 +739,7 @@ extern "C" { if (data->parameters[fake_parameter_defines].result == f_console_result_found) { fake_print_error_parameter_missing_value(data->context, data->verbosity, fake_long_defines); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } { @@ -781,18 +781,18 @@ extern "C" { for (uint8_t i = 0; i < 4; i++) { if (data->parameters[parameters_id[i]].result == f_console_result_found) { fake_print_error_parameter_missing_value(data->context, data->verbosity, parameters_name[i]); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (data->parameters[parameters_id[i]].result == f_console_result_additional) { if (data->parameters[parameters_id[i]].additional.used > 1) { fake_print_error_parameter_too_many(data->context, data->verbosity, parameters_name[i]); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } status = fl_console_parameter_to_string_dynamic_directory(arguments.argv[data->parameters[parameters_id[i]].additional.array[0]], parameters_value[i]); - if (f_status_is_error(status)) { - if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) { + if (F_status_is_error(status)) { + if (fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); @@ -805,8 +805,8 @@ extern "C" { else if (parameter_default_lengths[i] > 0) { f_macro_string_dynamic_new(status, (*parameters_value[i]), parameter_default_lengths[i]); - if (f_status_is_error(status)) { - if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_macro_string_dynamic_new", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) { + if (F_status_is_error(status)) { + if (fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "f_macro_string_dynamic_new", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to load default for the parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); @@ -825,8 +825,8 @@ extern "C" { if (data->parameters[fake_parameter_defines].result == f_console_result_additional) { status = fll_program_parameter_additional_rip_mash(" ", 1, arguments.argv, data->parameters[fake_parameter_defines].additional, &data->defines); - if (f_status_is_error(status)) { - if (status == f_status_set_error(f_string_too_large)) { + if (F_status_is_error(status)) { + if (status == F_status_set_error(F_string_too_large)) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the (combined) parameter '"); @@ -835,7 +835,7 @@ extern "C" { } } else { - fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fll_program_parameter_additional_rip_mash", f_true); + fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fll_program_parameter_additional_rip_mash", F_true); } return status; @@ -844,13 +844,13 @@ extern "C" { if (data->parameters[fake_parameter_mode].result == f_console_result_found) { fake_print_error_parameter_missing_value(data->context, data->verbosity, fake_long_mode); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (data->parameters[fake_parameter_mode].result == f_console_result_additional) { status = fll_program_parameter_additional_rip(arguments.argv, data->parameters[fake_parameter_mode].additional, &data->mode); - if (f_status_is_error(status)) { - if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fll_program_parameter_additional_rip", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) { + if (F_status_is_error(status)) { + if (fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); @@ -870,8 +870,8 @@ extern "C" { status = f_utf_is_word_dash_plus(data->mode.array[i].string + j, width_max); - if (f_status_is_error(status)) { - if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_utf_is_word_dash_plus", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) { + if (F_status_is_error(status)) { + if (fake_print_error(data->context, data->verbosity, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); @@ -881,7 +881,7 @@ extern "C" { return status; } - if (status == f_false) { + if (status == F_false) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '"); @@ -891,13 +891,13 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' contains non-word, non-dash, and non-plus characters."); } - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } // for } - return f_none; + return F_none; } #endif // _di_fake_process_console_parameters_ @@ -932,26 +932,26 @@ extern "C" { }; const bool parameters_required[] = { - f_true, - f_true, - f_true, - f_false, + F_true, + F_true, + F_true, + F_false, }; struct stat directory_stat; - f_status status = f_none; + f_status status = F_none; for (uint8_t i = 0; i < 4; i++) { if (parameters_value[i]->used > 0) { memset(&directory_stat, 0, sizeof(struct stat)); - status = f_file_stat(parameters_value[i]->string, f_true, &directory_stat); + status = f_file_stat(parameters_value[i]->string, F_true, &directory_stat); - if (status == f_status_set_error(f_file_not_found)) status = f_status_set_error(f_directory_not_found); + if (status == F_status_set_error(F_file_found_not)) status = F_status_set_error(F_directory_not_found); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) != f_directory_not_found || parameters_required[i]) { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_file_stat", parameters_value[i]->string, "access", f_false, f_true); + if (F_status_is_error(status)) { + if (F_status_set_fine(status) != F_directory_not_found || parameters_required[i]) { + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_file_stat", parameters_value[i]->string, "access", F_false, F_true); return status; } } @@ -962,11 +962,11 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' was found."); - return f_status_set_error(f_directory_not_found); + return F_status_set_error(F_directory_not_found); } } // for - return f_none; + return F_none; } #endif // _di_fake_validate_parameter_directories_ diff --git a/level_3/fake/c/private-fake.h b/level_3/fake/c/private-fake.h index f22f5b9..f325be9 100644 --- a/level_3/fake/c/private-fake.h +++ b/level_3/fake/c/private-fake.h @@ -19,7 +19,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_path_generate_ @@ -39,7 +39,7 @@ extern "C" { * The size of the values. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_path_generate_string_dynamic_ @@ -58,11 +58,11 @@ extern "C" { * @param function * The name of the function where the error happened. * @param fallback - * Set to f_true to print the fallback error message for unknown errors. + * Set to F_true to print the fallback error message for unknown errors. * * @return - * f_none is returned on successful print of known errors. - * f_unknown is returned if the status code has no print message. + * F_none is returned on successful print of known errors. + * F_unknown is returned if the status code has no print message. */ #ifndef _di_fake_print_error_ extern f_return_status fake_print_error(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const bool fallback) f_gcc_attribute_visibility_internal; @@ -86,11 +86,11 @@ extern "C" { * @param is_file * Set to TRUE if this is a file and FALSE if this is a directory. * @param fallback - * Set to f_true to print the fallback error message for unknown errors. + * Set to F_true to print the fallback error message for unknown errors. * * @return - * f_none is returned on successful print of known errors. - * f_unknown is returned if the status code has no print message. + * F_none is returned on successful print of known errors. + * F_unknown is returned if the status code has no print message. */ #ifndef _di_fake_print_error_file_ extern f_return_status fake_print_error_file(const fl_color_context context, const uint8_t verbosity, const f_status status, const f_string function, const f_string name, const f_string operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; @@ -133,7 +133,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_process_console_parameters_ @@ -151,7 +151,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_validate_parameter_directories_ diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index 9bc8b40..63e8744 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fake_skeleton_operate_ f_return_status fake_skeleton_operate(const fake_data data) { - f_status status = f_none; + f_status status = F_none; if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol); @@ -41,8 +41,8 @@ extern "C" { for (uint8_t i = 0; i < 19; i++) { status = fake_skeleton_operate_directory_create(data, *parameters_value[i]); - if (f_status_is_error(status)) { - fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fake_skeleton_operate_directory_create", f_true); + if (F_status_is_error(status)) { + fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "fake_skeleton_operate_directory_create", F_true); return status; } } // for @@ -51,56 +51,56 @@ extern "C" { f_string_dynamic file_data_build_process_post = f_string_dynamic_initialize; f_string_dynamic file_data_build_process_pre = f_string_dynamic_initialize; - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, data.file_data_build_defines, f_false); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, data.file_data_build_defines, F_false); } - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, data.file_data_build_dependencies, f_false); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, data.file_data_build_dependencies, F_false); } - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, file_data_build_process_post, f_true); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, file_data_build_process_post, F_true); } - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, file_data_build_process_pre, f_true); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, file_data_build_process_pre, F_true); } - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, data.file_data_build_settings, f_false); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, data.file_data_build_settings, F_false); } - if (!f_status_is_error(status)) { - status = fake_skeleton_operate_file_create(data, data.file_documents_readme, f_false); + if (!F_status_is_error(status)) { + status = fake_skeleton_operate_file_create(data, data.file_documents_readme, F_false); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(file_data_build_process_post); f_macro_string_dynamic_delete_simple(file_data_build_process_pre); return status; } - return f_none; + return F_none; } #endif // _di_fake_skeleton_operate_ #ifndef _di_fake_skeleton_operate_directory_create_ f_return_status fake_skeleton_operate_directory_create(const fake_data data, const f_string_dynamic path) { - f_status status = f_none; + f_status status = F_none; - if (path.used == 0) return f_none; + if (path.used == 0) return F_none; status = f_directory_exists(path.string); - if (status == f_true) { + if (status == F_true) { if (data.verbosity == fake_verbosity_verbose) { printf("Directory '%s' already exists.%c", path.string, f_string_eol); } - return f_none; + return F_none; } - if (status == f_false) { + if (status == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); @@ -108,20 +108,20 @@ extern "C" { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' exists but is not a directory."); } - return f_status_set_warning(f_failure); + return F_status_set_warning(F_failure); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { status = f_directory_create(path.string, f_file_mode_all_rwx); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_file_not_found) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_file_found_not) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist."); } else { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_directory_create", path.string, "create", f_false, f_true); + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_create", path.string, "create", F_false, F_true); } return status; @@ -131,68 +131,68 @@ extern "C" { printf("Directory '%s' created.%c", path.string, f_string_eol); } } - else if (f_status_is_error(status)) { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_directory_exists", path.string, "create", f_false, f_true); + else if (F_status_is_error(status)) { + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_directory_exists", path.string, "create", F_false, F_true); return status; } - return f_none; + return F_none; } #endif // _di_fake_skeleton_operate_directory_create_ #ifndef _di_fake_skeleton_operate_file_create_ f_return_status fake_skeleton_operate_file_create(const fake_data data, const f_string_dynamic path, const bool executable) { - f_status status = f_none; + f_status status = F_none; - if (path.used == 0) return f_none; + if (path.used == 0) return F_none; status = f_file_is(path.string, f_file_type_file); - if (status == f_true) { + if (status == F_true) { if (data.verbosity == fake_verbosity_verbose) { printf("File '%s' already exists.%c", path.string, f_string_eol); } - return f_none; + return F_none; } // symbolic links might also be fine. - if (status == f_false) { + if (status == F_false) { status = f_file_is(path.string, f_file_type_link); - if (status == f_true) { + if (status == F_true) { if (data.verbosity == fake_verbosity_verbose) { printf("File '%s' already exists (as a symbolic link).%c", path.string, f_string_eol); } - return f_none; + return F_none; } } - if (status == f_false) { + if (status == F_false) { if (data.verbosity == fake_verbosity_verbose) { printf("File '%s' already exists but is not a regular file (or symbolic link).%c", path.string, f_string_eol); } - return f_status_set_warning(f_none); + return F_status_set_warning(F_none); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { mode_t mode = f_file_mode_all_rw; if (executable) { mode = f_file_mode_all_rwx; } - status = f_file_create(path.string, mode, f_true, f_true); + status = f_file_create(path.string, mode, F_true, F_true); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_file_not_found) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_file_found_not) { fprintf(f_type_error, "%c", f_string_eol); fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The file '"); fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist."); } else { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_file_create", path.string, "create", f_true, f_true); + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_file_create", path.string, "create", F_true, F_true); } return status; @@ -202,12 +202,12 @@ extern "C" { printf("File '%s' created.%c", path.string, f_string_eol); } } - else if (f_status_is_error(status)) { - fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_file_is", path.string, "create", f_true, f_true); + else if (F_status_is_error(status)) { + fake_print_error_file(data.context, data.verbosity, F_status_set_fine(status), "f_file_is", path.string, "create", F_true, F_true); return status; } - return f_none; + return F_none; } #endif // _di_fake_skeleton_operate_file_create_ diff --git a/level_3/fake/c/private-skeleton.h b/level_3/fake/c/private-skeleton.h index 4ddeef7..6fe0089 100644 --- a/level_3/fake/c/private-skeleton.h +++ b/level_3/fake/c/private-skeleton.h @@ -19,7 +19,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_ @@ -35,7 +35,7 @@ extern "C" { * The file path for the directory to create. * * @return - * f_none on success. + * F_none on success. * Status codes (with warning bit) are returned on certain problems that can be ignored. * Status codes (with error bit) are returned on any problem. */ @@ -55,7 +55,7 @@ extern "C" { * Set to FALSE to not make the file executable. * * @return - * f_none on success. + * F_none on success. * Status codes (with warning bit) are returned on certain problems that can be ignored. * Status codes (with error bit) are returned on any problem. */ diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 0fed579..a30647a 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -50,27 +50,27 @@ extern "C" { fll_program_print_help_usage(context, firewall_name, "command"); - return f_none; + return F_none; } #endif // _di_firewall_print_help_ #ifndef _di_firewall_main_ f_return_status firewall_main(const f_console_arguments arguments, firewall_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, firewall_total_parameters }; f_console_parameter_id ids[3] = { firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[firewall_parameter_help].result == f_console_result_found) { @@ -81,12 +81,12 @@ extern "C" { } else { // now determine which command was placed first - bool found_command = f_false; + bool found_command = F_false; unsigned int command = 0; if (data->parameters[firewall_parameter_command_start].result == f_console_result_found) { command = firewall_parameter_command_start; - found_command = f_true; + found_command = F_true; } if (data->parameters[firewall_parameter_command_stop].result == f_console_result_found) { @@ -97,7 +97,7 @@ extern "C" { } else { command = firewall_parameter_command_stop; - found_command = f_true; + found_command = F_true; } } @@ -109,7 +109,7 @@ extern "C" { } else { command = firewall_parameter_command_restart; - found_command = f_true; + found_command = F_true; } } @@ -121,7 +121,7 @@ extern "C" { } else { command = firewall_parameter_command_lock; - found_command = f_true; + found_command = F_true; } } @@ -133,7 +133,7 @@ extern "C" { } else { command = firewall_parameter_command_show; - found_command = f_true; + found_command = F_true; } } @@ -144,17 +144,17 @@ extern "C" { if (command == firewall_parameter_command_show) { // Warning: these are hardcoded print commands (I am not certain how I am going to implement external 'show' rules as the default-firewall setting file is the wrong place to put this) - bool show_nat = f_true; - bool show_mangle = f_true; - bool show_ports = f_true; + bool show_nat = F_true; + bool show_mangle = F_true; + bool show_ports = F_true; f_string_dynamics parameters = f_string_dynamics_initialize; int results = 0; if (data->remaining.used > 0) { - show_nat = f_false; - show_mangle = f_false; - show_ports = f_false; + show_nat = F_false; + show_mangle = F_false; + show_ports = F_false; f_string_length counter = 0; @@ -165,22 +165,22 @@ extern "C" { fl_color_print_line(f_type_warning, data->context.warning, data->context.reset, "WARNING: '%s' is not a valid show option", arguments.argv[data->remaining.array[counter]]); } else { - show_ports = f_true; + show_ports = F_true; } } else { - show_mangle = f_true; + show_mangle = F_true; } } else { - show_nat = f_true; + show_nat = F_true; } } // for } f_macro_string_dynamics_resize(status, parameters, 7); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -215,7 +215,7 @@ extern "C" { fflush(f_type_output); } - if (f_status_is_not_error(status) && show_mangle) { + if (F_status_is_not_error(status) && show_mangle) { fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== "); fl_color_print(f_type_output, data->context.title, data->context.reset, "MANGLE"); fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " =========================="); @@ -243,7 +243,7 @@ extern "C" { fflush(f_type_output); } - if (f_status_is_not_error(status) && show_ports) { + if (F_status_is_not_error(status) && show_ports) { fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== "); fl_color_print(f_type_output, data->context.title, data->context.reset, "FILTER"); fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " =========================="); @@ -267,10 +267,10 @@ extern "C" { fflush(f_type_output); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -290,7 +290,7 @@ extern "C" { fprintf(f_type_error, "\n"); } - status = f_status_set_error(status); + status = F_status_set_error(status); } parameters.array[0].string = 0; @@ -317,22 +317,22 @@ extern "C" { // load all network devices status = f_directory_list((f_string) network_devices, 0, alphasort, &data->devices); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_no_data) { + else if (status == F_data_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: could not find any network devices"); } - else if (status == f_failure) { + else if (status == F_failure) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: failed to read the device directory '%s'", network_devices); } firewall_delete_local_data(&local); firewall_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } // remove "lo" (loopback) from the device listing @@ -340,7 +340,7 @@ extern "C" { f_string_length i = 0; for (; i < data->devices.used; i++) { - if (fl_string_compare((f_string) firewall_device_loop, data->devices.array[i].string, firewall_device_loop_length + 1, data->devices.array[i].used) == f_equal_to) { + if (fl_string_compare((f_string) firewall_device_loop, data->devices.array[i].string, firewall_device_loop_length + 1, data->devices.array[i].used) == F_equal_to) { f_string_dynamic swap_string = data->devices.array[i]; data->devices.used--; @@ -355,9 +355,9 @@ extern "C" { } if (command == firewall_parameter_command_stop || command == firewall_parameter_command_restart || command == firewall_parameter_command_lock) { - status = firewall_buffer_rules(network_path firewall_file_other, f_false, &local, data); + status = firewall_buffer_rules(network_path firewall_file_other, F_false, &local, data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -370,13 +370,13 @@ extern "C" { for (; i < local.chain_objects.used; i++) { length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1; - if (!reserved.has_stop && fl_string_compare((f_string) firewall_group_stop, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_length, length) == f_equal_to) { + if (!reserved.has_stop && fl_string_compare((f_string) firewall_group_stop, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_length, length) == F_equal_to) { reserved.stop_at = i; - reserved.has_stop = f_true; + reserved.has_stop = F_true; } - else if (!reserved.has_lock && fl_string_compare((f_string) firewall_group_lock, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_length, length) == f_equal_to) { + else if (!reserved.has_lock && fl_string_compare((f_string) firewall_group_lock, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_length, length) == F_equal_to) { reserved.lock_at = i; - reserved.has_lock = f_true; + reserved.has_lock = F_true; } } // for } @@ -385,19 +385,19 @@ extern "C" { if (reserved.has_lock) { status = firewall_delete_chains(*data); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { status = firewall_default_lock(*data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; } - local.is_main = f_false; - local.is_stop = f_false; - local.is_lock = f_true; + local.is_main = F_false; + local.is_stop = F_false; + local.is_lock = F_true; local.chain = reserved.lock_at; input.start = local.chain_contents.array[reserved.lock_at].array[0].start; @@ -414,7 +414,7 @@ extern "C" { firewall_delete_local_data(&local); firewall_delete_data(data); - return f_status_set_error(f_invalid_data); + return F_status_set_error(F_data); } } @@ -422,20 +422,20 @@ extern "C" { if (reserved.has_stop) { status = firewall_delete_chains(*data); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { status = firewall_default_lock(*data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; } - local.is_global = f_true; - local.is_main = f_false; - local.is_stop = f_true; - local.is_lock = f_false; + local.is_global = F_true; + local.is_main = F_false; + local.is_stop = F_true; + local.is_lock = F_false; local.chain = reserved.stop_at; input.start = local.chain_contents.array[reserved.stop_at].array[0].start; @@ -443,7 +443,7 @@ extern "C" { status = firewall_process_rules(&input, &local, data); - if (f_status_is_error(status) || command == firewall_parameter_command_stop) { + if (F_status_is_error(status) || command == firewall_parameter_command_stop) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -454,7 +454,7 @@ extern "C" { firewall_delete_local_data(&local); firewall_delete_data(data); - return f_status_set_error(f_invalid_data); + return F_status_set_error(F_data); } } @@ -462,9 +462,9 @@ extern "C" { } if (command == firewall_parameter_command_start || command == firewall_parameter_command_restart) { - status = firewall_buffer_rules(network_path firewall_file_first, f_false, &local, data); + status = firewall_buffer_rules(network_path firewall_file_first, F_false, &local, data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -473,11 +473,11 @@ extern "C" { if (command == firewall_parameter_command_start) { status = firewall_delete_chains(*data); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { status = firewall_default_lock(*data); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -486,7 +486,7 @@ extern "C" { status = firewall_create_custom_chains(&reserved, &local, data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -494,20 +494,20 @@ extern "C" { f_array_length i = 0; - local.is_global = f_true; - local.is_stop = f_false; - local.is_lock = f_false; + local.is_global = F_true; + local.is_stop = F_false; + local.is_lock = F_false; while (i < local.chain_contents.used) { input.start = local.chain_contents.array[i].array[0].start; input.stop = local.chain_contents.array[i].array[0].stop; - local.is_main = reserved.has_main && i == reserved.main_at ? f_true : f_false; + local.is_main = reserved.has_main && i == reserved.main_at ? F_true : F_false; local.chain = i; status = firewall_process_rules(&input, &local, data); - if (f_status_is_error(status) || command == firewall_parameter_command_stop) { + if (F_status_is_error(status) || command == firewall_parameter_command_stop) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -526,7 +526,7 @@ extern "C" { f_macro_string_dynamic_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -540,28 +540,28 @@ extern "C" { file_path.used = network_path_length + data->devices.array[i].used + firewall_file_suffix_length; file_path.string[file_path.used] = 0; - status = firewall_buffer_rules(file_path.string, f_true, &local, data); + status = firewall_buffer_rules(file_path.string, F_true, &local, data); f_macro_string_dynamic_delete_simple(file_path); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); firewall_delete_local_data(&local); - 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); + if (status == F_file_found_not || status == F_file_open || status == F_file_descriptor || status == FL_fss_found_object_content_not) { + status = F_status_set_error(status); continue; } firewall_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } status = firewall_create_custom_chains(&reserved, &local, data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -569,20 +569,20 @@ extern "C" { f_array_length j = 0; - local.is_global = f_false; - local.is_stop = f_false; - local.is_lock = f_false; + local.is_global = F_false; + local.is_stop = F_false; + local.is_lock = F_false; for (; j < local.chain_contents.used; j++) { input.start = local.chain_contents.array[j].array[0].start; input.stop = local.chain_contents.array[j].array[0].stop; - local.is_main = reserved.has_main && j == reserved.main_at ? f_true : f_false; + local.is_main = reserved.has_main && j == reserved.main_at ? F_true : F_false; local.chain = j; status = firewall_process_rules(&input, &local, data); - if (f_status_is_error(status) || command == firewall_parameter_command_stop) { + if (F_status_is_error(status) || command == firewall_parameter_command_stop) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -592,9 +592,9 @@ extern "C" { firewall_delete_local_data(&local); } // for - status = firewall_buffer_rules(network_path firewall_file_last, f_false, &local, data); + status = firewall_buffer_rules(network_path firewall_file_last, F_false, &local, data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -602,8 +602,8 @@ extern "C" { status = firewall_create_custom_chains(&reserved, &local, data); - if (f_status_is_error(status)) { - f_status status2 = f_none; + if (F_status_is_error(status)) { + f_status status2 = F_none; firewall_macro_delete_fss_buffers(status2, local.buffer, local.chain_objects, local.chain_contents) firewall_delete_data(data); @@ -612,20 +612,20 @@ extern "C" { i = 0; - local.is_global = f_true; - local.is_stop = f_false; - local.is_lock = f_false; + local.is_global = F_true; + local.is_stop = F_false; + local.is_lock = F_false; while (i < local.chain_contents.used) { input.start = local.chain_contents.array[i].array[0].start; input.stop = local.chain_contents.array[i].array[0].stop; - local.is_main = reserved.has_main && i == reserved.main_at ? f_true : f_false; + local.is_main = reserved.has_main && i == reserved.main_at ? F_true : F_false; local.chain = i; status = firewall_process_rules(&input, &local, data); - if (f_status_is_error(status) || command == firewall_parameter_command_stop) { + if (F_status_is_error(status) || command == firewall_parameter_command_stop) { firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -640,7 +640,7 @@ extern "C" { } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You did not pass a command"); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } } @@ -665,7 +665,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_firewall_delete_data_ diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index bafde6a..53aa32e 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -240,33 +240,33 @@ extern "C" { #ifdef _en_firewall_debug_ #define f_console_parameter_initialize_firewall \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(0, 0, firewall_command_start, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_stop, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_restart, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_lock, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_show, f_false, f_console_type_other), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ } #define firewall_total_parameters 11 #else #define f_console_parameter_initialize_firewall \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(0, 0, firewall_command_start, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_stop, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_restart, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_lock, f_false, f_console_type_other), \ - f_console_parameter_initialize(0, 0, firewall_command_show, f_false, f_console_type_other), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(0, 0, firewall_command_start, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_stop, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_restart, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_lock, F_false, f_console_type_other), \ + f_console_parameter_initialize(0, 0, firewall_command_show, F_false, f_console_type_other), \ } #define firewall_total_parameters 10 @@ -290,7 +290,7 @@ extern "C" { f_console_parameter_initialize_firewall, \ f_string_dynamics_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ f_string_dynamics_initialize, \ fl_color_context_initialize, \ } @@ -303,7 +303,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_firewall_print_help_ extern f_return_status firewall_print_help(const fl_color_context context); @@ -320,7 +320,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see firewall_delete_data() @@ -338,7 +338,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see firewall_main() diff --git a/level_3/firewall/c/main.c b/level_3/firewall/c/main.c index 9b0f4c9..1627049 100644 --- a/level_3/firewall/c/main.c +++ b/level_3/firewall/c/main.c @@ -6,12 +6,12 @@ int main(const int argc, const f_string *argv) { firewall_data data = firewall_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = firewall_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 06d5c24..e4526b3 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -6,7 +6,7 @@ extern "C" { #endif f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; f_string_dynamics arguments = f_string_dynamics_initialize; @@ -14,14 +14,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const int results = 0; f_string_length length = 0; - bool invalid = f_false; - bool is_ip_list = f_false; + bool invalid = F_false; + bool is_ip_list = F_false; f_string_dynamic ip_list = f_string_dynamic_initialize; // iptables command arguments - bool device_all = f_false; - bool ip_list_direction = f_false; // false = source, true = destination - bool use_protocol = f_false; + bool device_all = F_false; + bool ip_list_direction = F_false; // false = source, true = destination + bool use_protocol = F_false; uint8_t tool = firewall_program_ip46tables; uint8_t chain = firewall_chain_none_id; @@ -37,13 +37,13 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_string_dynamic protocol = f_string_dynamic_initialize; if (local.is_global) { - device_all = f_true; + device_all = F_true; } else { if (data.devices.array[local.device].used > 0) { f_macro_string_dynamic_new(status, device, data.devices.array[local.device].used); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(device); return status; @@ -61,15 +61,15 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const for (; i < local.rule_objects.used; i++) { length = firewall_macro_structure_size(local.rule_objects, i); - invalid = f_false; + invalid = F_false; - is_ip_list = f_false; - ip_list_direction = f_false; + is_ip_list = F_false; + ip_list_direction = F_false; f_macro_string_dynamic_delete_simple(ip_list); // process chain rule - if (length >= firewall_chain_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_chain, length, firewall_chain_length) == f_equal_to) { + if (length >= firewall_chain_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_chain, length, firewall_chain_length) == F_equal_to) { if (chain == firewall_chain_custom_id) { // custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain. fprintf(f_type_warning, "WARNING: At line %i, the chain option is meaningle ss inside of a custom chain.", i); @@ -79,73 +79,73 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } - else if (length >= firewall_chain_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_input, length, firewall_chain_input_length) == f_equal_to) { + else if (length >= firewall_chain_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_input, length, firewall_chain_input_length) == F_equal_to) { chain = firewall_chain_input_id; } - else if (length >= firewall_chain_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_output, length, firewall_chain_output_length) == f_equal_to) { + else if (length >= firewall_chain_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_output, length, firewall_chain_output_length) == F_equal_to) { chain = firewall_chain_output_id; } - else if (length >= firewall_chain_forward_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_forward, length, firewall_chain_forward_length) == f_equal_to) { + else if (length >= firewall_chain_forward_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_forward, length, firewall_chain_forward_length) == F_equal_to) { chain = firewall_chain_forward_id; } - else if (length >= firewall_chain_postrouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_postrouting, length, firewall_chain_postrouting_length) == f_equal_to) { + else if (length >= firewall_chain_postrouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_postrouting, length, firewall_chain_postrouting_length) == F_equal_to) { chain = firewall_chain_postrouting_id; } - else if (length >= firewall_chain_prerouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_prerouting, length, firewall_chain_prerouting_length) == f_equal_to) { + else if (length >= firewall_chain_prerouting_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_prerouting, length, firewall_chain_prerouting_length) == F_equal_to) { chain = firewall_chain_prerouting_id; } - else if (length >= firewall_chain_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_none, length, firewall_chain_none_length) == f_equal_to) { + else if (length >= firewall_chain_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_chain_none, length, firewall_chain_none_length) == F_equal_to) { chain = firewall_chain_none_id; } else { - invalid = f_true; + invalid = F_true; } if (!invalid) continue; } // process direction rule - else if (length >= firewall_direction_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_direction, length, firewall_direction_length) == f_equal_to) { + else if (length >= firewall_direction_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_direction, length, firewall_direction_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } - else if (length >= firewall_direction_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_input, length, firewall_direction_input_length) == f_equal_to) { + else if (length >= firewall_direction_input_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_input, length, firewall_direction_input_length) == F_equal_to) { direction = firewall_direction_input_id; } - else if (length >= firewall_direction_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_output, length, firewall_direction_output_length) == f_equal_to) { + else if (length >= firewall_direction_output_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_output, length, firewall_direction_output_length) == F_equal_to) { direction = firewall_direction_output_id; } - else if (length >= firewall_direction_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_none, length, firewall_direction_none_length) == f_equal_to) { + else if (length >= firewall_direction_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_direction_none, length, firewall_direction_none_length) == F_equal_to) { direction = firewall_direction_none_id; } else { // direction must be specified, and no custom directions are allowed. - invalid = f_true; + invalid = F_true; } if (!invalid) continue; } // process device rule. - else if (length >= firewall_device_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_device, length, firewall_device_length) == f_equal_to) { + else if (length >= firewall_device_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_device, length, firewall_device_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } - else if (length >= firewall_device_all_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == f_equal_to) { + else if (length >= firewall_device_all_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == F_equal_to) { f_macro_string_dynamic_delete_simple(device); - device_all = f_true; + device_all = F_true; continue; } - else if (length >= firewall_device_this_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_this, length, firewall_device_this_length) == f_equal_to) { + else if (length >= firewall_device_this_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_this, length, firewall_device_this_length) == F_equal_to) { if (data.devices.array[local.device].used > 0) { if (data.devices.array[local.device].used > device.size) { f_macro_string_dynamic_resize(status, device, data.devices.array[local.device].used); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } firewall_macro_concat_string(device.string, data.devices.array[local.device].string, data.devices.array[local.device].used); @@ -156,7 +156,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamic_delete_simple(device); } - device_all = f_false; + device_all = F_false; continue; } @@ -165,7 +165,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (length > device.size) { f_macro_string_dynamic_resize(status, device, length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; } firewall_macro_concat_string(device.string, local.buffer.string + local.rule_contents.array[i].array[0].start, length); @@ -175,112 +175,112 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamic_delete_simple(device); } - device_all = f_false; + device_all = F_false; continue; } } // process action rule. - else if (length >= firewall_action_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_action, length, firewall_action_length) == f_equal_to) { + else if (length >= firewall_action_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_action, length, firewall_action_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } - else if (length >= firewall_action_append_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_append, length, firewall_action_append_length) == f_equal_to) { + else if (length >= firewall_action_append_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_append, length, firewall_action_append_length) == F_equal_to) { action = firewall_action_append_id; } - else if (length >= firewall_action_insert_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_insert, length, firewall_action_insert_length) == f_equal_to) { + else if (length >= firewall_action_insert_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_insert, length, firewall_action_insert_length) == F_equal_to) { action = firewall_action_insert_id; } - else if (length >= firewall_action_policy_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_policy, length, firewall_action_policy_length) == f_equal_to) { + else if (length >= firewall_action_policy_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_policy, length, firewall_action_policy_length) == F_equal_to) { action = firewall_action_policy_id; } - else if (length >= firewall_action_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_none, length, firewall_action_none_length) == f_equal_to) { + else if (length >= firewall_action_none_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_action_none, length, firewall_action_none_length) == F_equal_to) { action = firewall_action_none_id; } else { - invalid = f_true; + invalid = F_true; } if (!invalid) continue; } // process ip_list rule. - else if (length >= firewall_ip_list_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_ip_list, length, firewall_ip_list_length) == f_equal_to) { + else if (length >= firewall_ip_list_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_ip_list, length, firewall_ip_list_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); - is_ip_list = f_true; + is_ip_list = F_true; - if (length >= firewall_ip_list_source_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_source, length, firewall_ip_list_source_length) == f_equal_to) { - ip_list_direction = f_false; + if (length >= firewall_ip_list_source_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_source, length, firewall_ip_list_source_length) == F_equal_to) { + ip_list_direction = F_false; } - else if (length >= firewall_ip_list_destination_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_destination, length, firewall_ip_list_destination_length) == f_equal_to) { - ip_list_direction = f_true; + else if (length >= firewall_ip_list_destination_length && fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_ip_list_destination, length, firewall_ip_list_destination_length) == F_equal_to) { + ip_list_direction = F_true; } else { - invalid = f_true; + invalid = F_true; } } - else if (length >= firewall_protocol_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_protocol, length, firewall_protocol_length) == f_equal_to) { + else if (length >= firewall_protocol_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_protocol, length, firewall_protocol_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } else { - if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_protocol_none, length, firewall_protocol_none_length) == f_equal_to) { - use_protocol = f_false; + if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_protocol_none, length, firewall_protocol_none_length) == F_equal_to) { + use_protocol = F_false; } else if (length > 0) { f_macro_string_dynamic_delete_simple(protocol); f_macro_string_dynamic_new(status, protocol, length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(protocol.string, local.buffer.string + local.rule_contents.array[i].array[0].start, length); protocol.used = length; - use_protocol = f_true; + use_protocol = F_true; } else { - use_protocol = f_false; + use_protocol = F_false; } continue; } } // process tool rule. - else if (length >= firewall_tool_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_tool, length, firewall_tool_length) == f_equal_to) { + else if (length >= firewall_tool_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_tool, length, firewall_tool_length) == F_equal_to) { length = firewall_macro_structure_size(local.rule_contents.array[i], 0); if (firewall_macro_rule_contents_has_incorrect_items(i, 1)) { - invalid = f_true; + invalid = F_true; } else { - if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_iptables, length, firewall_tool_iptables_length) == f_equal_to) { + if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_iptables, length, firewall_tool_iptables_length) == F_equal_to) { tool = firewall_program_iptables; current_tool = firewall_tool_iptables; current_tool_length = firewall_tool_iptables_length; repeat = 1; } - else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip6tables, length, firewall_tool_ip6tables_length) == f_equal_to) { + else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip6tables, length, firewall_tool_ip6tables_length) == F_equal_to) { tool = firewall_program_ip6tables; current_tool = firewall_tool_ip6tables; current_tool_length = firewall_tool_ip6tables_length; repeat = 1; } - else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip46tables, length, firewall_tool_ip46tables_length) == f_equal_to) { + else if (fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_tool_ip46tables, length, firewall_tool_ip46tables_length) == F_equal_to) { tool = firewall_program_ip46tables; current_tool = firewall_tool_iptables; current_tool_length = firewall_tool_iptables_length; repeat = 2; } else { - invalid = f_true; + invalid = F_true; } if (!invalid) continue; } } // process rule rule, if the remaining rule does not match as firewall_rule, then it is an invalid rule. - else if (length < firewall_rule_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_rule, length, firewall_rule_length) == f_not_equal_to) { + else if (length < firewall_rule_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_rule, length, firewall_rule_length) == F_equal_to_not) { if (length > 0) { fl_color_print_code(f_type_warning, data.context.warning); fprintf(f_type_warning, "WARNING: At line %i, the object '", i); @@ -321,7 +321,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamics_delete_simple(arguments); f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; if (tool == firewall_program_ip46tables) { if (r == 2) { @@ -336,14 +336,14 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamic_delete_simple(argument); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; // process the action when a non-none chain is specified. if (chain != firewall_chain_none_id && action != firewall_action_none_id) { if (action == firewall_action_append_id) { f_macro_string_dynamic_new(status, argument, firewall_action_append_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_action_append_command, firewall_action_append_command_length); argument.used = firewall_action_append_command_length; @@ -351,7 +351,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (action == firewall_action_insert_id) { f_macro_string_dynamic_new(status, argument, firewall_action_insert_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_action_insert_command, firewall_action_insert_command_length); argument.used = firewall_action_insert_command_length; @@ -359,7 +359,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (action == firewall_action_policy_id) { f_macro_string_dynamic_new(status, argument, firewall_action_policy_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_action_policy_command, firewall_action_policy_command_length); argument.used = firewall_action_policy_command_length; @@ -367,7 +367,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (argument.used > 0) { firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(argument); break; } @@ -377,7 +377,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (data.chains.array[local.chain_ids.array[local.chain]].used > 0) { f_macro_string_dynamic_new(status, argument, data.chains.array[local.chain_ids.array[local.chain]].used); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, data.chains.array[local.chain_ids.array[local.chain]].string, data.chains.array[local.chain_ids.array[local.chain]].used); argument.used = data.chains.array[local.chain_ids.array[local.chain]].used; @@ -386,7 +386,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (chain == firewall_chain_forward_id) { f_macro_string_dynamic_new(status, argument, firewall_chain_forward_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_chain_forward, firewall_chain_forward_length); argument.used = firewall_chain_forward_length; @@ -394,7 +394,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (chain == firewall_chain_postrouting_id) { f_macro_string_dynamic_new(status, argument, firewall_chain_postrouting_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_chain_postrouting, firewall_chain_postrouting_length); argument.used += firewall_chain_postrouting_length; @@ -402,7 +402,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (chain == firewall_chain_prerouting_id) { f_macro_string_dynamic_new(status, argument, firewall_chain_prerouting_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_chain_prerouting, firewall_chain_prerouting_length); argument.used = firewall_chain_prerouting_length; @@ -410,7 +410,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (chain == firewall_chain_input_id) { f_macro_string_dynamic_new(status, argument, firewall_chain_input_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_chain_input, firewall_chain_input_length); argument.used = firewall_chain_input_length; @@ -418,7 +418,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else if (chain == firewall_chain_output_id) { f_macro_string_dynamic_new(status, argument, firewall_chain_output_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_chain_output, firewall_chain_output_length); argument.used = firewall_chain_output_length; @@ -426,7 +426,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (argument.used > 0) { firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } } @@ -435,17 +435,17 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const // add the device if and only if a non-none direction is specified. if (device.used > 0 && (direction == firewall_direction_input_id || direction == firewall_direction_output_id)) { - if (length < firewall_device_all_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == f_not_equal_to) { + if (length < firewall_device_all_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string) firewall_device_all, length, firewall_device_all_length) == F_equal_to_not) { if (direction == firewall_direction_input_id) { f_macro_string_dynamic_new(status, argument, firewall_device_input_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_input_command, firewall_device_input_command_length); argument.used = firewall_device_input_command_length; } else if (direction == firewall_direction_output_id) { f_macro_string_dynamic_new(status, argument, firewall_device_output_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_device_output_command, firewall_device_output_command_length); argument.used = firewall_device_output_command_length; @@ -453,7 +453,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (argument.used > 0) { firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } } @@ -463,13 +463,13 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (device.used > 0) { f_macro_string_dynamic_new(status, argument, device.used); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, device.string, device.used); argument.used = device.used; firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } } @@ -478,26 +478,26 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (use_protocol) { f_macro_string_dynamic_new(status, argument, firewall_protocol_command_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, firewall_protocol_command, firewall_protocol_command_length); argument.used = firewall_protocol_command_length; firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } if (protocol.used > 0) { f_macro_string_dynamic_new(status, argument, protocol.used); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, protocol.string, protocol.used); argument.used = protocol.used; firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } } @@ -516,7 +516,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (length > 0) { f_macro_string_dynamic_new(status, ip_list, length); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // prevent the loop below from being processed. subcounter = local.rule_contents.array[i].used; } @@ -535,13 +535,13 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (length > 0) { f_macro_string_dynamic_new(status, argument, length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(argument.string, local.buffer.string + local.rule_contents.array[i].array[subcounter].start, length); argument.used = length; firewall_macro_append_argument_to_arguments(status, arguments, argument) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { break; } } @@ -572,7 +572,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamic_new(status, file_path, network_path_length + ip_list.used + firewall_default_allocation_step); - if (status == f_none) { + if (status == F_none) { firewall_macro_concat_string(file_path.string, network_path, network_path_length); firewall_macro_concat_string(file_path.string + network_path_length, ip_list.string, ip_list.used); file_path.used = file_path.size; @@ -581,32 +581,32 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const status = f_file_open(file_path.string, 0, &file); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { // the file does not have to exist fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string); - status = f_none; + status = F_none; } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_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_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_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_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } - if (status != f_file_not_found) { - status = f_status_set_error(status); + if (status != F_file_found_not) { + status = F_status_set_error(status); } f_file_close(&file.id); @@ -616,32 +616,32 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_file_close(&file.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read()"); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print_line(f_type_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) { + else if (status == F_file_open_not) { fl_color_print_line(f_type_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_error_seek) { + else if (status == F_file_seek) { fl_color_print_line(f_type_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_error_read) { + else if (status == F_file_read) { fl_color_print_line(f_type_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_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()", status); } - status = f_status_set_error(status); + status = F_status_set_error(status); } else { { @@ -652,23 +652,23 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const status = fll_fss_basic_read(&local_buffer, &input, &basic_objects, &basic_contents); } - if (f_status_set_error(status)) { - status = f_status_set_fine(status); + if (F_status_set_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'", file_path.used, file_path.string); } - else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) { + else if (status == F_data_no_eos || status == F_data_not || status == F_data_no_stop) { // empty files are to be silently ignored } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'", status, file_path.used, file_path.string); } - status = f_status_set_error(status); + status = F_status_set_error(status); } else { f_string_length buffer_counter = 0; @@ -678,7 +678,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const if (ip_list_direction) { f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_destination_action_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(ip_list_action.string, firewall_ip_list_destination_action, firewall_ip_list_destination_action_length); ip_list_action.used = firewall_ip_list_destination_action_length; @@ -686,18 +686,18 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const else { f_macro_string_dynamic_resize(status, ip_list_action, firewall_ip_list_source_action_length); - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; firewall_macro_concat_string(ip_list_action.string, firewall_ip_list_source_action, firewall_ip_list_source_action_length); ip_list_action.used = firewall_ip_list_source_action_length; } - status = f_none; + status = F_none; if (arguments.used + 2 > arguments.size) { f_macro_string_dynamics_resize(status, arguments, arguments.size + 2); } - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); f_macro_string_dynamic_delete_simple(ip_list_action); @@ -706,7 +706,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_string_dynamic ip_argument = f_string_dynamic_initialize; firewall_macro_append_argument_to_arguments(status, arguments, ip_list_action) - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamic_delete_simple(ip_argument); break; } @@ -717,7 +717,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_string_dynamic_new(status, ip_argument, ip_length); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); break; } @@ -726,7 +726,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const ip_argument.used = ip_length; firewall_macro_append_argument_to_arguments(status, arguments, ip_argument) - if (f_status_is_error(status)) break; + if (F_status_is_error(status)) break; // print command when debugging. #ifdef _en_firewall_debug_ @@ -745,7 +745,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const status = fll_execute_program((f_string) current_tool, arguments, &results); - if (status == f_failure) { + if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool); fprintf(f_type_error, " "); @@ -765,7 +765,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const break; } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); // remove ip_argument from arguments string. @@ -795,7 +795,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const f_macro_fss_objects_delete_simple(basic_objects); f_macro_fss_contents_delete_simple(basic_contents); - if (status == f_failure || status == f_invalid_parameter) break; + if (status == F_failure || status == F_parameter) break; } else { // print command when debugging. @@ -815,7 +815,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const status = fll_execute_program(current_tool, arguments, &results); - if (status == f_failure) { + if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -830,7 +830,7 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const break; } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); break; } @@ -849,11 +849,11 @@ f_return_status firewall_perform_commands(const firewall_local_data local, const } f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) { - f_status status = f_none; + f_status status = F_none; uint8_t tool = firewall_program_iptables; - bool new_chain = f_false; - bool create_chain = f_false; + bool new_chain = F_false; + bool create_chain = F_false; int results = 0; f_array_length i = 0; @@ -868,19 +868,19 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved f_macro_array_lengths_delete_simple(local->chain_ids); f_macro_array_lengths_new(status, local->chain_ids, local->chain_objects.used); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } f_macro_string_dynamics_new(status, arguments, 2); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } f_macro_string_dynamic_new(status, arguments.array[0], firewall_chain_create_command_length); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(arguments); return status; @@ -892,7 +892,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved f_macro_string_dynamic_new(status, arguments.array[1], firewall_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { arguments.used = 1; f_macro_string_dynamics_delete_simple(arguments); @@ -901,12 +901,12 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved arguments.used = 2; - reserved->has_lock = f_false; - reserved->has_stop = f_false; - reserved->has_main = f_false; + reserved->has_lock = F_false; + reserved->has_stop = F_false; + reserved->has_main = F_false; while (i < local->chain_objects.used) { - new_chain = f_true; + new_chain = F_true; j = 0; // skip globally reserved chain name: main @@ -914,9 +914,9 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved range.stop = firewall_group_main_length - 1; fixed_string.string = firewall_group_main; fixed_string.used = firewall_group_main_length; - if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == f_equal_to) { - new_chain = f_false; - reserved->has_main = f_true; + if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == F_equal_to) { + new_chain = F_false; + reserved->has_main = F_true; reserved->main_at = i; } @@ -925,9 +925,9 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved range.stop = firewall_group_stop_length - 1; fixed_string.string = firewall_group_stop; fixed_string.used = firewall_group_stop_length; - if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == f_equal_to) { - new_chain = f_false; - reserved->has_stop = f_true; + if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == F_equal_to) { + new_chain = F_false; + reserved->has_stop = F_true; reserved->stop_at = i; } @@ -936,9 +936,9 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved range.stop = firewall_group_lock_length - 1; fixed_string.string = firewall_group_lock; fixed_string.used = firewall_group_lock_length; - if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == f_equal_to) { - new_chain = f_false; - reserved->has_lock = f_true; + if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == F_equal_to) { + new_chain = F_false; + reserved->has_lock = F_true; reserved->lock_at = i; } @@ -947,8 +947,8 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved range.stop = firewall_group_lock_length - 1; fixed_string.string = firewall_chain_none; fixed_string.used = firewall_chain_none_length; - if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == f_equal_to) { - new_chain = f_false; + if (fl_string_dynamic_partial_compare(local->buffer, fixed_string, local->chain_objects.array[i], range) == F_equal_to) { + new_chain = F_false; } f_macro_string_dynamic_clear(fixed_string); @@ -958,8 +958,8 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved range.start = 0; range.stop = data->chains.array[j].used - 1; - if (fl_string_dynamic_partial_compare(local->buffer, data->chains.array[j], local->chain_objects.array[i], range) == f_equal_to) { - new_chain = f_false; + if (fl_string_dynamic_partial_compare(local->buffer, data->chains.array[j], local->chain_objects.array[i], range) == F_equal_to) { + new_chain = F_false; local->chain_ids.array[i] = j; break; @@ -973,21 +973,21 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved if (data->chains.used >= data->chains.size) { f_macro_string_dynamics_resize(status, data->chains, data->chains.used + firewall_default_allocation_step); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(arguments); return status; } } - create_chain = f_true; + create_chain = F_true; length = firewall_macro_structure_size(local->chain_objects, i); arguments.array[1].used = 0; if (length > arguments.array[1].size) { f_macro_string_dynamic_resize(status, arguments.array[1], length); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(arguments); return status; @@ -996,7 +996,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved f_macro_string_dynamic_new(status, data->chains.array[data->chains.used], length); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { f_macro_string_dynamics_delete_simple(arguments); return status; @@ -1021,20 +1021,20 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved j++; } // while - if (fl_string_compare(arguments.array[1].string, firewall_chain_forward, arguments.array[1].used, firewall_chain_forward_length) == f_equal_to) { - create_chain = f_false; + if (fl_string_compare(arguments.array[1].string, firewall_chain_forward, arguments.array[1].used, firewall_chain_forward_length) == F_equal_to) { + create_chain = F_false; } - else if (fl_string_compare(arguments.array[1].string, firewall_chain_input, arguments.array[1].used, firewall_chain_input_length) == f_equal_to) { - create_chain = f_false; + else if (fl_string_compare(arguments.array[1].string, firewall_chain_input, arguments.array[1].used, firewall_chain_input_length) == F_equal_to) { + create_chain = F_false; } - else if (fl_string_compare(arguments.array[1].string, firewall_chain_output, arguments.array[1].used, firewall_chain_output_length) == f_equal_to) { - create_chain = f_false; + else if (fl_string_compare(arguments.array[1].string, firewall_chain_output, arguments.array[1].used, firewall_chain_output_length) == F_equal_to) { + create_chain = F_false; } - else if (fl_string_compare(arguments.array[1].string, firewall_chain_postrouting, arguments.array[1].used, firewall_chain_postrouting_length) == f_equal_to) { - create_chain = f_false; + else if (fl_string_compare(arguments.array[1].string, firewall_chain_postrouting, arguments.array[1].used, firewall_chain_postrouting_length) == F_equal_to) { + create_chain = F_false; } - else if (fl_string_compare(arguments.array[1].string, firewall_chain_prerouting, arguments.array[1].used, firewall_chain_prerouting_length) == f_equal_to) { - create_chain = f_false; + else if (fl_string_compare(arguments.array[1].string, firewall_chain_prerouting, arguments.array[1].used, firewall_chain_prerouting_length) == F_equal_to) { + create_chain = F_false; } if (create_chain) { @@ -1056,7 +1056,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved tool = firewall_program_iptables; status = fll_execute_program((f_string) firewall_tool_iptables, arguments, &results); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { // print command when debugging. #ifdef _en_firewall_debug_ if (data->parameters[firewall_parameter_debug].result == f_console_result_found) { @@ -1076,10 +1076,10 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved status = fll_execute_program((f_string) firewall_tool_ip6tables, arguments, &results); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_failure) { + if (status == F_failure) { if (tool == firewall_program_iptables) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); } @@ -1104,7 +1104,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved fl_color_print_code(f_type_error, data->context.reset); fprintf(f_type_error, "\n"); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { @@ -1129,7 +1129,7 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved f_return_status firewall_delete_chains(const firewall_data data) { const f_string tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; - f_status status = f_none; + f_status status = F_none; for (f_string_length i = 0; i < 2; i++) { f_string_dynamics arguments = f_string_dynamics_initialize; @@ -1161,10 +1161,10 @@ f_return_status firewall_delete_chains(const firewall_data data) { status = fll_execute_program(tools[i], arguments, &results); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_failure) { + if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]); fprintf(f_type_error, " "); @@ -1178,7 +1178,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_error, data.context.reset); fprintf(f_type_error, "\n"); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { @@ -1219,10 +1219,10 @@ f_return_status firewall_delete_chains(const firewall_data data) { status = fll_execute_program(tools[i], arguments, &results); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_failure) { + if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]); fprintf(f_type_error, " "); @@ -1236,7 +1236,7 @@ f_return_status firewall_delete_chains(const firewall_data data) { fl_color_print_code(f_type_error, data.context.reset); fprintf(f_type_error, "\n"); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { @@ -1256,7 +1256,7 @@ f_return_status firewall_default_lock(const firewall_data data) { const f_string_length lengths[3] = { firewall_chain_input_length, firewall_chain_output_length, firewall_chain_forward_length }; - f_status status = f_none; + f_status status = F_none; for (f_string_length i = 0; i < 3; i++) { f_string_dynamics arguments = f_string_dynamics_initialize; @@ -1298,10 +1298,10 @@ f_return_status firewall_default_lock(const firewall_data data) { status = fll_execute_program(tools[j], arguments, &results); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_failure) { + if (status == F_failure) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[j]); fprintf(f_type_error, " "); @@ -1315,7 +1315,7 @@ f_return_status firewall_default_lock(const firewall_data data) { fl_color_print_code(f_type_error, data.context.reset); fprintf(f_type_error, "\n"); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { @@ -1332,31 +1332,31 @@ f_return_status firewall_default_lock(const firewall_data data) { f_return_status firewall_buffer_rules(const f_string filename, const bool optional, firewall_local_data *local, firewall_data *data) { f_file file = f_file_initialize; - f_status status = f_none; + f_status status = F_none; status = f_file_open(filename, 0, &file); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); if (optional) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_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_error_open && status != f_file_error_descriptor) { + else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } else { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'.", filename); } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'.", filename); } - else if (status == f_file_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename); } else { @@ -1371,25 +1371,25 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option f_file_close(&file.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read()."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print_line(f_type_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) { + else if (status == F_file_open_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); } - else if (status == f_file_error_seek) { + else if (status == F_file_seek) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); } - else if (status == f_file_error_read) { + else if (status == F_file_read) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -1406,16 +1406,16 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option status = fll_fss_basic_list_read(&local->buffer, &input, &local->chain_objects, &local->chain_contents); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_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) { + else if (status == F_data_no_eos || status == F_data_not || status == F_data_no_stop) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -1429,20 +1429,20 @@ f_return_status firewall_buffer_rules(const f_string filename, const bool option } f_return_status firewall_process_rules(f_string_range *input, firewall_local_data *local, firewall_data *data) { - f_status status = f_none; + f_status status = F_none; status = fll_fss_extended_read(&local->buffer, input, &local->rule_objects, &local->rule_contents); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { status = firewall_perform_commands(*local, *data); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_failure) { + else if (status == F_failure) { // the error message has already been displayed. } else { @@ -1461,12 +1461,12 @@ f_return_status firewall_process_rules(f_string_range *input, firewall_local_dat } f_return_status firewall_delete_local_data(firewall_local_data *local) { - f_status status = f_none; + f_status status = F_none; - local->is_global = f_true; - local->is_main = f_false; - local->is_stop = f_false; - local->is_lock = f_false; + local->is_global = F_true; + local->is_main = F_false; + local->is_stop = F_false; + local->is_lock = F_false; local->device = 0; local->chain = 0; @@ -1478,7 +1478,7 @@ f_return_status firewall_delete_local_data(firewall_local_data *local) { f_macro_fss_objects_delete_simple(local->rule_objects); f_macro_fss_contents_delete_simple(local->rule_contents); - return f_none; + return F_none; } #ifdef __cplusplus diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index e9e7517..3da3ba7 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -31,10 +31,10 @@ typedef struct { #define firewall_local_data_initialize \ { \ - f_true, \ - f_false, \ - f_false, \ - f_false, \ + F_true, \ + F_false, \ + F_false, \ + F_false, \ 0, \ f_string_dynamic_initialize, \ 0, \ @@ -57,9 +57,9 @@ typedef struct { #define firewall_reserved_chains_initialize \ { \ - f_false, \ - f_false, \ - f_false, \ + F_false, \ + F_false, \ + F_false, \ 0, \ 0, \ 0, \ @@ -90,7 +90,7 @@ typedef struct { if (arguments.used >= arguments.size) { \ f_macro_string_dynamics_resize(status, arguments, arguments.used + firewall_default_allocation_step); \ \ - if (f_status_is_error(status)) break; \ + if (F_status_is_error(status)) break; \ } \ \ arguments.array[arguments.used].string = argument.string; \ diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 247877d..7f679a3 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -117,27 +117,27 @@ extern "C" { printf("%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fss_basic_list_read_print_help_ #ifndef _di_fss_basic_list_read_main_ f_return_status fss_basic_list_read_main(const f_console_arguments arguments, fss_basic_list_read_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_basic_list_read_total_parameters }; f_console_parameter_id ids[3] = { fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_basic_list_read_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_list_read_parameter_help].result == f_console_result_found) { @@ -153,7 +153,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_depth].result == f_console_result_found) { @@ -162,7 +162,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) { @@ -171,7 +171,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_found) { @@ -180,7 +180,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { @@ -189,7 +189,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_object].result == f_console_result_found) { @@ -201,7 +201,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) { @@ -212,7 +212,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -225,7 +225,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -235,7 +235,7 @@ extern "C" { f_string_length original_size = data->quantity.total; status = fss_basic_list_read_main_preprocess_depth(arguments, *data, &depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; @@ -249,11 +249,11 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); fss_basic_list_read_delete_data(data); - return f_none; + return F_none; } fss_basic_list_read_delete_data(data); - return f_none; + return F_none; } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { @@ -263,7 +263,7 @@ extern "C" { macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->process_pipe) { @@ -273,8 +273,8 @@ extern "C" { status = f_file_read(file, &data->buffer); - if (f_status_is_error(status)) { - fss_basic_list_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_file_error(data->context, "fl_file_read", "-", F_status_set_fine(status)); macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); @@ -283,7 +283,7 @@ extern "C" { status = fss_basic_list_read_main_process_file(arguments, data, "-", depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; @@ -303,8 +303,8 @@ extern "C" { data->quantity.total = original_size; - if (f_status_is_error(status)) { - fss_basic_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; @@ -313,8 +313,8 @@ extern "C" { if (data->quantity.total == 0) { status = f_file_size_by_id(file.id, &data->quantity.total); - if (f_status_is_error(status)) { - fss_basic_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); } @@ -330,8 +330,8 @@ extern "C" { f_file_close(&file.id); - if (f_status_is_error(status)) { - fss_basic_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; @@ -339,7 +339,7 @@ extern "C" { status = fss_basic_list_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_list_read_depths_delete_simple(depths); fss_basic_list_read_delete_data(data); return status; @@ -356,7 +356,7 @@ extern "C" { } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files."); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } fss_basic_list_read_delete_data(data); @@ -366,7 +366,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_delete_data_ f_return_status fss_basic_list_read_delete_data(fss_basic_list_read_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_basic_list_read_total_parameters) { @@ -382,7 +382,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_basic_list_read_delete_data_ diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 34b53a8..fc36aa8 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -98,20 +98,20 @@ extern "C" { #define f_console_parameter_initialize_fss_basic_list_read \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_line, fss_basic_list_read_long_line, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_name, fss_basic_list_read_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_object, fss_basic_list_read_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_select, fss_basic_list_read_long_select, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_total, fss_basic_list_read_long_total, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_basic_list_read_short_at, fss_basic_list_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_line, fss_basic_list_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_name, fss_basic_list_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_object, fss_basic_list_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_select, fss_basic_list_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_total, fss_basic_list_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_basic_list_read_total_parameters 14 @@ -139,7 +139,7 @@ extern "C" { f_fss_contents_initialize, \ f_string_quantity_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_basic_list_read_data_ @@ -151,7 +151,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_basic_list_read_print_help_ extern f_return_status fss_basic_list_read_print_help(const fl_color_context context); @@ -168,7 +168,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_list_read_delete_data() @@ -186,7 +186,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_list_read_main() diff --git a/level_3/fss_basic_list_read/c/main.c b/level_3/fss_basic_list_read/c/main.c index 3b2ab3c..b33b2d3 100644 --- a/level_3/fss_basic_list_read/c/main.c +++ b/level_3/fss_basic_list_read/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_basic_list_read_data data = fss_basic_list_read_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_basic_list_read_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } 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 95a49c6..31273c1 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 @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_file_error_ void fss_basic_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) { + if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_type_error, context.notable, context.reset, "%u", status); fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); @@ -21,40 +21,40 @@ extern "C" { #ifndef _di_fss_basic_list_read_print_number_argument_error_ void fss_basic_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_type_error, context.error, context.reset, "."); } - else if (status == f_number_invalid) { + else if (status == F_number_invalid) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_underflow) { + else if (status == F_number_underflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_negative) { + else if (status == F_number_negative) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_positive) { + else if (status == F_number_positive) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); @@ -63,7 +63,7 @@ extern "C" { fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_no_data) { + else if (status == F_data_not) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); @@ -84,7 +84,7 @@ extern "C" { #ifndef _di_fss_basic_list_read_main_preprocess_depth_ f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_list_read_data data, fss_basic_list_read_depths *depths) { - f_status status = f_none; + f_status status = F_none; { f_array_length depth_size = 1; @@ -94,7 +94,7 @@ extern "C" { } macro_fss_basic_list_read_depths_new(status, (*depths), depth_size); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -122,8 +122,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth); - if (f_status_is_error(status)) { - fss_basic_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_depth, arguments.argv[position_depth], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status)); return status; } } @@ -142,8 +142,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at); - if (f_status_is_error(status)) { - fss_basic_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_at, arguments.argv[depths->array[i].index_at], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status)); return status; } } // for @@ -168,11 +168,11 @@ extern "C" { status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } - if (f_status_is_error(status)) { - f_status status_code = f_status_set_fine(status); + if (F_status_is_error(status)) { + f_status status_code = F_status_set_fine(status); // @todo: move error printing into common function. - if (status_code == f_error_allocation || status_code == f_error_reallocation) { + if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_size) { @@ -202,7 +202,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } @@ -217,7 +217,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); @@ -228,18 +228,18 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } // for - return f_none; + return F_none; } #endif // _di_fss_basic_list_read_main_preprocess_depth_ #ifndef _di_fss_basic_list_read_main_process_file_ f_return_status fss_basic_list_read_main_process_file(const f_console_arguments arguments, fss_basic_list_read_data *data, const f_string filename, const fss_basic_list_read_depths depths) { - f_status status = f_none; + f_status status = F_none; { f_string_range input = f_string_range_initialize; @@ -249,25 +249,25 @@ extern "C" { status = fll_fss_basic_list_read(&data->buffer, &input, &data->objects, &data->contents); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_incomplete_utf_on_stop) { + else if (status == F_incomplete_utf_stop) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); } - else if (status == f_incomplete_utf_on_eos) { + else if (status == F_incomplete_utf_eos) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); @@ -282,15 +282,15 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - return f_status_set_error(status); + return F_status_set_error(status); } - else if (status == f_no_data_on_stop || status == f_no_data_on_eos) { + else if (status == F_data_no_stop || status == F_data_no_eos) { // Clear buffers, then attempt the next file. f_macro_fss_contents_delete_simple(data->contents); f_macro_fss_objects_delete_simple(data->objects); f_macro_string_dynamic_delete_simple(data->buffer); - return f_status_set_warning(status); + return F_status_set_warning(status); } } @@ -299,14 +299,14 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_basic_list_read_parameter_select].additional.array[data->parameters[fss_basic_list_read_parameter_select].additional.used - 1]], &select); - if (f_status_is_error(status)) { - fss_basic_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_select, arguments.argv[data->parameters[fss_basic_list_read_parameter_select].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_select, arguments.argv[data->parameters[fss_basic_list_read_parameter_select].additional.array[0]], F_status_set_fine(status)); return status; } // This standard does not support multiple content groups. if (select > 0) { - return f_none; + return F_none; } } @@ -315,8 +315,8 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_basic_list_read_parameter_line].additional.array[data->parameters[fss_basic_list_read_parameter_line].additional.used - 1]], &line); - if (f_status_is_error(status)) { - fss_basic_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_line, arguments.argv[data->parameters[fss_basic_list_read_parameter_line].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_list_read_long_line, arguments.argv[data->parameters[fss_basic_list_read_parameter_line].additional.array[0]], F_status_set_fine(status)); return status; } } @@ -333,7 +333,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -344,7 +344,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -386,7 +386,7 @@ extern "C" { fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol); } - return f_none; + return F_none; } f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; @@ -411,7 +411,7 @@ extern "C" { } } // for - return f_none; + return F_none; } for (f_string_length i = 0; i < data->objects.used; i++) { @@ -421,7 +421,7 @@ extern "C" { fprintf(f_type_output, "%c", f_string_eol); } // for - return f_none; + return F_none; } if (depths.array[0].index_at > 0) { @@ -430,7 +430,7 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); } - return f_none; + return F_none; } f_array_length at = 0; @@ -457,7 +457,7 @@ extern "C" { fprintf(f_type_output, "%llu%c", total, f_string_eol); } - return f_none; + return F_none; } if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { @@ -509,7 +509,7 @@ extern "C" { } } - return f_none; + return F_none; } if (data->contents.array[i].used > 0) { @@ -526,7 +526,7 @@ extern "C" { } } // for - return f_none; + return F_none; } if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { @@ -553,7 +553,7 @@ extern "C" { } // for fprintf(f_type_output, "%llu%c", total, f_string_eol); - return f_none; + return F_none; } if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { @@ -612,7 +612,7 @@ extern "C" { } } // for - return f_none; + return F_none; } for (f_string_length i = 0; i < data->contents.used; i++) { @@ -631,7 +631,7 @@ extern "C" { f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]); } // for - return f_none; + return F_none; } #endif // _di_fss_basic_list_read_main_process_file_ diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h index d43513e..5ec439d 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h @@ -79,24 +79,24 @@ extern "C" { #define macro_fss_basic_list_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_list_read_depth, length) #define macro_fss_basic_list_read_depths_delete(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_basic_list_read_depth_delete(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_delete(depths, fss_basic_list_read_depth) + if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_list_read_depth) #define macro_fss_basic_list_read_depths_destroy(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_basic_list_read_depth_destroy(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_destroy(depths, fss_basic_list_read_depth) + if (status == F_none) f_macro_memory_structure_destroy(depths, fss_basic_list_read_depth) #define macro_fss_basic_list_read_depths_delete_simple(depths) \ depths.used = depths.size; \ @@ -115,16 +115,16 @@ extern "C" { if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_basic_list_read_depth) #define macro_fss_basic_list_read_depths_resize(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_basic_list_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -136,16 +136,16 @@ extern "C" { } #define macro_fss_basic_list_read_depths_adjust(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_basic_list_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_list_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -204,8 +204,8 @@ extern "C" { * This stores the pre-processed depth parameters. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_basic_list_read_main_preprocess_depth_ extern f_return_status fss_basic_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_list_read_data data, fss_basic_list_read_depths *depths) f_gcc_attribute_visibility_internal; 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 cb11c04..ef011dc 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 @@ -22,27 +22,27 @@ extern "C" { fll_program_print_help_usage(context, fss_basic_list_write_name, ""); - return f_none; + return F_none; } #endif // _di_fss_basic_list_write_print_help_ #ifndef _di_fss_basic_list_write_main_ f_return_status fss_basic_list_write_main(const f_console_arguments arguments, fss_basic_list_write_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_basic_list_write_total_parameters }; f_console_parameter_id ids[3] = { fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_basic_list_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_list_write_parameter_help].result == f_console_result_found) { @@ -66,19 +66,19 @@ extern "C" { status = f_file_read(file, &input); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -87,7 +87,7 @@ extern "C" { f_macro_string_dynamic_delete_simple(input); fss_basic_list_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } range.start = 0; @@ -96,15 +96,15 @@ extern "C" { if (object) { status = fl_fss_basic_list_object_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos || status == F_data_no_eol) { + return F_status_set_error(status); } } else { status = fl_fss_basic_list_content_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos || status == F_data_no_eol) { + return F_status_set_error(status); } } @@ -122,19 +122,19 @@ extern "C" { if (object) { status = fl_fss_basic_list_object_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos || status == F_data_no_eol) { + return F_status_set_error(status); } } else { status = fl_fss_basic_list_content_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos || status == f_no_data_on_eol) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos || status == F_data_no_eol) { + return F_status_set_error(status); } } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_list_write_parameter_file].result == f_console_result_additional) { @@ -144,21 +144,21 @@ extern "C" { status = f_file_open(arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], 0, &output); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); f_file_close(&output.id); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_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_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_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_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_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 { @@ -166,19 +166,19 @@ extern "C" { } fss_basic_list_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } status = f_file_write(output, buffer, 0); f_file_close(&output.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_error_write) { + else if (status == F_file_write) { fl_color_print_line(f_type_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 { @@ -186,7 +186,7 @@ extern "C" { } fss_basic_list_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } } else { @@ -212,7 +212,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_basic_list_write_delete_data_ diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index 5d19cf6..86023fd 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -72,14 +72,14 @@ extern "C" { #define f_console_parameter_initialize_fss_basic_list_write \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_list_write_short_object, fss_basic_list_write_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_write_short_file, fss_basic_list_write_long_file, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_list_write_short_string, fss_basic_list_write_long_string, 0, f_true, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_basic_list_write_short_object, fss_basic_list_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_write_short_file, fss_basic_list_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_list_write_short_string, fss_basic_list_write_long_string, 0, F_true, f_console_type_normal), \ } #define fss_basic_list_write_total_parameters 8 @@ -99,7 +99,7 @@ extern "C" { { \ f_console_parameter_initialize_fss_basic_list_write, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_basic_list_write_data_ @@ -111,7 +111,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ extern f_return_status fss_basic_list_write_print_help(const fl_color_context context); @@ -128,7 +128,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_list_write_delete_data() @@ -146,7 +146,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_list_write_main() diff --git a/level_3/fss_basic_list_write/c/main.c b/level_3/fss_basic_list_write/c/main.c index 884854b..d5f4a97 100644 --- a/level_3/fss_basic_list_write/c/main.c +++ b/level_3/fss_basic_list_write/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_basic_list_write_data data = fss_basic_list_write_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_basic_list_write_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 074e4cc..10dc27b 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -117,27 +117,27 @@ extern "C" { printf("%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fss_basic_read_print_help_ #ifndef _di_fss_basic_read_main_ f_return_status fss_basic_read_main(const f_console_arguments arguments, fss_basic_read_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_basic_read_total_parameters }; f_console_parameter_id ids[3] = { fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_basic_read_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_read_parameter_help].result == f_console_result_found) { @@ -153,7 +153,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_depth].result == f_console_result_found) { @@ -162,7 +162,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_found) { @@ -171,7 +171,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_name].result == f_console_result_found) { @@ -180,7 +180,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { @@ -189,7 +189,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_object].result == f_console_result_found) { @@ -201,7 +201,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) { @@ -212,7 +212,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -225,7 +225,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -235,7 +235,7 @@ extern "C" { f_string_length original_size = data->quantity.total; status = fss_basic_read_main_preprocess_depth(arguments, *data, &depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); return status; @@ -249,11 +249,11 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); fss_basic_read_delete_data(data); - return f_none; + return F_none; } fss_basic_read_delete_data(data); - return f_none; + return F_none; } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { @@ -263,7 +263,7 @@ extern "C" { macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->process_pipe) { @@ -273,8 +273,8 @@ extern "C" { status = f_file_read(file, &data->buffer); - if (f_status_is_error(status)) { - fss_basic_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_file_error(data->context, "fl_file_read", "-", F_status_set_fine(status)); macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); @@ -283,7 +283,7 @@ extern "C" { status = fss_basic_read_main_process_file(arguments, data, "-", depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); return status; @@ -303,8 +303,8 @@ extern "C" { data->quantity.total = original_size; - if (f_status_is_error(status)) { - fss_basic_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); @@ -314,8 +314,8 @@ extern "C" { if (data->quantity.total == 0) { status = f_file_size_by_id(file.id, &data->quantity.total); - if (f_status_is_error(status)) { - fss_basic_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); } @@ -331,8 +331,8 @@ extern "C" { f_file_close(&file.id); - if (f_status_is_error(status)) { - fss_basic_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); @@ -341,7 +341,7 @@ extern "C" { status = fss_basic_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_basic_read_depths_delete_simple(depths); fss_basic_read_delete_data(data); return status; @@ -358,7 +358,7 @@ extern "C" { } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files."); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } fss_basic_read_delete_data(data); @@ -368,7 +368,7 @@ extern "C" { #ifndef _di_fss_basic_read_delete_data_ f_return_status fss_basic_read_delete_data(fss_basic_read_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_basic_read_total_parameters) { @@ -384,7 +384,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_basic_read_delete_data_ diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index e822289..2404f0f 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -98,20 +98,20 @@ extern "C" { #define f_console_parameter_initialize_fss_basic_read \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_name, fss_basic_read_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_object, fss_basic_read_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_select, fss_basic_read_long_select, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_total, fss_basic_read_long_total, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_basic_read_short_at, fss_basic_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_depth, fss_basic_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_empty, fss_basic_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_line, fss_basic_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_name, fss_basic_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_object, fss_basic_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_select, fss_basic_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_total, fss_basic_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_read_short_trim, fss_basic_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_basic_read_total_parameters 14 @@ -139,7 +139,7 @@ extern "C" { f_fss_contents_initialize, \ f_string_quantity_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_basic_read_data_ @@ -151,7 +151,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_basic_read_print_help_ extern f_return_status fss_basic_read_print_help(const fl_color_context context); @@ -168,7 +168,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_read_delete_data() @@ -186,7 +186,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_read_main() diff --git a/level_3/fss_basic_read/c/main.c b/level_3/fss_basic_read/c/main.c index e08308b..c72e335 100644 --- a/level_3/fss_basic_read/c/main.c +++ b/level_3/fss_basic_read/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_basic_read_data data = fss_basic_read_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_basic_read_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } 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 0f0247f..cb0c5b0 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 @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fss_basic_read_print_file_error_ void fss_basic_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) { + if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_type_error, context.notable, context.reset, "%u", status); fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); @@ -21,40 +21,40 @@ extern "C" { #ifndef _di_fss_basic_read_print_number_argument_error_ void fss_basic_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_type_error, context.error, context.reset, "."); } - else if (status == f_number_invalid) { + else if (status == F_number_invalid) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_underflow) { + else if (status == F_number_underflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_negative) { + else if (status == F_number_negative) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_positive) { + else if (status == F_number_positive) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); @@ -63,7 +63,7 @@ extern "C" { fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_no_data) { + else if (status == F_data_not) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); @@ -84,7 +84,7 @@ extern "C" { #ifndef _di_fss_basic_read_main_preprocess_depth_ f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_read_data data, fss_basic_read_depths *depths) { - f_status status = f_none; + f_status status = F_none; { f_array_length depth_size = 1; @@ -94,7 +94,7 @@ extern "C" { } macro_fss_basic_read_depths_new(status, (*depths), depth_size); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -122,8 +122,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth); - if (f_status_is_error(status)) { - fss_basic_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_depth, arguments.argv[position_depth], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status)); return status; } } @@ -142,8 +142,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at); - if (f_status_is_error(status)) { - fss_basic_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_at, arguments.argv[depths->array[i].index_at], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status)); return status; } } // for @@ -168,11 +168,11 @@ extern "C" { status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } - if (f_status_is_error(status)) { - f_status status_code = f_status_set_fine(status); + if (F_status_is_error(status)) { + f_status status_code = F_status_set_fine(status); // @todo: move error printing into common function. - if (status_code == f_error_allocation || status_code == f_error_reallocation) { + if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_size) { @@ -202,7 +202,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } @@ -217,7 +217,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); @@ -228,18 +228,18 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } // for - return f_none; + return F_none; } #endif // _di_fss_basic_read_main_preprocess_depth_ #ifndef _di_fss_basic_read_main_process_file_ f_return_status fss_basic_read_main_process_file(const f_console_arguments arguments, fss_basic_read_data *data, const f_string filename, const fss_basic_read_depths depths) { - f_status status = f_none; + f_status status = F_none; { f_string_range input = f_string_range_initialize; @@ -249,25 +249,25 @@ extern "C" { status = fll_fss_basic_read(&data->buffer, &input, &data->objects, &data->contents); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_incomplete_utf_on_stop) { + else if (status == F_incomplete_utf_stop) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); } - else if (status == f_incomplete_utf_on_eos) { + else if (status == F_incomplete_utf_eos) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); @@ -282,15 +282,15 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - return f_status_set_error(status); + return F_status_set_error(status); } - else if (status == f_no_data_on_stop || status == f_no_data_on_eos) { + else if (status == F_data_no_stop || status == F_data_no_eos) { // Clear buffers, then attempt the next file. f_macro_fss_contents_delete_simple(data->contents); f_macro_fss_objects_delete_simple(data->objects); f_macro_string_dynamic_delete_simple(data->buffer); - return f_status_set_warning(status); + return F_status_set_warning(status); } } @@ -299,14 +299,14 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_basic_read_parameter_select].additional.array[data->parameters[fss_basic_read_parameter_select].additional.used - 1]], &select); - if (f_status_is_error(status)) { - fss_basic_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_select, arguments.argv[data->parameters[fss_basic_read_parameter_select].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_select, arguments.argv[data->parameters[fss_basic_read_parameter_select].additional.array[0]], F_status_set_fine(status)); return status; } // This standard does not support multiple content groups. if (select > 0) { - return f_none; + return F_none; } } @@ -315,8 +315,8 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_basic_read_parameter_line].additional.array[data->parameters[fss_basic_read_parameter_line].additional.used - 1]], &line); - if (f_status_is_error(status)) { - fss_basic_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_line, arguments.argv[data->parameters[fss_basic_read_parameter_line].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_basic_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_basic_read_long_line, arguments.argv[data->parameters[fss_basic_read_parameter_line].additional.array[0]], F_status_set_fine(status)); return status; } } @@ -333,7 +333,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -344,7 +344,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -386,7 +386,7 @@ extern "C" { fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol); } - return f_none; + return F_none; } f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; @@ -411,7 +411,7 @@ extern "C" { } } // for - return f_none; + return F_none; } for (f_array_length i = 0; i < data->objects.used; i++) { @@ -421,7 +421,7 @@ extern "C" { fprintf(f_type_output, "%c", f_string_eol); } // for - return f_none; + return F_none; } if (depths.array[0].index_at > 0) { @@ -430,12 +430,12 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); } - return f_none; + return F_none; } if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { if (line > 0) { - return f_none; + return F_none; } } @@ -479,7 +479,7 @@ extern "C" { } } // for - return f_none; + return F_none; } if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { @@ -498,7 +498,7 @@ extern "C" { } // for fprintf(f_type_output, "%llu%c", total, f_string_eol); - return f_none; + return F_none; } if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { @@ -532,7 +532,7 @@ extern "C" { line_current++; } // for - return f_none; + return F_none; } for (f_string_length i = 0; i < data->contents.used; i++) { @@ -552,7 +552,7 @@ extern "C" { fprintf(f_type_output, "%c", f_string_eol); } // for - return f_none; + return F_none; } #endif // _di_fss_basic_read_main_process_file_ diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.h b/level_3/fss_basic_read/c/private-fss_basic_read.h index 5ab4ccb..4c1bf4b 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.h +++ b/level_3/fss_basic_read/c/private-fss_basic_read.h @@ -79,24 +79,24 @@ extern "C" { #define macro_fss_basic_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_basic_read_depth, length) #define macro_fss_basic_read_depths_delete(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_basic_read_depth_delete(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_delete(depths, fss_basic_read_depth) + if (status == F_none) f_macro_memory_structure_delete(depths, fss_basic_read_depth) #define macro_fss_basic_read_depths_destroy(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_basic_read_depth_destroy(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_destroy(depths, fss_basic_read_depth) + if (status == F_none) f_macro_memory_structure_destroy(depths, fss_basic_read_depth) #define macro_fss_basic_read_depths_delete_simple(depths) \ depths.used = depths.size; \ @@ -115,16 +115,16 @@ extern "C" { if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_basic_read_depth) #define macro_fss_basic_read_depths_resize(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_basic_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -136,16 +136,16 @@ extern "C" { } #define macro_fss_basic_read_depths_adjust(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_basic_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_basic_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -204,8 +204,8 @@ extern "C" { * This stores the pre-processed depth parameters. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_basic_read_main_preprocess_depth_ extern f_return_status fss_basic_read_main_preprocess_depth(const f_console_arguments arguments, const fss_basic_read_data data, fss_basic_read_depths *depths) f_gcc_attribute_visibility_internal; 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 9fdfec3..a28fc35 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -22,27 +22,27 @@ extern "C" { fll_program_print_help_usage(context, fss_basic_write_name, ""); - return f_none; + return F_none; } #endif // _di_fss_basic_write_print_help_ #ifndef _di_fss_basic_write_main_ f_return_status fss_basic_write_main(const f_console_arguments arguments, fss_basic_write_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_basic_write_total_parameters }; f_console_parameter_id ids[3] = { fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_basic_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_write_parameter_help].result == f_console_result_found) { @@ -66,19 +66,19 @@ extern "C" { status = f_file_read(file, &input); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -87,7 +87,7 @@ extern "C" { f_macro_string_dynamic_delete_simple(input); fss_basic_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } range.start = 0; @@ -96,15 +96,15 @@ extern "C" { if (object) { status = fl_fss_basic_object_write(&buffer, input, &range); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } else { status = fl_fss_basic_content_write(&buffer, input, &range); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } @@ -122,19 +122,19 @@ extern "C" { if (object) { status = fl_fss_basic_object_write(&buffer, input, &range); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } else { status = fl_fss_basic_content_write(&buffer, input, &range); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } - status = f_none; + status = F_none; } if (data->parameters[fss_basic_write_parameter_file].result == f_console_result_additional) { @@ -144,21 +144,21 @@ extern "C" { status = f_file_open(arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], 0, &output); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); f_file_close(&output.id); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_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_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_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_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_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 { @@ -172,13 +172,13 @@ extern "C" { status = f_file_write(output, buffer, 0); f_file_close(&output.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_error_write) { + else if (status == F_file_write) { fl_color_print_line(f_type_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 { @@ -186,7 +186,7 @@ extern "C" { } fss_basic_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } } else { @@ -201,7 +201,7 @@ extern "C" { #ifndef _di_fss_basic_write_delete_data_ f_return_status fss_basic_write_delete_data(fss_basic_write_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_basic_write_total_parameters) { @@ -213,7 +213,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_basic_write_delete_data_ diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index d61759c..f99a573 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -71,14 +71,14 @@ extern "C" { #define f_console_parameter_initialize_fss_basic_write \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_basic_write_short_object, fss_basic_write_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_write_short_file, fss_basic_write_long_file, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_basic_write_short_string, fss_basic_write_long_string, 0, f_true, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_basic_write_short_object, fss_basic_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_write_short_file, fss_basic_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_basic_write_short_string, fss_basic_write_long_string, 0, F_true, f_console_type_normal), \ } #define fss_basic_write_total_parameters 8 @@ -98,7 +98,7 @@ extern "C" { { \ f_console_parameter_initialize_fss_basic_write, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_basic_write_data_ @@ -110,7 +110,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_basic_write_print_help_ extern f_return_status fss_basic_write_print_help(const fl_color_context context); @@ -127,7 +127,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_write_delete_data() @@ -145,7 +145,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_basic_write_main() diff --git a/level_3/fss_basic_write/c/main.c b/level_3/fss_basic_write/c/main.c index aa524b4..c237fe1 100644 --- a/level_3/fss_basic_write/c/main.c +++ b/level_3/fss_basic_write/c/main.c @@ -6,7 +6,7 @@ int main(const unsigned long argc, const f_string *argv) { f_status status = fss_basic_write_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index c144eec..dca81ad 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -117,27 +117,27 @@ extern "C" { printf("%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fss_extended_list_read_print_help_ #ifndef _di_fss_extended_list_read_main_ f_return_status fss_extended_list_read_main(const f_console_arguments arguments, fss_extended_list_read_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_extended_list_read_total_parameters }; f_console_parameter_id ids[3] = { fss_extended_list_read_parameter_no_color, fss_extended_list_read_parameter_light, fss_extended_list_read_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_extended_list_read_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_extended_list_read_parameter_help].result == f_console_result_found) { @@ -153,7 +153,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_depth].result == f_console_result_found) { @@ -162,7 +162,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) { @@ -171,7 +171,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_name].result == f_console_result_found) { @@ -180,7 +180,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) { @@ -189,7 +189,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_object].result == f_console_result_found) { @@ -201,7 +201,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) { @@ -212,7 +212,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -225,7 +225,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -235,7 +235,7 @@ extern "C" { f_string_length original_size = data->quantity.total; status = fss_extended_list_read_main_preprocess_depth(arguments, *data, &depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; @@ -248,7 +248,7 @@ extern "C" { macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->process_pipe) { @@ -258,8 +258,8 @@ extern "C" { status = f_file_read(file, &data->buffer); - if (f_status_is_error(status)) { - fss_extended_list_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_file_error(data->context, "fl_file_read", "-", F_status_set_fine(status)); macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); @@ -268,7 +268,7 @@ extern "C" { status = fss_extended_list_read_main_process_file(arguments, data, "-", depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; @@ -287,8 +287,8 @@ extern "C" { data->quantity.total = original_size; - if (f_status_is_error(status)) { - fss_extended_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); @@ -298,8 +298,8 @@ extern "C" { if (data->quantity.total == 0) { status = f_file_size_by_id(file.id, &data->quantity.total); - if (f_status_is_error(status)) { - fss_extended_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); } @@ -315,8 +315,8 @@ extern "C" { f_file_close(&file.id); - if (f_status_is_error(status)) { - fss_extended_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); @@ -325,7 +325,7 @@ extern "C" { status = fss_extended_list_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_list_read_depths_delete_simple(depths); fss_extended_list_read_delete_data(data); return status; @@ -341,7 +341,7 @@ extern "C" { } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files."); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } fss_extended_list_read_delete_data(data); @@ -351,7 +351,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_delete_data_ f_return_status fss_extended_list_read_delete_data(fss_extended_list_read_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_extended_list_read_total_parameters) { @@ -367,7 +367,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_extended_list_read_delete_data_ diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index 4f31762..a3fb5b5 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -98,20 +98,20 @@ extern "C" { #define f_console_parameter_initialize_fss_extended_list_read \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_line, fss_extended_list_read_long_line, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_name, fss_extended_list_read_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_object, fss_extended_list_read_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_select, fss_extended_list_read_long_select, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_total, fss_extended_list_read_long_total, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_extended_list_read_short_at, fss_extended_list_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_line, fss_extended_list_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_name, fss_extended_list_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_object, fss_extended_list_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_select, fss_extended_list_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_total, fss_extended_list_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_extended_list_read_total_parameters 14 @@ -137,7 +137,7 @@ extern "C" { f_fss_nest_initialize, \ f_string_quantity_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_extended_list_read_data_ @@ -149,7 +149,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_extended_list_read_print_help_ extern f_return_status fss_extended_list_read_print_help(const fl_color_context context); @@ -166,7 +166,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_list_read_delete_data() @@ -184,7 +184,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_list_read_main() diff --git a/level_3/fss_extended_list_read/c/main.c b/level_3/fss_extended_list_read/c/main.c index 958b83d..100b978 100644 --- a/level_3/fss_extended_list_read/c/main.c +++ b/level_3/fss_extended_list_read/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_extended_list_read_data data = fss_extended_list_read_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_extended_list_read_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } 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 fec3180..942867d 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 @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_file_error_ void fss_extended_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) { + if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_type_error, context.notable, context.reset, "%u", status); fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); @@ -21,40 +21,40 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_number_argument_error_ void fss_extended_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_type_error, context.error, context.reset, "."); } - else if (status == f_number_invalid) { + else if (status == F_number_invalid) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_underflow) { + else if (status == F_number_underflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_negative) { + else if (status == F_number_negative) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_positive) { + else if (status == F_number_positive) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); @@ -63,7 +63,7 @@ extern "C" { fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_no_data) { + else if (status == F_data_not) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); @@ -84,7 +84,7 @@ extern "C" { #ifndef _di_fss_extended_list_read_main_preprocess_depth_ f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_list_read_data data, fss_extended_list_read_depths *depths) { - f_status status = f_none; + f_status status = F_none; { f_array_length depth_size = 1; @@ -94,7 +94,7 @@ extern "C" { } macro_fss_extended_list_read_depths_new(status, (*depths), depth_size); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -122,8 +122,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth); - if (f_status_is_error(status)) { - fss_extended_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_depth, arguments.argv[position_depth], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status)); return status; } } @@ -142,8 +142,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at); - if (f_status_is_error(status)) { - fss_extended_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_at, arguments.argv[depths->array[i].index_at], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status)); return status; } } // for @@ -168,11 +168,11 @@ extern "C" { status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } - if (f_status_is_error(status)) { - f_status status_code = f_status_set_fine(status); + if (F_status_is_error(status)) { + f_status status_code = F_status_set_fine(status); // @todo: move error printing into common function. - if (status_code == f_error_allocation || status_code == f_error_reallocation) { + if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_size) { @@ -202,7 +202,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } @@ -217,7 +217,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); @@ -228,18 +228,18 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } // for - return f_none; + return F_none; } #endif // _di_fss_extended_list_read_main_preprocess_depth_ #ifndef _di_fss_extended_list_read_main_process_file_ f_return_status fss_extended_list_read_main_process_file(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string filename, const fss_extended_list_read_depths depths) { - f_status status = f_none; + f_status status = F_none; { f_string_range input = f_string_range_initialize; @@ -249,25 +249,25 @@ extern "C" { status = fll_fss_extended_list_read(&data->buffer, &input, &data->nest); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()"); fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_incomplete_utf_on_stop) { + else if (status == F_incomplete_utf_stop) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); } - else if (status == f_incomplete_utf_on_eos) { + else if (status == F_incomplete_utf_eos) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); @@ -282,14 +282,14 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - return f_status_set_error(status); + return F_status_set_error(status); } - else if (status == f_no_data_on_stop || status == f_no_data_on_eos) { + else if (status == F_data_no_stop || status == F_data_no_eos) { // Clear buffers, then attempt the next file. f_macro_fss_nest_delete_simple(data->nest); f_macro_string_dynamic_delete_simple(data->buffer); - return f_status_set_warning(status); + return F_status_set_warning(status); } } @@ -297,10 +297,10 @@ extern "C" { if (depths.used > data->nest.used) { if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { fprintf(f_type_output, "0%c", f_string_eol); - return f_none; + return F_none; } - return f_none; + return F_none; } { @@ -309,14 +309,14 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_extended_list_read_parameter_select].additional.array[data->parameters[fss_extended_list_read_parameter_select].additional.used - 1]], &select); - if (f_status_is_error(status)) { - fss_extended_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_select, arguments.argv[data->parameters[fss_extended_list_read_parameter_select].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_select, arguments.argv[data->parameters[fss_extended_list_read_parameter_select].additional.array[0]], F_status_set_fine(status)); return status; } // This standard does not support multiple content groups. if (select > 0) { - return f_none; + return F_none; } } } @@ -326,8 +326,8 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_extended_list_read_parameter_line].additional.array[data->parameters[fss_extended_list_read_parameter_line].additional.used - 1]], &line); - if (f_status_is_error(status)) { - fss_extended_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_line, arguments.argv[data->parameters[fss_extended_list_read_parameter_line].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_list_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_list_read_long_line, arguments.argv[data->parameters[fss_extended_list_read_parameter_line].additional.array[0]], F_status_set_fine(status)); return status; } } @@ -338,13 +338,13 @@ extern "C" { // @todo: handle recursive situations, possibly calling the above block as a separate private function. - return f_none; + return F_none; } #endif // _di_fss_extended_list_read_main_process_file_ #ifndef _di_fss_extended_list_read_main_process_for_depth_ f_return_status fss_extended_list_read_main_process_for_depth(const f_console_arguments arguments, fss_extended_list_read_data *data, const f_string filename, const fss_extended_list_read_depth depth_setting, const f_string_length line) { - f_status status = f_none; + f_status status = F_none; f_fss_items *items = &data->nest.depth[depth_setting.depth]; bool names[items->used]; @@ -357,14 +357,14 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_trim].result == f_console_result_found) { for (f_string_length i = 0; i < items->used; i++) { - if (fl_string_dynamic_partial_compare_trim(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == f_equal_to) { + if (fl_string_dynamic_partial_compare_trim(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) { names[i] = 1; } } // for } else { for (f_string_length i = 0; i < items->used; i++) { - if (fl_string_dynamic_partial_compare(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == f_equal_to) { + if (fl_string_dynamic_partial_compare(data->buffer, depth_setting.value_name, items->array[i].object, value_range) == F_equal_to) { names[i] = 1; } } // for @@ -391,7 +391,7 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); } - return f_none; + return F_none; } else if (depth_setting.index_name > 0) { f_string_length total = 0; @@ -404,12 +404,12 @@ extern "C" { fprintf(f_type_output, "%llu%c", total, f_string_eol); - return f_none; + return F_none; } fprintf(f_type_output, "%llu%c", items->used, f_string_eol); - return f_none; + return F_none; } f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; @@ -424,7 +424,7 @@ extern "C" { fprintf(f_type_output, "%c", f_string_eol); } - return f_none; + return F_none; } for (f_array_length i = 0; i < items->used; i++) { @@ -434,7 +434,7 @@ extern "C" { } } // for - return f_none; + return F_none; } if (depth_setting.index_at > 0) { @@ -443,7 +443,7 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); } - return f_none; + return F_none; } f_array_length at = 0; @@ -470,7 +470,7 @@ extern "C" { fprintf(f_type_output, "%llu%c", total, f_string_eol); } - return f_none; + return F_none; } if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { @@ -522,7 +522,7 @@ extern "C" { } } - return f_none; + return F_none; } if (items->array[i].content.used > 0) { @@ -539,7 +539,7 @@ extern "C" { } } // for - return f_none; + return F_none; } if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { @@ -566,7 +566,7 @@ extern "C" { } // for fprintf(f_type_output, "%llu%c", total, f_string_eol); - return f_none; + return F_none; } if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { @@ -625,7 +625,7 @@ extern "C" { } } // for - return f_none; + return F_none; } for (f_string_length i = 0; i < items->used; i++) { @@ -644,7 +644,7 @@ extern "C" { f_print_string_dynamic_partial(f_type_output, data->buffer, items->array[i].content.array[0]); } // for - return f_none; + return F_none; } #endif // _di_fss_extended_list_read_main_process_for_depth_ diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h index 27d9e8f..9a81b37 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h @@ -79,24 +79,24 @@ extern "C" { #define macro_fss_extended_list_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_list_read_depth, length) #define macro_fss_extended_list_read_depths_delete(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_extended_list_read_depth_delete(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_delete(depths, fss_extended_list_read_depth) + if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_list_read_depth) #define macro_fss_extended_list_read_depths_destroy(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_extended_list_read_depth_destroy(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_destroy(depths, fss_extended_list_read_depth) + if (status == F_none) f_macro_memory_structure_destroy(depths, fss_extended_list_read_depth) #define macro_fss_extended_list_read_depths_delete_simple(depths) \ depths.used = depths.size; \ @@ -115,16 +115,16 @@ extern "C" { if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_extended_list_read_depth) #define macro_fss_extended_list_read_depths_resize(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_extended_list_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -136,16 +136,16 @@ extern "C" { } #define macro_fss_extended_list_read_depths_adjust(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_extended_list_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_list_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -204,8 +204,8 @@ extern "C" { * This stores the pre-processed depth parameters. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_extended_list_read_main_preprocess_depth_ extern f_return_status fss_extended_list_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_list_read_data data, fss_extended_list_read_depths *depths) f_gcc_attribute_visibility_internal; diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index 6dfa479..2fee1ab 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -117,27 +117,27 @@ extern "C" { printf("%c", f_string_eol); - return f_none; + return F_none; } #endif // _di_fss_extended_read_print_help_ #ifndef _di_fss_extended_read_main_ f_return_status fss_extended_read_main(const f_console_arguments arguments, fss_extended_read_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_extended_read_total_parameters }; f_console_parameter_id ids[3] = { fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_extended_read_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_extended_read_parameter_help].result == f_console_result_found) { @@ -153,7 +153,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_depth].result == f_console_result_found) { @@ -162,7 +162,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_found) { @@ -171,7 +171,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_name].result == f_console_result_found) { @@ -180,7 +180,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { @@ -189,7 +189,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_object].result == f_console_result_found) { @@ -201,7 +201,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { @@ -212,7 +212,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -225,7 +225,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } @@ -235,7 +235,7 @@ extern "C" { f_string_length original_size = data->quantity.total; status = fss_extended_read_main_preprocess_depth(arguments, *data, &depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); return status; @@ -249,11 +249,11 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); fss_extended_read_delete_data(data); - return f_none; + return F_none; } fss_extended_read_delete_data(data); - return f_none; + return F_none; } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { @@ -263,7 +263,7 @@ extern "C" { macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } if (data->process_pipe) { @@ -273,8 +273,8 @@ extern "C" { status = f_file_read(file, &data->buffer); - if (f_status_is_error(status)) { - fss_extended_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_file_error(data->context, "fl_file_read", "-", F_status_set_fine(status)); macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); @@ -283,7 +283,7 @@ extern "C" { status = fss_extended_read_main_process_file(arguments, data, "-", depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); return status; @@ -303,8 +303,8 @@ extern "C" { data->quantity.total = original_size; - if (f_status_is_error(status)) { - fss_extended_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); @@ -314,8 +314,8 @@ extern "C" { if (data->quantity.total == 0) { status = f_file_size_by_id(file.id, &data->quantity.total); - if (f_status_is_error(status)) { - fss_extended_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); } @@ -331,8 +331,8 @@ extern "C" { f_file_close(&file.id); - if (f_status_is_error(status)) { - fss_extended_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], F_status_set_fine(status)); macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); @@ -341,7 +341,7 @@ extern "C" { status = fss_extended_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { macro_fss_extended_read_depths_delete_simple(depths); fss_extended_read_delete_data(data); return status; @@ -358,7 +358,7 @@ extern "C" { } else { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files."); - status = f_status_set_error(f_invalid_parameter); + status = F_status_set_error(F_parameter); } fss_extended_read_delete_data(data); @@ -368,7 +368,7 @@ extern "C" { #ifndef _di_fss_extended_read_delete_data_ f_return_status fss_extended_read_delete_data(fss_extended_read_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_extended_read_total_parameters) { @@ -384,7 +384,7 @@ extern "C" { fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_extended_read_delete_data_ diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index b76c105..9915442 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -98,20 +98,20 @@ extern "C" { #define f_console_parameter_initialize_fss_extended_read \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_line, fss_extended_read_long_line, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_name, fss_extended_read_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_object, fss_extended_read_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_select, fss_extended_read_long_select, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_total, fss_extended_read_long_total, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_extended_read_short_at, fss_extended_read_long_at, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_depth, fss_extended_read_long_depth, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_empty, fss_extended_read_long_empty, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_line, fss_extended_read_long_line, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_name, fss_extended_read_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_object, fss_extended_read_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_select, fss_extended_read_long_select, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_total, fss_extended_read_long_total, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_read_short_trim, fss_extended_read_long_trim, 0, F_false, f_console_type_normal), \ } #define fss_extended_read_total_parameters 14 @@ -139,7 +139,7 @@ extern "C" { f_fss_contents_initialize, \ f_string_quantity_initialize, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_extended_read_data_ @@ -151,7 +151,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_extended_read_print_help_ extern f_return_status fss_extended_read_print_help(const fl_color_context context); @@ -168,7 +168,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_read_delete_data() @@ -186,7 +186,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_read_main() diff --git a/level_3/fss_extended_read/c/main.c b/level_3/fss_extended_read/c/main.c index 85576bc..1128053 100644 --- a/level_3/fss_extended_read/c/main.c +++ b/level_3/fss_extended_read/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_extended_read_data data = fss_extended_read_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_extended_read_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } 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 1f874a6..70bc092 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 @@ -8,7 +8,7 @@ extern "C" { #ifndef _di_fss_extended_read_print_file_error_ void fss_extended_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) { - if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) { + if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); fl_color_print(f_type_error, context.notable, context.reset, "%u", status); fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); @@ -21,40 +21,40 @@ extern "C" { #ifndef _di_fss_extended_read_print_number_argument_error_ void fss_extended_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); fl_color_print_line(f_type_error, context.error, context.reset, "."); } - else if (status == f_number_invalid) { + else if (status == F_number_invalid) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_underflow) { + else if (status == F_number_underflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_overflow) { + else if (status == F_number_overflow) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_negative) { + else if (status == F_number_negative) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_number_positive) { + else if (status == F_number_positive) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); @@ -63,7 +63,7 @@ extern "C" { fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "'."); } - else if (status == f_no_data) { + else if (status == F_data_not) { fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); @@ -84,7 +84,7 @@ extern "C" { #ifndef _di_fss_extended_read_main_preprocess_depth_ f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_read_data data, fss_extended_read_depths *depths) { - f_status status = f_none; + f_status status = F_none; { f_array_length depth_size = 1; @@ -94,7 +94,7 @@ extern "C" { } macro_fss_extended_read_depths_new(status, (*depths), depth_size); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -122,8 +122,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth); - if (f_status_is_error(status)) { - fss_extended_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_depth, arguments.argv[position_depth], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status)); return status; } } @@ -142,8 +142,8 @@ extern "C" { status = fl_console_parameter_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at); - if (f_status_is_error(status)) { - fss_extended_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_at, arguments.argv[depths->array[i].index_at], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_number_argument_error(data.context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status)); return status; } } // for @@ -168,11 +168,11 @@ extern "C" { status = fl_string_append(arguments.argv[depths->array[i].index_name], strlen(arguments.argv[depths->array[i].index_name]), &depths->array[i].value_name); } - if (f_status_is_error(status)) { - f_status status_code = f_status_set_fine(status); + if (F_status_is_error(status)) { + f_status status_code = F_status_set_fine(status); // @todo: move error printing into common function. - if (status_code == f_error_allocation || status_code == f_error_reallocation) { + if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_size) { @@ -202,7 +202,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } @@ -217,7 +217,7 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); @@ -228,18 +228,18 @@ extern "C" { fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } } // for } // for - return f_none; + return F_none; } #endif // _di_fss_extended_read_main_preprocess_depth_ #ifndef _di_fss_extended_read_main_process_file_ f_return_status fss_extended_read_main_process_file(const f_console_arguments arguments, fss_extended_read_data *data, const f_string filename, const fss_extended_read_depths depths) { - f_status status = f_none; + f_status status = F_none; { f_string_range input = f_string_range_initialize; @@ -249,25 +249,25 @@ extern "C" { status = fll_fss_extended_read(&data->buffer, &input, &data->objects, &data->contents); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_read()"); fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - else if (status == f_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_incomplete_utf_on_stop) { + else if (status == F_incomplete_utf_stop) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); } - else if (status == f_incomplete_utf_on_eos) { + else if (status == F_incomplete_utf_eos) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); @@ -282,15 +282,15 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); } - return f_status_set_error(status); + return F_status_set_error(status); } - else if (status == f_no_data_on_stop || status == f_no_data_on_eos) { + else if (status == F_data_no_stop || status == F_data_no_eos) { // Clear buffers, then attempt the next file. f_macro_fss_contents_delete_simple(data->contents); f_macro_fss_objects_delete_simple(data->objects); f_macro_string_dynamic_delete_simple(data->buffer); - return f_status_set_warning(status); + return F_status_set_warning(status); } } @@ -299,8 +299,8 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_extended_read_parameter_select].additional.array[data->parameters[fss_extended_read_parameter_select].additional.used - 1]], &select); - if (f_status_is_error(status)) { - fss_extended_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_select, arguments.argv[data->parameters[fss_extended_read_parameter_select].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_select, arguments.argv[data->parameters[fss_extended_read_parameter_select].additional.array[0]], F_status_set_fine(status)); return status; } } @@ -310,8 +310,8 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[fss_extended_read_parameter_line].additional.array[data->parameters[fss_extended_read_parameter_line].additional.used - 1]], &line); - if (f_status_is_error(status)) { - fss_extended_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_line, arguments.argv[data->parameters[fss_extended_read_parameter_line].additional.array[0]], f_status_set_fine(status)); + if (F_status_is_error(status)) { + fss_extended_read_print_number_argument_error(data->context, "fl_console_parameter_to_number_unsigned", fss_extended_read_long_line, arguments.argv[data->parameters[fss_extended_read_parameter_line].additional.array[0]], F_status_set_fine(status)); return status; } } @@ -328,7 +328,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare_trim(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -339,7 +339,7 @@ extern "C" { name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1; if (name_length == depths.array[0].value_name.used) { - if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == f_equal_to) { + if (fl_string_compare(data->buffer.string + data->objects.array[i].start, depths.array[0].value_name.string, name_length, depths.array[0].value_name.used) == F_equal_to) { names[i] = 1; } } @@ -381,7 +381,7 @@ extern "C" { fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol); } - return f_none; + return F_none; } f_return_status (*print_object)(FILE *, const f_string_static, const f_string_range) = &f_print_string_dynamic_partial; @@ -406,7 +406,7 @@ extern "C" { } } // for - return f_none; + return F_none; } for (f_string_length i = 0; i < data->objects.used; i++) { @@ -416,7 +416,7 @@ extern "C" { fprintf(f_type_output, "%c", f_string_eol); } // for - return f_none; + return F_none; } if (depths.array[0].index_at > 0) { @@ -425,7 +425,7 @@ extern "C" { fprintf(f_type_output, "0%c", f_string_eol); } - return f_none; + return F_none; } f_array_length at = 0; @@ -442,7 +442,7 @@ extern "C" { fprintf(f_type_output, "1%c", f_string_eol); } - return f_none; + return F_none; } if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { @@ -480,7 +480,7 @@ extern "C" { } } - return f_none; + return F_none; } if (data->contents.array[i].used > 0) { @@ -522,7 +522,7 @@ extern "C" { } } // for - return f_none; + return F_none; } if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { @@ -541,7 +541,7 @@ extern "C" { } // for fprintf(f_type_output, "%llu%c", total, f_string_eol); - return f_none; + return F_none; } if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { @@ -592,7 +592,7 @@ extern "C" { line_current++; } // for - return f_none; + return F_none; } f_string_length i = 0; @@ -630,7 +630,7 @@ extern "C" { } } // for - return f_none; + return F_none; } #endif // _di_fss_extended_read_main_process_file_ diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.h b/level_3/fss_extended_read/c/private-fss_extended_read.h index c41837c..4e954c6 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.h +++ b/level_3/fss_extended_read/c/private-fss_extended_read.h @@ -79,24 +79,24 @@ extern "C" { #define macro_fss_extended_read_depths_new(status, depths, length) f_macro_memory_structure_new(status, depths, fss_extended_read_depth, length) #define macro_fss_extended_read_depths_delete(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_extended_read_depth_delete(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_delete(depths, fss_extended_read_depth) + if (status == F_none) f_macro_memory_structure_delete(depths, fss_extended_read_depth) #define macro_fss_extended_read_depths_destroy(status, depths) \ - status = f_none; \ + status = F_none; \ depths.used = depths.size; \ while (depths.used > 0) { \ depths.used--; \ macro_fss_extended_read_depth_destroy(status, depths.array[depths.used]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) f_macro_memory_structure_destroy(depths, fss_extended_read_depth) + if (status == F_none) f_macro_memory_structure_destroy(depths, fss_extended_read_depth) #define macro_fss_extended_read_depths_delete_simple(depths) \ depths.used = depths.size; \ @@ -115,16 +115,16 @@ extern "C" { if (depths.used == 0) f_macro_memory_structure_destroy_simple(depths, fss_extended_read_depth) #define macro_fss_extended_read_depths_resize(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_extended_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -136,16 +136,16 @@ extern "C" { } #define macro_fss_extended_read_depths_adjust(status, depths, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < depths.size) { \ f_array_length i = depths.size - new_length; \ for (; i < depths.size; i++) { \ macro_fss_extended_read_depth_delete(status, depths.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & depths.array, sizeof(fss_extended_read_depth), depths.size, new_length); \ + if (status == F_none) { \ if (new_length > depths.size) { \ f_array_length i = depths.size; \ for (; i < new_length; i++) { \ @@ -204,8 +204,8 @@ extern "C" { * This stores the pre-processed depth parameters. * * @return - * f_none on success. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_extended_read_main_preprocess_depth_ extern f_return_status fss_extended_read_main_preprocess_depth(const f_console_arguments arguments, const fss_extended_read_data data, fss_extended_read_depths *depths) f_gcc_attribute_visibility_internal; 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 caeab35..62f53dc 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -23,45 +23,45 @@ extern "C" { fll_program_print_help_usage(context, fss_extended_write_name, ""); - return f_none; + return F_none; } #endif // _di_fss_extended_write_print_help_ #ifndef _di_fss_extended_write_main_ f_return_status fss_extended_write_main(const f_console_arguments arguments, fss_extended_write_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_extended_write_total_parameters }; f_console_parameter_id ids[3] = { fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_extended_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_no_data) { + if (status == F_data_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass."); // TODO: there is a way to identify which parameter is incorrect // 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_error_allocation || status == f_error_reallocation) { + else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); } - else if (status == f_invalid_utf) { + else if (status == F_utf) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling f_console_parameter_process()."); } - else if (status == f_invalid_parameter) { + else if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_console_parameter_process()."); } else { @@ -69,7 +69,7 @@ extern "C" { } fss_extended_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } if (data->parameters[fss_extended_write_parameter_help].result == f_console_result_found) { @@ -93,19 +93,19 @@ extern "C" { status = f_file_read(file, &input); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); } - else if (status == f_file_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); } - else if (status == f_file_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { @@ -114,7 +114,7 @@ extern "C" { f_macro_string_dynamic_delete_simple(input); fss_extended_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } range.start = 0; @@ -123,22 +123,22 @@ extern "C" { if (object) { status = fl_fss_extended_object_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } else { status = fl_fss_extended_content_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_none) { if (buffer.used >= buffer.size) { f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -162,8 +162,8 @@ extern "C" { status = fl_fss_extended_object_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } } else { @@ -178,8 +178,8 @@ extern "C" { status = fl_fss_extended_content_write(input, &range, &buffer); - if (f_status_is_error(status) || status == f_no_data_on_stop || status == f_no_data_on_eos) { - return f_status_set_error(status); + if (F_status_is_error(status) || status == F_data_no_stop || status == F_data_no_eos) { + return F_status_set_error(status); } i++; @@ -189,7 +189,7 @@ extern "C" { if (buffer.used >= buffer.size) { f_macro_string_dynamic_resize(status, buffer, buffer.used + f_fss_default_allocation_step_string); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } } @@ -199,7 +199,7 @@ extern "C" { } } - status = f_none; + status = F_none; } if (data->parameters[fss_extended_write_parameter_file].result == f_console_result_additional) { @@ -209,21 +209,21 @@ extern "C" { status = f_file_open(arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], 0, &output); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); f_file_close(&output.id); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } - else if (status == f_file_not_found) { + else if (status == F_file_found_not) { fl_color_print_line(f_type_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_error_open) { + else if (status == F_file_open) { fl_color_print_line(f_type_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_error_descriptor) { + else if (status == F_file_descriptor) { fl_color_print_line(f_type_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 { @@ -237,13 +237,13 @@ extern "C" { status = f_file_write(output, buffer, 0); f_file_close(&output.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()"); } - else if (status == f_file_error_write) { + else if (status == F_file_write) { fl_color_print_line(f_type_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 { @@ -251,7 +251,7 @@ extern "C" { } fss_extended_write_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } } else { @@ -266,7 +266,7 @@ extern "C" { #ifndef _di_fss_extended_write_delete_data_ f_return_status fss_extended_write_delete_data(fss_extended_write_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < fss_extended_write_total_parameters) { @@ -278,7 +278,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_extended_write_delete_data_ diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index 02eb2c3..88e289b 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -74,15 +74,15 @@ extern "C" { #define f_console_parameter_initialize_fss_extended_write \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_extended_write_short_object, fss_extended_write_long_object, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_file, fss_extended_write_long_file, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_string, fss_extended_write_long_string, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(fss_extended_write_short_partial, fss_extended_write_long_partial, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_extended_write_short_object, fss_extended_write_long_object, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_write_short_file, fss_extended_write_long_file, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_write_short_string, fss_extended_write_long_string, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(fss_extended_write_short_partial, fss_extended_write_long_partial, 0, F_false, f_console_type_normal), \ } #define fss_extended_write_total_parameters 9 @@ -102,7 +102,7 @@ extern "C" { { \ f_console_parameter_initialize_fss_extended_write, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_extended_write_data_ @@ -114,7 +114,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_extended_write_print_help_ extern f_return_status fss_extended_write_print_help(const fl_color_context context); @@ -131,7 +131,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_write_delete_data() @@ -149,7 +149,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_extended_write_main() diff --git a/level_3/fss_extended_write/c/main.c b/level_3/fss_extended_write/c/main.c index 24fc41a..1ddf6f3 100644 --- a/level_3/fss_extended_write/c/main.c +++ b/level_3/fss_extended_write/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_extended_write_data data = fss_extended_write_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_extended_write_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index c485d7a..0224303 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -17,45 +17,45 @@ extern "C" { printf("%c", f_string_eol); - fll_program_print_help_option(context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); - fll_program_print_help_option(context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); - fll_program_print_help_option(context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise."); + fll_program_print_help_option(context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise."); fll_program_print_help_option(context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); fll_program_print_help_usage(context, fss_status_code_name, "status code(s)"); - return f_none; + return F_none; } #endif // _di_fss_status_code_print_help_ #ifndef _di_fss_status_code_main_ f_return_status fss_status_code_main(const f_console_arguments arguments, fss_status_code_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, fss_status_code_total_parameters }; f_console_parameter_id ids[3] = { fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { fss_status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[fss_status_code_parameter_help].result == f_console_result_found) { fss_status_code_print_help(data->context); fss_status_code_delete_data(data); - return f_none; + return F_none; } else if (data->parameters[fss_status_code_parameter_version].result == f_console_result_found) { fll_program_print_version(fss_status_code_version); fss_status_code_delete_data(data); - return f_none; + return F_none; } if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found) { @@ -67,7 +67,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); fss_status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } else if (data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); @@ -77,7 +77,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); fss_status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } } else if (data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found && data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { @@ -88,17 +88,17 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); fss_status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify an error code."); fss_status_code_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } - f_status status2 = f_none; + f_status status2 = F_none; if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found || data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { if (data->process_pipe) { @@ -109,7 +109,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_check(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -124,7 +124,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_number(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -139,7 +139,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = fss_status_code_process_normal(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -164,7 +164,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_fss_status_code_delete_data_ diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index 9cf9eca..5a5dab6 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -76,15 +76,15 @@ extern "C" { #define f_console_parameter_initialize_fss_status_code \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(fss_status_code_short_is_fine, fss_status_code_long_is_fine, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_is_warning, fss_status_code_long_is_warning, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_is_error, fss_status_code_long_is_error, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(fss_status_code_short_number, fss_status_code_long_number, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(fss_status_code_short_is_fine, fss_status_code_long_is_fine, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_status_code_short_is_warning, fss_status_code_long_is_warning, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_status_code_short_is_error, fss_status_code_long_is_error, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(fss_status_code_short_number, fss_status_code_long_number, 0, F_false, f_console_type_normal), \ } #define fss_status_code_total_parameters 9 @@ -104,7 +104,7 @@ extern "C" { { \ f_console_parameter_initialize_fss_status_code, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_fss_status_code_data_ @@ -116,7 +116,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_fss_status_code_print_help_ extern f_return_status fss_status_code_print_help(const fl_color_context context); @@ -133,7 +133,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_status_code_delete_data() @@ -151,7 +151,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see fss_status_code_main() diff --git a/level_3/fss_status_code/c/main.c b/level_3/fss_status_code/c/main.c index f7ef4e2..1b60f70 100644 --- a/level_3/fss_status_code/c/main.c +++ b/level_3/fss_status_code/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { fss_status_code_data data = fss_status_code_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = fss_status_code_main(arguments, &data); - if (f_status_is_error(status) || status == f_false) { + if (F_status_is_error(status) || status == F_false) { return 1; } 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 9ac19aa..abe027d 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 @@ -10,12 +10,12 @@ extern "C" { f_number_unsigned number = 0; f_status status = fss_status_code_convert_number(data, value, &number); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (data.parameters[fss_status_code_parameter_is_error].result == f_console_result_found) { - if (f_status_is_error(number)) { + if (F_status_is_error(number)) { printf("%s\n", fl_status_string_true); } else { @@ -23,7 +23,7 @@ extern "C" { } } else if (data.parameters[fss_status_code_parameter_is_warning].result == f_console_result_found) { - if (f_status_is_warning(number)) { + if (F_status_is_warning(number)) { printf("%s\n", fl_status_string_true); } else { @@ -31,7 +31,7 @@ extern "C" { } } else if (data.parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { - if (f_status_is_fine(number)) { + if (F_status_is_fine(number)) { printf("%s\n", fl_status_string_true); } else { @@ -39,43 +39,43 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_fss_status_code_process_check_ #ifndef _di_fss_status_code_process_number_ f_return_status fss_status_code_process_number(const fss_status_code_data data, const f_string value) { - f_status status = f_none; + f_status status = F_none; { f_number_unsigned number = 0; status = fl_console_parameter_to_number_unsigned(value, &number); - if (status == f_none) { + if (status == F_none) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid name"); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } - if (status == f_no_data || f_status_set_fine(status) == f_invalid_parameter) { + if (status == F_data_not || F_status_set_fine(status) == F_parameter) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data"); return status; } } - f_status code = f_none; + f_status code = F_none; status = fll_fss_status_from_string(value, &code); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_invalid_data) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_data) { status = fll_status_from_string(value, &code); } - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_invalid_data) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_data) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown name"); } else { @@ -86,15 +86,15 @@ extern "C" { } } - if (status == f_invalid_data) { + if (status == F_data) { fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code"); - return f_none; + return F_none; } printf("%u\n", code); - return f_none; + return F_none; } #endif // _di_fss_status_code_process_number_ @@ -103,7 +103,7 @@ extern "C" { f_number_unsigned number = 0; f_status status = fss_status_code_convert_number(data, value, &number); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } @@ -112,8 +112,8 @@ extern "C" { status = fll_fss_status_to_string(code, &string); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_invalid_data) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_data) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown code"); } else { @@ -125,7 +125,7 @@ extern "C" { printf("%s\n", string); - return f_none; + return F_none; } #endif // _di_fss_status_code_process_normal_ @@ -133,14 +133,14 @@ extern "C" { f_return_status fss_status_code_convert_number(const fss_status_code_data data, const f_string value, f_number_unsigned *number) { f_status status = fl_console_parameter_to_number_unsigned(value, number); - if (*number > f_status_size_max_with_signal) { + if (*number > F_status_size_max_with_signal) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); return status; } - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_number_negative) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_number_negative) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); } else { @@ -150,7 +150,7 @@ extern "C" { return status; } - return f_none; + return F_none; } #endif // _di_fss_status_code_convert_number_ 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 1c8f109..a0bc359 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 @@ -21,13 +21,13 @@ extern "C" { * The parameter value to process. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status fss_status_code_process_check(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -42,9 +42,9 @@ extern "C" { * The parameter value to process. * * @return - * f_none on success. - * f_no_data (with error bit) if string is empty. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not (with error bit) if string is empty. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fss_status_code_process_number_ extern f_return_status fss_status_code_process_number(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -59,13 +59,13 @@ extern "C" { * The parameter value to process. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status fss_status_code_process_normal(const fss_status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -83,13 +83,13 @@ extern "C" { * Will not be updated on error. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status fss_status_code_convert_number(const fss_status_code_data data, const f_string value, f_number_unsigned *number) f_gcc_attribute_visibility_internal; diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index d745226..14ed153 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -16,7 +16,7 @@ extern "C" { f_return_status init_print_version(const init_data data) { printf("%s\n", init_version); - return f_none; + return F_none; } #endif // _di_init_print_version_ @@ -38,33 +38,33 @@ extern "C" { fll_program_print_help_usage(context, init_name, ""); - return f_none; + return F_none; } #endif // _di_init_print_help_ #ifndef _di_init_main_ f_return_status init_main(const f_console_arguments arguments, init_data *data) { - f_status status = f_none; + f_status status = F_none; int8_t run_level[init_kernel_runlevel_buffer]; memset(run_level, 0, init_kernel_runlevel_buffer); - unsigned short do_socket_file = f_true; - unsigned short do_socket_port = f_false; + unsigned short do_socket_file = F_true; + unsigned short do_socket_port = F_false; { f_console_parameters parameters = { data->parameters, init_total_parameters }; f_console_parameter_id ids[3] = { init_parameter_no_color, init_parameter_light, init_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // @todo: init_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[init_parameter_runlevel].result == f_console_result_found) { @@ -106,7 +106,7 @@ extern "C" { init_stack_memory stack_memory = init_stack_memory_initialize; //status = init_initialize_stack_memory(&stack_memory); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { // @todo: init_delete_data((*data)); // @todo: init_delete_stack_memory(&stack_memory); return status; diff --git a/level_3/init/c/init.h b/level_3/init/c/init.h index a9413f2..d2b9ceb 100644 --- a/level_3/init/c/init.h +++ b/level_3/init/c/init.h @@ -189,27 +189,27 @@ extern "C" { #ifdef _en_init_debug_ #define f_console_parameter_initialize_init \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, f_true, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_debug, f_console_standard_long_debug, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ } #define init_total_parameters 8 #else #define f_console_parameter_initialize_init \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, f_true, f_console_type_normal), \ - f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, f_true, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, 0, F_true, f_console_type_normal), \ + f_console_parameter_initialize(init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, 0, F_true, f_console_type_normal), \ } #define init_total_parameters 7 @@ -230,7 +230,7 @@ extern "C" { { \ f_console_parameter_initialize_init, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } @@ -282,7 +282,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_init_print_help_ extern f_return_status init_print_help(const fl_color_context context); @@ -297,7 +297,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_init_main_ @@ -313,7 +313,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. */ #ifndef _di_init_main_ diff --git a/level_3/init/c/main.c b/level_3/init/c/main.c index c1bcfd1..ea96142 100644 --- a/level_3/init/c/main.c +++ b/level_3/init/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { init_data data = init_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = init_main(arguments, &data); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return 1; } diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 97dcdc1..aa41851 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -7,35 +7,35 @@ #ifndef _di_init_rule_buffer_ f_return_status init_rule_buffer(const init_data data, const f_string filename, f_string_dynamic *buffer, f_fss_objects *objects, f_fss_contents *contents) { f_file file = f_file_initialize; - f_status status = f_none; + f_status status = F_none; f_string_quantity quantity = f_string_quantity_initialize; status = f_file_open(filename, 0, 0, &file); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); if (optional) { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_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_error_open && status != f_file_error_descriptor) { + } else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } else { - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); - } else if (status == f_file_not_found) { + } else if (status == F_file_found_not) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to find the file '%s'.", filename); - } else if (status == f_file_error_open) { + } else if (status == F_file_open) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%s'.", filename); - } else if (status == f_file_error_descriptor) { + } else if (status == F_file_descriptor) { fl_color_print_line(f_type_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_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } - return f_status_set_error(status); + return F_status_set_error(status); } f_macro_file_reset_position(quantity, file) @@ -45,26 +45,26 @@ f_file_close(&file.id); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until()."); - } else if (status == f_number_overflow) { + } else if (status == F_number_overflow) { fl_color_print_line(f_type_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) { + } else if (status == F_file_open_not) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); - } else if (status == f_file_error_seek) { + } else if (status == F_file_seek) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); - } else if (status == f_file_error_read) { + } else if (status == F_file_read) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); - } else if (status == f_error_allocation || status == f_error_reallocation) { + } else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().", status); } - return f_status_set_error(status); + return F_status_set_error(status); } else { f_string_range input = f_string_range_initialize; @@ -73,20 +73,20 @@ status = fll_fss_basic_list_read(buffer, &input, objects, contents); } - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_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) { + } else if (status == F_data_no_eos || status == F_data_not || status == F_data_no_stop) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); - } else if (status == f_error_allocation || status == f_error_reallocation) { + } else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); } - return f_status_set_error(status); + return F_status_set_error(status); } return status; @@ -95,20 +95,20 @@ #ifndef _di_init_rules_process_main_ f_return_status init_rules_process_main(const init_data data, const f_string filename, f_string_dynamic *buffer, f_fss_objects *objects, f_fss_contents *contents) { - f_status status = f_none; + f_status status = F_none; // @todo: resume replacing code below. status = fll_fss_extended_read(&buffer, input, &local->rule_objects, &local->rule_contents); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { //status = init_perform_commands(*local, *data); // @fixme - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } else if (status == f_failure) { + } else if (status == F_failure) { // the error message has already been displayed. } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); @@ -116,7 +116,7 @@ f_macro_fss_objects_delete_simple(local->rule_objects); f_macro_fss_contents_delete_simple(local->rule_contents); - return f_status_set_error(status); + return F_status_set_error(status); } } @@ -132,7 +132,7 @@ // load and process rules. - return f_none; + return F_none; } #endif // _di_init_handler_child_services_ @@ -140,7 +140,7 @@ f_return_status init_handler_child_control_file(void *data) { init_local_data *local_data = (init_local_data *) data; - return f_none; + return F_none; } #endif // _di_init_handler_child_control_file_ @@ -150,27 +150,27 @@ stack_memory->control_file = mmap(0, init_stack_size_small_control_file, init_stack_protections, init_stack_flags, -1, 0); if (stack_memory->services == (void *) -1) { - return f_failure; + return F_failure; } if (stack_memory->control_file == (void *) -1) { - return f_failure; + return F_failure; } - return f_none; + return F_none; } #endif // _di_init_initialize_stack_memory_ #ifndef _di_init_delete_stack_memory_ f_return_status init_delete_stack_memory(init_stack_memory *stack_memory) { - f_status status = f_none; + f_status status = F_none; if (stack_memory->services > 0) { if (munmap(stack_memory->services, 0) >= 0) { stack_memory->services = 0; } else { - status = f_failure; + status = F_failure; } } @@ -179,7 +179,7 @@ stack_memory->control_file = 0; } else { - status = f_failure; + status = F_failure; } } @@ -189,7 +189,7 @@ #ifndef _di_init_prepare_system_ f_return_status init_prepare_system(int8_t *run_level) { - f_status status = f_none; + f_status status = F_none; f_stat stat; memset(&stat, 0, sizeof(f_stat)); @@ -198,7 +198,7 @@ // create the required directories if they do not already exist and then perform appropriate mount. status = f_file_stat(init_paths_devices, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_devices); memset(&stat, 0, sizeof(f_stat)); } @@ -207,7 +207,7 @@ status = f_file_stat(init_paths_system, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_system); memset(&stat, 0, sizeof(f_stat)); } @@ -216,7 +216,7 @@ status = f_file_stat(init_paths_devices_pts, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_devices_pts); memset(&stat, 0, sizeof(f_stat)); } @@ -225,7 +225,7 @@ status = f_file_stat(init_paths_log, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_log); memset(&stat, 0, sizeof(f_stat)); } @@ -234,7 +234,7 @@ status = f_file_stat(var_run_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " var_run_path); memset(&stat, 0, sizeof(f_stat)); } @@ -243,7 +243,7 @@ status = f_file_stat(mnt_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " mnt_path); memset(&stat, 0, sizeof(f_stat)); } @@ -252,7 +252,7 @@ status = f_file_stat(tmp_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " tmp_path); memset(&stat, 0, sizeof(f_stat)); } @@ -261,7 +261,7 @@ status = f_file_stat(init_paths_processes, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_processes); memset(&stat, 0, sizeof(f_stat)); } @@ -270,7 +270,7 @@ // doing this also allows for unusual circumstances where the kernel command line is not mounted but a custom kernel command line is statically provided. status = f_file_stat(init_kernel_command_line, &stat); - if (status == f_file_not_found) { + if (status == F_file_found_not) { system(init_program_mount " " init_paths_processes); } @@ -323,18 +323,18 @@ } if (kernel_command_line_string) { - f_status status_free = f_none; + f_status status_free = F_none; f_macro_string_delete(status_free, kernel_command_line_string, string_length); } } - return f_none; + return F_none; } #endif // _di_init_prepare_system_ #ifndef _di_init_prepare_system_ f_return_status init_prepare_system() { - f_status status = f_none; + f_status status = F_none; f_stat stat; memset(&stat, 0, sizeof(f_stat)); @@ -345,7 +345,7 @@ // create the required directories if they do not already exist and then perform appropriate mount. status = f_file_stat(init_paths_devices, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_devices); memset(&stat, 0, sizeof(f_stat)); } @@ -354,7 +354,7 @@ status = f_file_stat(init_paths_system, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_system); memset(&stat, 0, sizeof(f_stat)); } @@ -363,7 +363,7 @@ status = f_file_stat(init_paths_devices_pts, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_devices_pts); memset(&stat, 0, sizeof(f_stat)); } @@ -372,7 +372,7 @@ status = f_file_stat(init_paths_log, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_log); memset(&stat, 0, sizeof(f_stat)); } @@ -381,7 +381,7 @@ status = f_file_stat(var_run_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " var_run_path); memset(&stat, 0, sizeof(f_stat)); } @@ -390,7 +390,7 @@ status = f_file_stat(mnt_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " mnt_path); memset(&stat, 0, sizeof(f_stat)); } @@ -399,7 +399,7 @@ status = f_file_stat(tmp_path, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " tmp_path); memset(&stat, 0, sizeof(f_stat)); } @@ -419,7 +419,7 @@ system(init_program_chgrp " " init_group_process_random " " init_path_device_random); system(init_program_chgrp " " init_group_process_urandom " " init_path_device_urandom); - return f_none; + return F_none; } #endif // _di_init_prepare_system_ @@ -435,7 +435,7 @@ status = f_file_stat(init_paths_init_run, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_init_run); system(init_program_chgrp " " init_group_init_run " " init_paths_init_run); memset(&stat, 0, sizeof(f_stat)); @@ -443,7 +443,7 @@ status = f_file_stat(init_paths_init_settings, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_init_settings); system(init_program_chgrp " " init_group_init_settings " " init_paths_init_settings); memset(&stat, 0, sizeof(f_stat)); @@ -451,7 +451,7 @@ status = f_file_stat(init_paths_init_socket, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_init_socket); system(init_program_chgrp " " init_group_init_socket " " init_paths_init_socket); memset(&stat, 0, sizeof(f_stat)); @@ -459,7 +459,7 @@ status = f_file_stat(init_paths_init_process, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_init_process); system(init_program_chgrp " " init_group_init_process " " init_paths_init_process); memset(&stat, 0, sizeof(f_stat)); @@ -467,7 +467,7 @@ status = f_file_stat(init_paths_init_log, &stat); - if (status == f_file_not_found || status == f_status_set_error(f_invalid_directory)) { + if (status == F_file_found_not || status == F_status_set_error(F_directory)) { system(init_program_mkdir " -p " init_paths_init_log); system(init_program_chgrp " " init_group_init_log " " init_paths_init_log); memset(&stat, 0, sizeof(f_stat)); @@ -475,13 +475,13 @@ memset(&stat, 0, sizeof(f_stat)); - return f_none; + return F_none; } #endif // _di_init_prepare_init_ #ifndef _di_init_process_main_rule_ f_return_status init_process_main_rule(const init_data data, f_string_dynamic *buffer, init_data *settings) { - f_status status = f_none; + f_status status = F_none; f_string_dynamic buffer = f_string_dynamic_initialize; f_string_range range = f_string_range_initialize; f_fss_objects objects = f_fss_objects_initialize; @@ -491,14 +491,14 @@ // load the main file into memory. status = init_rule_buffer(&data, init_rule_core_file, &buffer, &objects, &contents); - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_invalid_parameter) { + if (status == F_parameter) { fl_color_print_line(f_type_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) { + } else if (status == F_data_no_eos || status == F_data_not || status == F_data_no_stop) { fl_color_print_line(f_type_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_error_allocation || status == f_error_reallocation) { + } else if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file); @@ -524,8 +524,8 @@ /* status = fll_fss_extended_read(&buffer, &location, &objects, &contents); - if (f_status_is_error(status_process)) { - if (status == f_error_allocation || status == f_error_reallocation) { + if (F_status_is_error(status_process)) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { @@ -540,20 +540,20 @@ /* - f_status status = f_none; + f_status status = F_none; status = fll_fss_extended_read(buffer, location, objects, contents); - if (f_status_is_not_error(status)) { + if (F_status_is_not_error(status)) { // @todo: process objects and contents. // execute individual processes. - if (f_status_is_error(status)) { - status = f_status_set_fine(status); + if (F_status_is_error(status)) { + status = F_status_set_fine(status); - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, data.context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); - } else if (status == f_failure) { + } else if (status == F_failure) { // the error message has already been displayed. } else { fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); @@ -561,11 +561,11 @@ f_macro_fss_objects_delete_simple((*rule_objects)); f_macro_fss_contents_delete_simple((*rule_contents)); - return f_status_set_error(status); + return F_status_set_error(status); } } else { - if (status == f_error_allocation || status == f_error_reallocation) { + if (status == F_memory_allocation || status == F_memory_reallocation) { fl_color_print_line(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); } else { diff --git a/level_3/init/c/private-init.h b/level_3/init/c/private-init.h index 1115306..967039e 100644 --- a/level_3/init/c/private-init.h +++ b/level_3/init/c/private-init.h @@ -45,32 +45,32 @@ extern "C" { f_string_dynamic_initialize, \ f_string_dynamic_initialize, \ f_string_dynamic_initialize, \ - f_false, \ - f_false, \ + F_false, \ + F_false, \ } #define delete_init_rule(status, rule) \ f_macro_string_dynamic_delete(status, rule.name); \ - if (status == f_none) { \ + if (status == F_none) { \ f_macro_string_dynamic_delete(status, rule.directory); \ } \ - if (status == f_none) { \ + if (status == F_none) { \ f_macro_string_dynamic_delete(status, rule.address); \ } \ - if (status == f_none) { \ + if (status == F_none) { \ rule.require = 0; \ rule.asynchronous = 0; \ } #define destroy_init_rule(status, rule) \ f_macro_string_dynamic_destroy(status, rule.name); \ - if (status == f_none) { \ + if (status == F_none) { \ f_macro_string_dynamic_destroy(status, rule.directory); \ } \ - if (status == f_none) { \ + if (status == F_none) { \ f_macro_string_dynamic_destroy(status, rule.address); \ } \ - if (status == f_none) { \ + if (status == F_none) { \ rule.require = 0; \ rule.asynchronous = 0; \ } @@ -87,36 +87,36 @@ extern "C" { #define init_rules_initialize { 0, 0, 0 } #define f_init_rules_delete(status, rules) \ - status = f_none; \ + status = F_none; \ while (rules.size > 0) { \ --rules.size; \ delete_init_rule(status, rules.array[rules.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & rules.array, sizeof(init_rule), rules.size); \ - if (status == f_none) rules.used = 0; + if (status == F_none) status = f_memory_delete((void **) & rules.array, sizeof(init_rule), rules.size); \ + if (status == F_none) rules.used = 0; #define f_init_rules_destroy(status, rules) \ - status = f_none; \ + status = F_none; \ while (rules.size > 0) { \ --rules.size; \ destroy_init_rule(status, rules.array[rules.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & rules.array, sizeof(init_rule), rules.size); \ - if (status == f_none) rules.used = 0; + if (status == F_none) status = f_memory_destroy((void **) & rules.array, sizeof(init_rule), rules.size); \ + if (status == F_none) rules.used = 0; #define f_init_rules_resize(status, rules, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < rules.size) { \ f_string_length i = rules.size - new_length; \ for (; i < rules.size; i++) { \ delete_init_rule(status, rules.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ + if (status == F_none) { \ if (new_length > rules.size) { \ f_string_length i = rules.size; \ for (; i < new_length; i++) { \ @@ -128,16 +128,16 @@ extern "C" { } #define f_init_rules_adjust(status, rules, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < rules.size) { \ f_string_length i = rules.size - new_length; \ for (; i < rules.size; i++) { \ destroy_init_rule(status, rules.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & rules.array, sizeof(init_rule), rules.size, new_length); \ + if (status == F_none) { \ if (new_length > rules.size) { \ f_string_length i = rules.size; \ for (; i < new_length; i++) { \ @@ -164,13 +164,13 @@ extern "C" { #define delete_init_category(status, category) \ f_macro_string_dynamic_delete(status, category.name); \ - if (status == f_none) { \ + if (status == F_none) { \ delete_init_rule(status, category.last); \ } #define destroy_init_category(status, category) \ f_macro_string_dynamic_destroy(status, category.name); \ - if (status == f_none) { \ + if (status == F_none) { \ destroy_init_rule(status, category.last); \ } #endif // _di_init_category_ @@ -187,36 +187,36 @@ extern "C" { #define init_categorys_initialize { 0, 0, 0 } #define f_init_categorys_delete(status, categorys) \ - status = f_none; \ + status = F_none; \ while (categorys.size > 0) { \ --categorys.size; \ delete_init_category(status, categorys.array[categorys.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_delete((void **) & categorys.array, sizeof(init_category), categorys.size); \ - if (status == f_none) categorys.used = 0; + if (status == F_none) status = f_memory_delete((void **) & categorys.array, sizeof(init_category), categorys.size); \ + if (status == F_none) categorys.used = 0; #define f_init_categorys_destroy(status, categorys) \ - status = f_none; \ + status = F_none; \ while (categorys.size > 0) { \ --categorys.size; \ destroy_init_category(status, categorys.array[categorys.size]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ - if (status == f_none) status = f_memory_destroy((void **) & categorys.array, sizeof(init_category), categorys.size); \ - if (status == f_none) categorys.used = 0; + if (status == F_none) status = f_memory_destroy((void **) & categorys.array, sizeof(init_category), categorys.size); \ + if (status == F_none) categorys.used = 0; #define f_init_categorys_resize(status, categorys, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < categorys.size) { \ f_string_length i = categorys.size - new_length; \ for (; i < categorys.size; i++) { \ delete_init_category(status, categorys.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_resize((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_resize((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ + if (status == F_none) { \ if (new_length > categorys.size) { \ f_string_length i = categorys.size; \ for (; i < new_length; i++) { \ @@ -228,16 +228,16 @@ extern "C" { } #define f_init_categorys_adjust(status, categorys, new_length) \ - status = f_none; \ + status = F_none; \ if (new_length < categorys.size) { \ f_string_length i = categorys.size - new_length; \ for (; i < categorys.size; i++) { \ destroy_init_category(status, categorys.array[i]); \ - if (status != f_none) break; \ + if (status != F_none) break; \ } \ } \ - if (status == f_none) status = f_memory_adjust((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ - if (status == f_none) { \ + if (status == F_none) status = f_memory_adjust((void **) & categorys.array, sizeof(init_category), categorys.size, new_length); \ + if (status == F_none) { \ if (new_length > categorys.size) { \ f_string_length i = categorys.size; \ for (; i < new_length; i++) { \ diff --git a/level_3/status_code/c/main.c b/level_3/status_code/c/main.c index ad0a6e2..2c2f4d0 100644 --- a/level_3/status_code/c/main.c +++ b/level_3/status_code/c/main.c @@ -5,12 +5,12 @@ int main(const unsigned long argc, const f_string *argv) { status_code_data data = status_code_data_initialize; if (f_pipe_input_exists()) { - data.process_pipe = f_true; + data.process_pipe = F_true; } f_status status = status_code_main(arguments, &data); - if (f_status_is_error(status) || status == f_false) { + if (F_status_is_error(status) || status == F_false) { return 1; } diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index 2c81ed7..577e3d4 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -10,12 +10,12 @@ extern "C" { f_number_unsigned number = 0; f_status status = status_code_convert_number(data, value, &number); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } if (data.parameters[status_code_parameter_is_error].result == f_console_result_found) { - if (f_status_is_error(number)) { + if (F_status_is_error(number)) { printf("%s\n", fl_status_string_true); } else { @@ -23,7 +23,7 @@ extern "C" { } } else if (data.parameters[status_code_parameter_is_warning].result == f_console_result_found) { - if (f_status_is_warning(number)) { + if (F_status_is_warning(number)) { printf("%s\n", fl_status_string_true); } else { @@ -31,7 +31,7 @@ extern "C" { } } else if (data.parameters[status_code_parameter_is_fine].result == f_console_result_found) { - if (f_status_is_fine(number)) { + if (F_status_is_fine(number)) { printf("%s\n", fl_status_string_true); } else { @@ -39,38 +39,38 @@ extern "C" { } } - return f_none; + return F_none; } #endif // _di_status_code_process_check_ #ifndef _di_status_code_process_number_ f_return_status status_code_process_number(const status_code_data data, const f_string value) { - f_status status = f_none; + f_status status = F_none; { f_number_unsigned number = 0; status = fl_console_parameter_to_number_unsigned(value, &number); - if (status == f_none) { + if (status == F_none) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid name"); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } - if (status == f_no_data || f_status_set_fine(status) == f_invalid_parameter) { + if (status == F_data_not || F_status_set_fine(status) == F_parameter) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data"); return status; } } - f_status code = f_none; + f_status code = F_none; status = fll_status_from_string(value, &code); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_invalid_data) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_data) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown name"); } else { @@ -80,15 +80,15 @@ extern "C" { return status; } - if (status == f_invalid_data) { + if (status == F_data) { fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code"); - return f_none; + return F_none; } printf("%u\n", code); - return f_none; + return F_none; } #endif // _di_status_code_process_number_ @@ -97,7 +97,7 @@ extern "C" { f_number_unsigned number = 0; f_status status = status_code_convert_number(data, value, &number); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { return status; } @@ -106,8 +106,8 @@ extern "C" { status = fl_status_to_string(code, &string); - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_invalid_data) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_data) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown code"); } else { @@ -119,7 +119,7 @@ extern "C" { printf("%s\n", string); - return f_none; + return F_none; } #endif // _di_status_code_process_normal_ @@ -127,14 +127,14 @@ extern "C" { f_return_status status_code_convert_number(const status_code_data data, const f_string value, f_number_unsigned *number) { f_status status = fl_console_parameter_to_number_unsigned(value, number); - if (*number > f_status_size_max_with_signal) { + if (*number > F_status_size_max_with_signal) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); return status; } - if (f_status_is_error(status)) { - if (f_status_set_fine(status) == f_number_negative) { + if (F_status_is_error(status)) { + if (F_status_set_fine(status) == F_number_negative) { fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); } else { @@ -144,7 +144,7 @@ extern "C" { return status; } - return f_none; + return F_none; } #endif // _di_status_code_convert_number_ diff --git a/level_3/status_code/c/private-status_code.h b/level_3/status_code/c/private-status_code.h index f06baf7..a185d15 100644 --- a/level_3/status_code/c/private-status_code.h +++ b/level_3/status_code/c/private-status_code.h @@ -21,13 +21,13 @@ extern "C" { * The parameter value to process. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status status_code_process_check(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -42,9 +42,9 @@ extern "C" { * The parameter value to process. * * @return - * f_none on success. - * f_no_data (with error bit) if string is empty. - * f_invalid_parameter (with error bit) if a parameter is invalid. + * F_none on success. + * F_data_not (with error bit) if string is empty. + * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_status_code_process_number_ extern f_return_status status_code_process_number(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -59,13 +59,13 @@ extern "C" { * The parameter value to process. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status status_code_process_normal(const status_code_data data, const f_string value) f_gcc_attribute_visibility_internal; @@ -83,13 +83,13 @@ extern "C" { * Will not be updated on error. * * @return - * 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_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. + * F_none on success. + * F_data_not (with error bit) if string starts wth a null (length is 0). + * F_parameter (with error bit) if a parameter is invalid. + * F_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_ extern f_return_status status_code_convert_number(const status_code_data data, const f_string value, f_number_unsigned *number) f_gcc_attribute_visibility_internal; diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 6ff0b7e..eb48be6 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -17,45 +17,45 @@ extern "C" { printf("%c", f_string_eol); - fll_program_print_help_option(context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is not an error, f_false otherwise."); - fll_program_print_help_option(context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print f_true if the error code is a warning, f_false otherwise."); - fll_program_print_help_option(context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print f_true if the error code is an error, f_false otherwise."); + fll_program_print_help_option(context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise."); + fll_program_print_help_option(context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise."); + fll_program_print_help_option(context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise."); fll_program_print_help_option(context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number."); fll_program_print_help_usage(context, status_code_name, "status code(s)"); - return f_none; + return F_none; } #endif // _di_status_code_print_help_ #ifndef _di_status_code_main_ f_return_status status_code_main(const f_console_arguments arguments, status_code_data *data) { - f_status status = f_none; + f_status status = F_none; { f_console_parameters parameters = { data->parameters, status_code_total_parameters }; f_console_parameter_id ids[3] = { status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark }; f_console_parameter_ids choices = { ids, 3 }; - status = fll_program_parameter_process(arguments, parameters, choices, f_true, &data->remaining, &data->context); + status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - if (f_status_is_error(status)) { + if (F_status_is_error(status)) { status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } - status = f_none; + status = F_none; } if (data->parameters[status_code_parameter_help].result == f_console_result_found) { status_code_print_help(data->context); status_code_delete_data(data); - return f_none; + return F_none; } else if (data->parameters[status_code_parameter_version].result == f_console_result_found) { fll_program_print_version(status_code_version); status_code_delete_data(data); - return f_none; + return F_none; } if (data->parameters[status_code_parameter_is_error].result == f_console_result_found) { @@ -67,7 +67,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } else if (data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); @@ -77,7 +77,7 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } } else if (data->parameters[status_code_parameter_is_warning].result == f_console_result_found && data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { @@ -88,17 +88,17 @@ extern "C" { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); status_code_delete_data(data); - return f_status_set_error(status); + return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify a status code."); status_code_delete_data(data); - return f_status_set_error(f_invalid_parameter); + return F_status_set_error(F_parameter); } - f_status status2 = f_none; + f_status status2 = F_none; if (data->parameters[status_code_parameter_is_error].result == f_console_result_found || data->parameters[status_code_parameter_is_warning].result == f_console_result_found || data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { if (data->process_pipe) { @@ -109,7 +109,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = status_code_process_check(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -124,7 +124,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = status_code_process_number(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -139,7 +139,7 @@ extern "C" { for (f_array_length i = 0; i < data->remaining.used; i++) { status2 = status_code_process_normal(*data, arguments.argv[data->remaining.array[i]]); - if (f_status_is_error(status2) && status == f_none) { + if (F_status_is_error(status2) && status == F_none) { status = status2; } } // for @@ -153,7 +153,7 @@ extern "C" { #ifndef _di_status_code_delete_data_ f_return_status status_code_delete_data(status_code_data *data) { - f_status status = f_none; + f_status status = F_none; f_string_length i = 0; while (i < status_code_total_parameters) { @@ -165,7 +165,7 @@ extern "C" { f_macro_string_lengths_delete_simple(data->remaining); fl_macro_color_context_delete_simple(data->context); - return f_none; + return F_none; } #endif // _di_status_code_delete_data_ diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index 19f7d77..b91a5a8 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -75,15 +75,15 @@ extern "C" { #define f_console_parameter_initialize_status_code \ { \ - f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, f_false, f_console_type_inverse), \ - f_console_parameter_initialize(status_code_short_is_fine, status_code_long_is_fine, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_is_warning, status_code_long_is_warning, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_is_error, status_code_long_is_error, 0, f_false, f_console_type_normal), \ - f_console_parameter_initialize(status_code_short_number, status_code_long_number, 0, f_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_help, f_console_standard_long_help, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(f_console_standard_short_light, f_console_standard_long_light, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_dark, f_console_standard_long_dark, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_no_color, f_console_standard_long_no_color, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(f_console_standard_short_version, f_console_standard_long_version, 0, F_false, f_console_type_inverse), \ + f_console_parameter_initialize(status_code_short_is_fine, status_code_long_is_fine, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(status_code_short_is_warning, status_code_long_is_warning, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(status_code_short_is_error, status_code_long_is_error, 0, F_false, f_console_type_normal), \ + f_console_parameter_initialize(status_code_short_number, status_code_long_number, 0, F_false, f_console_type_normal), \ } #define status_code_total_parameters 9 @@ -103,7 +103,7 @@ extern "C" { { \ f_console_parameter_initialize_status_code, \ f_string_lengths_initialize, \ - f_false, \ + F_false, \ fl_color_context_initialize, \ } #endif // _di_status_code_data_ @@ -115,7 +115,7 @@ extern "C" { * The color context settings. * * @return - * f_none on success. + * F_none on success. */ #ifndef _di_status_code_print_help_ extern f_return_status status_code_print_help(const fl_color_context context); @@ -132,7 +132,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see status_code_delete_data() @@ -150,7 +150,7 @@ extern "C" { * The program data. * * @return - * f_none on success. + * F_none on success. * Status codes (with error bit) are returned on any problem. * * @see status_code_main()