]> Kevux Git Server - fll/commitdiff
Update: status code tweaks, including setting fl_fss_status_code_first as different...
authorKevin Day <thekevinday@gmail.com>
Sat, 16 Nov 2019 04:58:13 +0000 (22:58 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 16 Nov 2019 04:58:13 +0000 (22:58 -0600)
level_0/f_status/c/status.h
level_1/fl_fss/c/fss_status.h
level_1/fl_status/c/status.c
level_1/fl_status/c/status.h
level_2/fll_fss/c/fss_status.c
level_2/fll_fss/c/fss_status.h
level_2/fll_status/c/status.c
level_3/fss_status_code/c/fss_status_code.c
level_3/status_code/c/status_code.c

index e3e6f6e3cecaaa3b5fd7845205e6dab443667395..633097b88865b784dfb79e3937b577ed949cd9dc 100644 (file)
@@ -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
index e87a6e3353adf65bf76bc57a6da58546e81115b0..eb68a4f3f300d1500a1050599758af0dc7becba2 100644 (file)
@@ -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
index 7870e2cb4d8a4f0a6f2a999b58d6ff98b40e56fa..dfcc3532ffed94930790c544b99daef9d541ebe0 100644 (file)
@@ -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:
index 5bd8ff8e6d49bfafd6d23f1ab78a69f2b2a0939b..6600a70678ebfb4d21d15eb966b466af0edf67c9 100644 (file)
@@ -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_
 
 /**
index 95fcb6a4115f4d67c1f9309d3e6ac649b35a6175..bea7008c0e4ee63846e5d46bcdeae64eb7559263 100644 (file)
@@ -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);
     }
 
index 109dae29d2f2ff9212fb6660bba56c2a20f9a231..3cb3ef65281a76558885d15b82c2ad7c902ecf58 100644 (file)
@@ -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.
index e14908032593d45a0622182986e6eee1fc9820a9..eee8dd0b96997058e6aed98c6738e62569745a79 100644 (file)
@@ -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;
     }
 
index b913e24db3e2ae22a04bf286c13cc5cc52eac097..693bfd5326c515e05952211fe338c2cc02f2fe6d 100644 (file)
@@ -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;
index 99d179fa3ba4a1cf591415dd26d6856b54d4e878..9d99fdf9806cf1f51deb8971334b10a927dab700 100644 (file)
@@ -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;