From: Kevin Day Date: Sun, 2 Jun 2024 17:42:06 +0000 (-0500) Subject: Update: Add F_instance status codes. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=90133468c0141cb95bc0fa753bace24b3fad65c3;p=fll Update: Add F_instance status codes. I am now using "instance" in parallel with "process". Provide an "instance" codes in a similar manner. --- diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 7d62d48..e8bf18f 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -678,6 +678,11 @@ extern "C" { F_process_not, F_process_too_many, + // Process. + F_instance, + F_instance_not, + F_instance_too_many, + // File. F_file, F_file_close, diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index 95b4506..0cd0b7f 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -553,6 +553,11 @@ extern "C" { const f_string_static_t f_status_process_not_s = macro_f_string_static_t_initialize_1(F_status_process_not_s, 0, F_status_process_not_s_length); const f_string_static_t f_status_process_too_many_s = macro_f_string_static_t_initialize_1(F_status_process_too_many_s, 0, F_status_process_too_many_s_length); + // Instance. + const f_string_static_t f_status_instance_s = macro_f_string_static_t_initialize_1(F_status_instance_s, 0, F_status_instance_s_length); + const f_string_static_t f_status_instance_not_s = macro_f_string_static_t_initialize_1(F_status_instance_not_s, 0, F_status_instance_not_s_length); + const f_string_static_t f_status_instance_too_many_s = macro_f_string_static_t_initialize_1(F_status_instance_too_many_s, 0, F_status_instance_too_many_s_length); + // File. const f_string_static_t f_status_file_s = macro_f_string_static_t_initialize_1(F_status_file_s, 0, F_status_file_s_length); const f_string_static_t f_status_file_close_s = macro_f_string_static_t_initialize_1(F_status_file_close_s, 0, F_status_file_close_s_length); @@ -3309,6 +3314,22 @@ extern "C" { break; + // Instance. + case F_instance: + *name = f_status_instance_s; + + break; + + case F_instance_not: + *name = f_status_instance_not_s; + + break; + + case F_instance_too_many: + *name = f_status_instance_too_many_s; + + break; + // File. case F_file: *name = f_status_file_s; diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index 13ba176..c822563 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -1642,6 +1642,19 @@ extern "C" { extern const f_string_static_t f_status_process_not_s; extern const f_string_static_t f_status_process_too_many_s; + // Instance. + #define F_status_instance_s "F_instance" + #define F_status_instance_not_s "F_instance_not" + #define F_status_instance_too_many_s "F_instance_too_many" + + #define F_status_instance_s_length 10 + #define F_status_instance_not_s_length 14 + #define F_status_instance_too_many_s_length 19 + + extern const f_string_static_t f_status_instance_s; + extern const f_string_static_t f_status_instance_not_s; + extern const f_string_static_t f_status_instance_too_many_s; + // File. #define F_status_file_s "F_file" #define F_status_file_close_s "F_file_close" 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 c2a2e11..1ce19ee 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 @@ -553,6 +553,9 @@ void test__f_status_string_to__works(void **state) { F_process, F_process_not, F_process_too_many, + F_instance, + F_instance_not, + F_instance_too_many, F_file, F_file_close, F_file_closed, @@ -1188,6 +1191,9 @@ void test__f_status_string_to__works(void **state) { f_status_process_s, f_status_process_not_s, f_status_process_too_many_s, + f_status_instance_s, + f_status_instance_not_s, + f_status_instance_too_many_s, f_status_file_s, f_status_file_close_s, f_status_file_closed_s, @@ -1299,7 +1305,7 @@ void test__f_status_string_to__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 632; ++i) { + for (uint16_t i = 0; i < 635; ++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 ece4cee..dfba760 100644 --- a/level_1/fl_status_string/c/status_string.c +++ b/level_1/fl_status_string/c/status_string.c @@ -3167,9 +3167,27 @@ extern "C" { return F_okay; } - #endif // _di_f_status_process_s_ - #ifndef _di_f_status_file_s_ + // Instance. + if (f_compare_dynamic(name, f_status_instance_s) == F_equal_to) { + *code = F_instance; + + return F_okay; + } + + if (f_compare_dynamic(name, f_status_instance_not_s) == F_equal_to) { + *code = F_instance_not; + + return F_okay; + } + + if (f_compare_dynamic(name, f_status_instance_too_many_s) == F_equal_to) { + *code = F_instance_too_many; + + return F_okay; + } + + // File. if (f_compare_dynamic(name, f_status_file_s) == F_equal_to) { *code = F_file; 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 c4e1931..c3986ad 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 @@ -569,6 +569,9 @@ void test__fl_status_string_from__works(void **state) { F_process, F_process_not, F_process_too_many, + F_instance, + F_instance_not, + F_instance_too_many, F_file, F_file_close, F_file_closed, @@ -1204,6 +1207,9 @@ void test__fl_status_string_from__works(void **state) { f_status_process_s, f_status_process_not_s, f_status_process_too_many_s, + f_status_instance_s, + f_status_instance_not_s, + f_status_instance_too_many_s, f_status_file_s, f_status_file_close_s, f_status_file_closed_s, @@ -1315,7 +1321,7 @@ void test__fl_status_string_from__works(void **state) { f_status_status_code_last_s, }; - for (uint16_t i = 0; i < 632; ++i) { + for (uint16_t i = 0; i < 635; ++i) { f_status_t result = F_okay;