]> Kevux Git Server - fll/commitdiff
Cleanup: The FLL FSS Status String strings.
authorKevin Day <Kevin@kevux.org>
Sun, 30 Mar 2025 23:03:03 +0000 (18:03 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 30 Mar 2025 23:04:07 +0000 (18:04 -0500)
Remove the granular define wrapping structure that I am not using anymore.
Make sure to use the proper `_s_` naming strategy.
Simplify some of the names.

build/stand_alone/firewall.config.h
level_2/fll_fss_status_string/c/fss_status_string.c
level_2/fll_fss_status_string/c/fss_status_string.h

index 486d19daecdeab9c0797576159a8e834e4b28afb..4c47e621f2c052fd0e54bf91034988893039378e 100644 (file)
 #define _di_fll_fss_snatch_together_
 #define _di_fll_fss_status_codes_
 #define _di_fll_fss_status_error_
-#define _di_fll_fss_status_string_
 #define _di_fll_fss_status_string_from_
+#define _di_fll_fss_status_string_s_
 #define _di_fll_fss_status_string_to_
 #define _di_fll_fss_status_success_
 #define _di_fll_fss_status_warning_
index 73226896e048ffad28c2ace692001c747ce461a1..e02bbc17c44cf93c29be348c58343f942b79e439 100644 (file)
@@ -4,32 +4,23 @@
 extern "C" {
 #endif
 
-#ifndef _di_fll_fss_status_string_
-  #ifndef _di_fll_fss_status_error_
-    const f_string_static_t fll_fss_status_format_s = macro_f_string_static_t_initialize_1(FLL_fss_status_format_s, 0, FLL_fss_status_format_s_length);
-    const f_string_static_t fll_fss_status_format_eos_s = macro_f_string_static_t_initialize_1(FLL_fss_status_format_eos_s, 0, FLL_fss_status_format_eos_s_length);
-  #endif // _di_fll_fss_status_error_
-
-  #ifndef _di_fll_fss_status_warning_
-    const f_string_static_t fll_fss_status_accepted_invalid_s = macro_f_string_static_t_initialize_1(FLL_fss_status_accepted_invalid_s, 0, FLL_fss_status_accepted_invalid_s_length);
-    const f_string_static_t fll_fss_status_accepted_invalid_eos_s = macro_f_string_static_t_initialize_1(FLL_fss_status_accepted_invalid_eos_s, 0, FLL_fss_status_accepted_invalid_eos_s_length);
-  #endif // _di_fll_fss_status_warning_
-
-  #ifndef _di_fll_fss_status_success_
-    const f_string_static_t fll_fss_status_found_content_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_content_s, 0, FLL_fss_status_found_content_s_length);
-    const f_string_static_t fll_fss_status_found_content_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_content_not_s, 0, FLL_fss_status_found_content_not_s_length);
-    const f_string_static_t fll_fss_status_found_object_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_s, 0, FLL_fss_status_found_object_s_length);
-    const f_string_static_t fll_fss_status_found_object_content_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_content_not_s, 0, FLL_fss_status_found_object_content_not_s_length);
-    const f_string_static_t fll_fss_status_found_object_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_not_s, 0, FLL_fss_status_found_object_not_s_length);
-  #endif // _di_fll_fss_status_success_
-
-  #ifndef _di_fll_fss_status_codes_
-    const f_string_static_t fll_fss_status_found_comment_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_comment_s, 0, FLL_fss_status_found_comment_s_length);
-  #endif // _di_fll_fss_status_codes_
-
-  const f_string_static_t fll_fss_status_status_code_first_s = macro_f_string_static_t_initialize_1(FLL_fss_status_status_code_first_s, 0, FLL_fss_status_status_code_first_s_length);
-  const f_string_static_t fll_fss_status_status_code_last_s = macro_f_string_static_t_initialize_1(FLL_fss_status_status_code_last_s, 0, FLL_fss_status_status_code_last_s_length);
-#endif // _di_FLL_fss_status_string_
+#ifndef _di_fll_fss_status_s_
+  const f_string_static_t fll_fss_status_accepted_invalid_s = macro_f_string_static_t_initialize_1(FLL_fss_status_accepted_invalid_s, 0, FLL_fss_status_accepted_invalid_s_length);
+  const f_string_static_t fll_fss_status_accepted_invalid_eos_s = macro_f_string_static_t_initialize_1(FLL_fss_status_accepted_invalid_eos_s, 0, FLL_fss_status_accepted_invalid_eos_s_length);
+
+  const f_string_static_t fll_fss_status_code_first_s = macro_f_string_static_t_initialize_1(FLL_fss_status_code_first_s, 0, FLL_fss_status_code_first_s_length);
+  const f_string_static_t fll_fss_status_code_last_s = macro_f_string_static_t_initialize_1(FLL_fss_status_code_last_s, 0, FLL_fss_status_code_last_s_length);
+
+  const f_string_static_t fll_fss_status_format_s = macro_f_string_static_t_initialize_1(FLL_fss_status_format_s, 0, FLL_fss_status_format_s_length);
+  const f_string_static_t fll_fss_status_format_eos_s = macro_f_string_static_t_initialize_1(FLL_fss_status_format_eos_s, 0, FLL_fss_status_format_eos_s_length);
+
+  const f_string_static_t fll_fss_status_found_comment_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_comment_s, 0, FLL_fss_status_found_comment_s_length);
+  const f_string_static_t fll_fss_status_found_content_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_content_s, 0, FLL_fss_status_found_content_s_length);
+  const f_string_static_t fll_fss_status_found_content_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_content_not_s, 0, FLL_fss_status_found_content_not_s_length);
+  const f_string_static_t fll_fss_status_found_object_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_s, 0, FLL_fss_status_found_object_s_length);
+  const f_string_static_t fll_fss_status_found_object_content_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_content_not_s, 0, FLL_fss_status_found_object_content_not_s_length);
+  const f_string_static_t fll_fss_status_found_object_not_s = macro_f_string_static_t_initialize_1(FLL_fss_status_found_object_not_s, 0, FLL_fss_status_found_object_not_s_length);
+#endif // _di_fll_fss_status_s_
 
 #ifndef _di_fll_fss_status_string_from_
   f_status_t fll_fss_status_string_from(const f_string_static_t name, f_status_t * const code) {
@@ -37,91 +28,83 @@ extern "C" {
       if (!code) return F_status_set_error(F_parameter);
     #endif // _di_level_2_parameter_checking_
 
-    f_status_t status = F_okay;
-
     if (!name.used) return F_data_not;
 
     // Numbers are not valid status code strings.
-    status = f_conversion_character_is_decimal(name.string[0]);
+    {
+      const f_status_t status = f_conversion_character_is_decimal(name.string[0]);
 
-    if (status == F_true) return F_status_set_error(F_data);
-    if (F_status_is_error(status)) return status;
+      if (status == F_true) return F_status_set_error(F_data);
+      if (F_status_is_error(status)) return status;
+    }
 
-    #ifndef _di_fll_fss_status_error_
-      if (f_compare_dynamic(name, fll_fss_status_format_s) == F_equal_to) {
-        *code = F_fss_format;
+    if (f_compare_dynamic(name, fll_fss_status_format_s) == F_equal_to) {
+      *code = F_fss_format;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_format_eos_s) == F_equal_to) {
-        *code = F_fss_format_eos;
+    if (f_compare_dynamic(name, fll_fss_status_format_eos_s) == F_equal_to) {
+      *code = F_fss_format_eos;
 
-        return F_okay;
-      }
-    #endif // _di_fll_fss_status_error_
+      return F_okay;
+    }
 
-    #ifndef _di_fll_fss_status_warning_
-      if (f_compare_dynamic(name, fll_fss_status_accepted_invalid_s) == F_equal_to) {
-        *code = F_fss_accepted_invalid;
+    if (f_compare_dynamic(name, fll_fss_status_accepted_invalid_s) == F_equal_to) {
+      *code = F_fss_accepted_invalid;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_accepted_invalid_eos_s) == F_equal_to) {
-        *code = F_fss_accepted_invalid_eos;
+    if (f_compare_dynamic(name, fll_fss_status_accepted_invalid_eos_s) == F_equal_to) {
+      *code = F_fss_accepted_invalid_eos;
 
-        return F_okay;
-      }
-    #endif // _di_fll_fss_status_warning_
+      return F_okay;
+    }
 
-    #ifndef _di_fll_fss_status_success_
-      if (f_compare_dynamic(name, fll_fss_status_found_object_s) == F_equal_to) {
-        *code = F_fss_found_object;
+    if (f_compare_dynamic(name, fll_fss_status_found_object_s) == F_equal_to) {
+      *code = F_fss_found_object;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_found_content_s) == F_equal_to) {
-        *code = F_fss_found_content;
+    if (f_compare_dynamic(name, fll_fss_status_found_content_s) == F_equal_to) {
+      *code = F_fss_found_content;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_found_object_not_s) == F_equal_to) {
-        *code = F_fss_found_object_not;
+    if (f_compare_dynamic(name, fll_fss_status_found_object_not_s) == F_equal_to) {
+      *code = F_fss_found_object_not;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_found_content_not_s) == F_equal_to) {
-        *code = F_fss_found_content_not;
+    if (f_compare_dynamic(name, fll_fss_status_found_content_not_s) == F_equal_to) {
+      *code = F_fss_found_content_not;
 
-        return F_okay;
-      }
+      return F_okay;
+    }
 
-      if (f_compare_dynamic(name, fll_fss_status_found_object_content_not_s) == F_equal_to) {
-        *code = F_fss_found_object_content_not;
+    if (f_compare_dynamic(name, fll_fss_status_found_object_content_not_s) == F_equal_to) {
+      *code = F_fss_found_object_content_not;
 
-        return F_okay;
-      }
-    #endif // _di_fll_fss_status_success_
+      return F_okay;
+    }
 
-    #ifndef _di_fll_fss_status_codes_
-      if (f_compare_dynamic(name, fll_fss_status_found_comment_s) == F_equal_to) {
-        *code = F_fss_found_object;
+    if (f_compare_dynamic(name, fll_fss_status_found_comment_s) == F_equal_to) {
+      *code = F_fss_found_object;
 
-        return F_okay;
-      }
-    #endif // _di_fll_fss_status_codes_
+      return F_okay;
+    }
 
-    if (f_compare_dynamic(name, fll_fss_status_status_code_first_s) == F_equal_to) {
+    if (f_compare_dynamic(name, fll_fss_status_code_first_s) == F_equal_to) {
       *code = F_fss_status_code_first;
 
       return F_okay;
     }
 
-    if (f_compare_dynamic(name, fll_fss_status_status_code_last_s) == F_equal_to) {
+    if (f_compare_dynamic(name, fll_fss_status_code_last_s) == F_equal_to) {
       *code = F_fss_status_code_last;
 
       return F_okay;
@@ -140,60 +123,52 @@ extern "C" {
     const f_status_t unmasked_code = F_status_set_fine(code);
 
     switch (unmasked_code) {
-      #ifndef _di_fll_fss_status_error_
-        case F_fss_format:
-          *name = fll_fss_status_format_s;
-          break;
-
-        case F_fss_format_eos:
-          *name = fll_fss_status_format_eos_s;
-          break;
-      #endif // _di_fll_fss_status_error_
-
-      #ifndef _di_fll_fss_status_warning_
-        case F_fss_accepted_invalid:
-          *name = fll_fss_status_accepted_invalid_s;
-          break;
-
-        case F_fss_accepted_invalid_eos:
-          *name = fll_fss_status_accepted_invalid_eos_s;
-          break;
-      #endif // _di_fll_fss_status_warning_
-
-      #ifndef _di_fll_fss_status_success_
-        case F_fss_found_object:
-          *name = fll_fss_status_found_object_s;
-          break;
-
-        case F_fss_found_content:
-          *name = fll_fss_status_found_content_s;
-          break;
-
-        case F_fss_found_object_not:
-          *name = fll_fss_status_found_object_not_s;
-          break;
-
-        case F_fss_found_content_not:
-          *name = fll_fss_status_found_content_not_s;
-          break;
-
-        case F_fss_found_object_content_not:
-          *name = fll_fss_status_found_object_content_not_s;
-          break;
-      #endif // _di_fll_fss_status_success_
-
-      #ifndef _di_fll_fss_status_codes_
-        case F_fss_found_comment:
-          *name = fll_fss_status_found_comment_s;
-          break;
-      #endif // _di_fll_fss_status_codes_
+      case F_fss_format:
+        *name = fll_fss_status_format_s;
+        break;
+
+      case F_fss_format_eos:
+        *name = fll_fss_status_format_eos_s;
+        break;
+
+      case F_fss_accepted_invalid:
+        *name = fll_fss_status_accepted_invalid_s;
+        break;
+
+      case F_fss_accepted_invalid_eos:
+        *name = fll_fss_status_accepted_invalid_eos_s;
+        break;
+
+      case F_fss_found_object:
+        *name = fll_fss_status_found_object_s;
+        break;
+
+      case F_fss_found_content:
+        *name = fll_fss_status_found_content_s;
+        break;
+
+      case F_fss_found_object_not:
+        *name = fll_fss_status_found_object_not_s;
+        break;
+
+      case F_fss_found_content_not:
+        *name = fll_fss_status_found_content_not_s;
+        break;
+
+      case F_fss_found_object_content_not:
+        *name = fll_fss_status_found_object_content_not_s;
+        break;
+
+      case F_fss_found_comment:
+        *name = fll_fss_status_found_comment_s;
+        break;
 
       case F_fss_status_code_first:
-        *name = fll_fss_status_status_code_first_s;
+        *name = fll_fss_status_code_first_s;
         break;
 
       case F_fss_status_code_last:
-        *name = fll_fss_status_status_code_last_s;
+        *name = fll_fss_status_code_last_s;
         break;
 
       default:
index befe7d4143a4d6eb43f59959826b899b18a2cb28..0988f30982b2b389bcc7d85c618f4646f8c0de98 100644 (file)
 extern "C" {
 #endif
 
-#ifndef _di_fll_fss_status_string_
-  #ifndef _di_fll_fss_status_error_
-    #define FLL_fss_status_format_s     "F_fss_format"
-    #define FLL_fss_status_format_eos_s "F_fss_format_eos"
-
-    #define FLL_fss_status_format_s_length     12
-    #define FLL_fss_status_format_eos_s_length 16
-
-    extern const f_string_static_t fll_fss_status_format_s;
-    extern const f_string_static_t fll_fss_status_format_eos_s;
-  #endif // _di_fll_fss_status_error_
-
-  #ifndef _di_fll_fss_status_warning_
-    #define FLL_fss_status_accepted_invalid_s     "F_fss_accepted_invalid"
-    #define FLL_fss_status_accepted_invalid_eos_s "F_fss_accepted_invalid_eos"
-
-    #define FLL_fss_status_accepted_invalid_s_length     22
-    #define FLL_fss_status_accepted_invalid_eos_s_length 26
-
-    extern const f_string_static_t fll_fss_status_accepted_invalid_s;
-    extern const f_string_static_t fll_fss_status_accepted_invalid_eos_s;
-  #endif // _di_fll_fss_status_warning_
-
-  #ifndef _di_fll_fss_status_success_
-    #define FLL_fss_status_found_content_s            "F_fss_found_content"
-    #define FLL_fss_status_found_content_not_s        "F_fss_found_content_not"
-    #define FLL_fss_status_found_object_s             "F_fss_found_object"
-    #define FLL_fss_status_found_object_content_not_s "F_fss_found_object_content_not"
-    #define FLL_fss_status_found_object_not_s         "F_fss_found_object_not"
-
-    #define FLL_fss_status_found_content_s_length            19
-    #define FLL_fss_status_found_content_not_s_length        23
-    #define FLL_fss_status_found_object_s_length             18
-    #define FLL_fss_status_found_object_content_not_s_length 30
-    #define FLL_fss_status_found_object_not_s_length         22
-
-    extern const f_string_static_t fll_fss_status_found_content_s;
-    extern const f_string_static_t fll_fss_status_found_content_not_s;
-    extern const f_string_static_t fll_fss_status_found_object_s;
-    extern const f_string_static_t fll_fss_status_found_object_content_not_s;
-    extern const f_string_static_t fll_fss_status_found_object_not_s;
-  #endif // _di_fll_fss_status_success_
-
-  #ifndef _di_fll_fss_status_codes_
-    #define FLL_fss_status_found_comment_s "F_fss_found_comment"
-
-    #define FLL_fss_status_found_comment_s_length 19
-
-    extern const f_string_static_t fll_fss_status_found_comment_s;
-  #endif // _di_fll_fss_status_codes_
-
-  #define FLL_fss_status_status_code_first_s "F_fss_status_code_first"
-  #define FLL_fss_status_status_code_last_s  "F_fss_status_code_last"
-
-  #define FLL_fss_status_status_code_first_s_length 23
-  #define FLL_fss_status_status_code_last_s_length  22
-
-  extern const f_string_static_t fll_fss_status_status_code_first_s;
-  extern const f_string_static_t fll_fss_status_status_code_last_s;
-#endif // _di_fll_fss_status_string_
+/**
+ * The fll_fss_status_*_s strings.
+ */
+#ifndef _di_fll_fss_status_s_
+  #define FLL_fss_status_accepted_invalid_s     "F_fss_accepted_invalid"
+  #define FLL_fss_status_accepted_invalid_eos_s "F_fss_accepted_invalid_eos"
+
+  #define FLL_fss_status_code_first_s "F_fss_status_code_first"
+  #define FLL_fss_status_code_last_s  "F_fss_status_code_last"
+
+  #define FLL_fss_status_format_s     "F_fss_format"
+  #define FLL_fss_status_format_eos_s "F_fss_format_eos"
+
+  #define FLL_fss_status_found_comment_s            "F_fss_found_comment"
+  #define FLL_fss_status_found_content_s            "F_fss_found_content"
+  #define FLL_fss_status_found_content_not_s        "F_fss_found_content_not"
+  #define FLL_fss_status_found_object_s             "F_fss_found_object"
+  #define FLL_fss_status_found_object_content_not_s "F_fss_found_object_content_not"
+  #define FLL_fss_status_found_object_not_s         "F_fss_found_object_not"
+
+  #define FLL_fss_status_accepted_invalid_s_length     22
+  #define FLL_fss_status_accepted_invalid_eos_s_length 26
+
+  #define FLL_fss_status_code_first_s_length 23
+  #define FLL_fss_status_code_last_s_length  22
+
+  #define FLL_fss_status_format_s_length     12
+  #define FLL_fss_status_format_eos_s_length 16
+
+  #define FLL_fss_status_found_comment_s_length 19
+  #define FLL_fss_status_found_content_s_length            19
+  #define FLL_fss_status_found_content_not_s_length        23
+  #define FLL_fss_status_found_object_s_length             18
+  #define FLL_fss_status_found_object_content_not_s_length 30
+  #define FLL_fss_status_found_object_not_s_length         22
+
+  extern const f_string_static_t fll_fss_status_accepted_invalid_s;
+  extern const f_string_static_t fll_fss_status_accepted_invalid_eos_s;
+
+  extern const f_string_static_t fll_fss_status_code_first_s;
+  extern const f_string_static_t fll_fss_status_code_last_s;
+
+  extern const f_string_static_t fll_fss_status_format_s;
+  extern const f_string_static_t fll_fss_status_format_eos_s;
+
+  extern const f_string_static_t fll_fss_status_found_comment_s;
+  extern const f_string_static_t fll_fss_status_found_content_s;
+  extern const f_string_static_t fll_fss_status_found_content_not_s;
+  extern const f_string_static_t fll_fss_status_found_object_s;
+  extern const f_string_static_t fll_fss_status_found_object_content_not_s;
+  extern const f_string_static_t fll_fss_status_found_object_not_s;
+#endif // _di_fll_fss_status_s_
 
 /**
  * Convert FSS status codes from their string equivalents to a status code.