From: Kevin Day Date: Fri, 12 Jul 2024 03:23:57 +0000 (-0500) Subject: Update: Add additional F_enter and F_enter_not status codes to act as the opposite... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e05c5c6b5d025ebebc95f0ceb8818fa25e24382a;p=fll Update: Add additional F_enter and F_enter_not status codes to act as the opposite of F_exit ad F_exit_not. --- diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 14debba..4f023e3 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -297,6 +297,8 @@ extern "C" { F_endian_big, F_endian_little, F_endian_not, + F_enter, + F_enter_not, F_eoa, F_eoa_not, F_eof, diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index 97c3d7a..ca210ff 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -165,6 +165,8 @@ extern "C" { const f_string_static_t f_status_endian_big_s = macro_f_string_static_t_initialize_1(F_status_endian_big_s, 0, F_status_endian_big_s_length); const f_string_static_t f_status_endian_little_s = macro_f_string_static_t_initialize_1(F_status_endian_little_s, 0, F_status_endian_little_s_length); const f_string_static_t f_status_endian_not_s = macro_f_string_static_t_initialize_1(F_status_endian_not_s, 0, F_status_endian_not_s_length); + const f_string_static_t f_status_enter_s = macro_f_string_static_t_initialize_1(F_status_enter_s, 0, F_status_enter_s_length); + const f_string_static_t f_status_enter_not_s = macro_f_string_static_t_initialize_1(F_status_enter_not_s, 0, F_status_enter_not_s_length); const f_string_static_t f_status_eoa_s = macro_f_string_static_t_initialize_1(F_status_eoa_s, 0, F_status_eoa_s_length); const f_string_static_t f_status_eoa_not_s = macro_f_string_static_t_initialize_1(F_status_eoa_not_s, 0, F_status_eoa_not_s_length); const f_string_static_t f_status_eof_s = macro_f_string_static_t_initialize_1(F_status_eof_s, 0, F_status_eof_s_length); @@ -1502,6 +1504,16 @@ extern "C" { break; + case F_enter: + *name = f_status_enter_s; + + break; + + case F_enter_not: + *name = f_status_enter_not_s; + + break; + case F_eoa: *name = f_status_eoa_s; diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index 39aa28b..4d82018 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -325,6 +325,8 @@ extern "C" { #define F_status_endian_big_s "F_endian_big" #define F_status_endian_little_s "F_endian_little" #define F_status_endian_not_s "F_endian_not" + #define F_status_enter_s "F_enter" + #define F_status_enter_not_s "F_enter_not" #define F_status_eoa_s "F_eoa" #define F_status_eoa_not_s "F_eoa_not" #define F_status_eof_s "F_eof" @@ -665,6 +667,8 @@ extern "C" { #define F_status_endian_big_s_length 12 #define F_status_endian_little_s_length 19 #define F_status_endian_not_s_length 12 + #define F_status_enter_s_length 7 + #define F_status_enter_not_s_length 11 #define F_status_eoa_s_length 5 #define F_status_eoa_not_s_length 9 #define F_status_eof_s_length 5 @@ -1007,6 +1011,8 @@ extern "C" { extern const f_string_static_t f_status_endian_big_s; extern const f_string_static_t f_status_endian_little_s; extern const f_string_static_t f_status_endian_not_s; + extern const f_string_static_t f_status_enter_s; + extern const f_string_static_t f_status_enter_not_s; extern const f_string_static_t f_status_eoa_s; extern const f_string_static_t f_status_eoa_not_s; extern const f_string_static_t f_status_eof_s; diff --git a/level_0/f_status_string/tests/unit/c/test-status_string-to.c b/level_0/f_status_string/tests/unit/c/test-status_string-to.c index 5a1ff46..69bb7ad 100644 --- a/level_0/f_status_string/tests/unit/c/test-status_string-to.c +++ b/level_0/f_status_string/tests/unit/c/test-status_string-to.c @@ -191,6 +191,8 @@ void test__f_status_string_to__works(void **state) { F_endian_big, F_endian_little, F_endian_not, + F_enter, + F_enter_not, F_eoa, F_eoa_not, F_eof, @@ -836,6 +838,8 @@ void test__f_status_string_to__works(void **state) { f_status_endian_big_s, f_status_endian_little_s, f_status_endian_not_s, + f_status_enter_s, + f_status_enter_not_s, f_status_eoa_s, f_status_eoa_not_s, f_status_eof_s, @@ -1319,7 +1323,7 @@ void test__f_status_string_to__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 642; ++i) { + for (uint16_t i = 0; i < 644; ++i) { f_string_static_t result = f_string_static_t_initialize; diff --git a/level_1/fl_status_string/c/status_string.c b/level_1/fl_status_string/c/status_string.c index c5dfdf4..feef49f 100644 --- a/level_1/fl_status_string/c/status_string.c +++ b/level_1/fl_status_string/c/status_string.c @@ -987,6 +987,18 @@ extern "C" { return F_okay; } + if (f_compare_dynamic(name, f_status_enter_s) == F_equal_to) { + *code = F_enter; + + return F_okay; + } + + if (f_compare_dynamic(name, f_status_enter_not_s) == F_equal_to) { + *code = F_enter_not; + + return F_okay; + } + if (f_compare_dynamic(name, f_status_eoa_s) == F_equal_to) { *code = F_eoa; diff --git a/level_1/fl_status_string/tests/unit/c/test-status_string-from.c b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c index d8b0ff0..3b6a224 100644 --- a/level_1/fl_status_string/tests/unit/c/test-status_string-from.c +++ b/level_1/fl_status_string/tests/unit/c/test-status_string-from.c @@ -207,6 +207,8 @@ void test__fl_status_string_from__works(void **state) { F_endian_big, F_endian_little, F_endian_not, + F_enter, + F_enter_not, F_eoa, F_eoa_not, F_eof, @@ -852,6 +854,8 @@ void test__fl_status_string_from__works(void **state) { f_status_endian_big_s, f_status_endian_little_s, f_status_endian_not_s, + f_status_enter_s, + f_status_enter_not_s, f_status_eoa_s, f_status_eoa_not_s, f_status_eof_s,