]> Kevux Git Server - fll/commitdiff
Update: Add F_instance status codes.
authorKevin Day <Kevin@kevux.org>
Sun, 2 Jun 2024 17:42:06 +0000 (12:42 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 2 Jun 2024 17:49:06 +0000 (12:49 -0500)
I am now using "instance" in parallel with "process".
Provide an "instance" codes in a similar manner.

level_0/f_status/c/status.h
level_0/f_status_string/c/status_string.c
level_0/f_status_string/c/status_string.h
level_0/f_status_string/tests/unit/c/test-status_string-to.c
level_1/fl_status_string/c/status_string.c
level_1/fl_status_string/tests/unit/c/test-status_string-from.c

index 7d62d4884da042075980764d36ebe682451d0b4e..e8bf18f562e1927d4ce4ddb4a24c97f7a84873f0 100644 (file)
@@ -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,
index 95b45067378247ae1f9788d161234b833d9d7ffb..0cd0b7f4fe05c70e303da36e220b4e39e1245e01 100644 (file)
@@ -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;
index 13ba176e7fa2c6cfddd5cd76e2e52c1b9419b761..c8225632888deccd79d674d15e421a03a03b5e07 100644 (file)
@@ -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"
index c2a2e11b4af0fb5100154c812e2e65aee1db4889..1ce19ee6603a3402f2563bce37d09efd5cbb808d 100644 (file)
@@ -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;
 
index ece4cee7e5b0f1cd65fa509313816d53d801ea2f..dfba760d053c4975078b6a7646532198199bb709 100644 (file)
@@ -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;
 
index c4e19313edae3c1d56dd9474a1ee5284cb61fdb1..c3986adad5974d214b4746b64f2cad7f4e6155f6 100644 (file)
@@ -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;