From: Kevin Day Date: Sat, 16 Nov 2019 04:58:13 +0000 (-0600) Subject: Update: status code tweaks, including setting fl_fss_status_code_first as different... X-Git-Tag: 0.5.0~383 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=aa2e0dd135aa629727d8b19fbc066b44f6360102;p=fll Update: status code tweaks, including setting fl_fss_status_code_first as different from f_status_code_last --- diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index e3e6f6e..633097b 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -52,7 +52,7 @@ extern "C" { /** * All standard/core status codes. * - * The code f_last_status_code 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. */ enum { #ifndef _di_f_status_booleans_ @@ -316,7 +316,7 @@ enum { #endif // _di_f_status_access_denied_ // required - f_last_status_code + f_status_code_last }; // enum #ifdef __cplusplus diff --git a/level_1/fl_fss/c/fss_status.h b/level_1/fl_fss/c/fss_status.h index e87a6e3..eb68a4f 100644 --- a/level_1/fl_fss/c/fss_status.h +++ b/level_1/fl_fss/c/fss_status.h @@ -20,7 +20,7 @@ extern "C" { #endif enum { - fl_fss_status_start = f_last_status_code, + fl_fss_status_code_first = f_status_code_last + 1, #ifndef _di_fl_fss_status_error_ fl_fss_invalid_format, @@ -46,7 +46,7 @@ enum { fl_fss_found_comment, #endif // _di_fl_fss_status_codes_ - fl_fss_last_error_code, + fl_fss_status_code_last, }; // enum #ifdef __cplusplus diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index 7870e2c..dfcc353 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -683,8 +683,8 @@ extern "C" { break; #endif // _di_fl_status_access_denied_ - case f_last_status_code: - *string = fl_status_string_last_status_code; + case f_status_code_last: + *string = fl_status_string_status_code_last; break; default: diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index 5bd8ff8..6600a70 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -693,8 +693,8 @@ extern "C" { #define fl_status_string_access_denied_super_length 22 #endif // _di_fl_status_access_denied_ - #define fl_status_string_last_status_code "f_last_status_code" - #define fl_status_string_last_error_code_length 18 + #define fl_status_string_status_code_last "f_status_code_last" + #define fl_status_string_status_code_last_length 18 #endif // _di_fl_status_string_ /** diff --git a/level_2/fll_fss/c/fss_status.c b/level_2/fll_fss/c/fss_status.c index 95fcb6a..bea7008 100644 --- a/level_2/fll_fss/c/fss_status.c +++ b/level_2/fll_fss/c/fss_status.c @@ -94,8 +94,13 @@ extern "C" { } #endif // _di_fll_fss_status_codes_ - if (fl_string_compare(string, fll_fss_status_string_last_error_code, length, fll_fss_status_string_last_error_code_length) == f_equal_to) { - *error = f_last_status_code; + if (fl_string_compare(string, fll_fss_status_string_status_code_first, length, fll_fss_status_string_status_code_first_length) == f_equal_to) { + *error = 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) { + *error = fl_fss_status_code_last; return f_none; } @@ -160,11 +165,15 @@ extern "C" { break; #endif // _di_fll_fss_status_codes_ - case fl_fss_last_error_code: - *string = fll_fss_status_string_last_error_code; + case fl_fss_status_code_first: + *string = fll_fss_status_string_status_code_first; + break; + + case fl_fss_status_code_last: + *string = fll_fss_status_string_status_code_last; break; - default: + default: return fl_status_to_string(error, string); } diff --git a/level_2/fll_fss/c/fss_status.h b/level_2/fll_fss/c/fss_status.h index 109dae2..3cb3ef6 100644 --- a/level_2/fll_fss/c/fss_status.h +++ b/level_2/fll_fss/c/fss_status.h @@ -75,8 +75,11 @@ extern "C" { #define fll_fss_status_string_found_comment_length 15 #endif // _di_fll_fss_status_codes_ - #define fll_fss_status_string_last_error_code "fl_fss_last_error_code" - #define fll_fss_status_string_last_error_code_length 23 + #define fll_fss_status_string_status_code_first "fl_fss_status_code_first" + #define fll_fss_status_string_status_code_first_length 25 + + #define fll_fss_status_string_status_code_last "fl_fss_status_code_last" + #define fll_fss_status_string_status_code_last_length 23 #endif // _di_fll_fss_status_string_ /** @@ -126,7 +129,6 @@ extern "C" { extern f_return_status fll_fss_status_is_warning(const f_status error); #endif // _di_fll_fss_status_is_warning_ - #ifndef _di_fll_fss_status_is_fine_ /** * Returns true or false depending on whether the standard context of the error code represents an normal return status and not an error. diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index e149080..eee8dd0 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -17,7 +17,7 @@ extern "C" { return f_no_data; } - // numbers are not valid status code strings. + // 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); } @@ -1126,8 +1126,8 @@ extern "C" { } #endif // _di_fll_status_access_denied_ - if (fl_string_compare(string, fl_status_string_last_status_code, length, fl_status_string_last_error_code_length) == f_equal_to) { - *code = f_last_status_code; + 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; } 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 b913e24..693bfd5 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -177,13 +177,13 @@ extern "C" { f_status status2 = f_none; for (; counter < data->remaining.used; counter++) { - // numbers are not valid status code strings. + // Numbers are not valid status code strings. if (f_conversion_character_is_decimal(arguments.argv[data->remaining.array[counter]][0]) == f_true) { status = f_false; continue; } - status2 = fll_status_from_string(arguments.argv[data->remaining.array[counter]], &code); + status2 = fll_fss_status_from_string(arguments.argv[data->remaining.array[counter]], &code); if (f_status_is_error(status2)) { status = status2; diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 99d179f..9d99fdf 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -177,7 +177,7 @@ extern "C" { f_status status2 = f_none; for (; counter < data->remaining.used; counter++) { - // numbers are not valid status code strings. + // Numbers are not valid status code strings. if (f_conversion_character_is_decimal(arguments.argv[data->remaining.array[counter]][0]) == f_true) { status = f_false; continue;