]> Kevux Git Server - fll/commitdiff
Cleanup: provide helper structure f_console_parameters
authorKevin Day <thekevinday@gmail.com>
Sun, 8 Sep 2019 22:25:22 +0000 (17:25 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 8 Sep 2019 22:43:40 +0000 (17:43 -0500)
This is provided to help shorten the number of parameters passed to functions.

16 files changed:
level_0/f_console/c/console.h
level_1/fl_console/c/console.c
level_1/fl_console/c/console.h
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_3/bit_dump/c/bit_dump.c
level_3/firewall/c/firewall.c
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_status_code/c/fss_status_code.c
level_3/init/c/init.c
level_3/status_code/c/status_code.c

index 60409c23eafaf735fecbe44065e8b631a1998902..5d393b4c9c7f50e9120122f18513ce289e869f9e 100644 (file)
@@ -161,17 +161,33 @@ extern "C" {
 /**
  * Provide a helper structure for references and processing parameters.
  *
+ * The f_console_parameters is designed for passing this to a function as a single argument.
+ * The "parameters" property is intended to be populated with an aray of f_console_parameter_id whose size is defined by the "used" property.
+ * This follows the idea of f_string_dynamic and has a "used" instead of length, but because this is not intended to be dynamically allocated there is no "size" property.
+ */
+#ifndef _di_f_console_parameters_
+  typedef struct {
+    f_console_parameter *parameter;
+    f_array_length       used;
+  } f_console_parameters;
+
+  #define f_console_parameters_initialize { 0, 0 }
+#endif // _di_f_console_parameters_
+
+/**
+ * Provide a helper structure for references and processing standard C main() arguments.
+ *
  * The f_console_parameter_id is designed to be used for the enums to represent a any given parameter by the ID.
  *
  * The f_console_parameter_ids is designed for passing this to a function as a single argument.
- * The "ids" property is intended to be populated with an aray of f_console_parameter_id whose size is defined by the "used" property.
+ * The "id" property is intended to be populated with an aray of f_console_parameter_id whose size is defined by the "used" property.
  * This follows the idea of f_string_dynamic and has a "used" instead of length, but because this is not intended to be dynamically allocated there is no "size" property.
  */
 #ifndef _di_f_console_parameter_id_
   typedef uint16_t f_console_parameter_id;
 
   typedef struct {
-    f_console_parameter_id *ids;
+    f_console_parameter_id *id;
     f_array_length         used;
   } f_console_parameter_ids;
 
index df0419b108d321941d1f488f639bb4446a56f047..0ea8b9466f711614ab80dc569b6c2fc7a21e45e7 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fl_console_parameter_process_
-  f_return_status fl_console_parameter_process(const f_console_arguments arguments, f_console_parameter parameters[], const f_array_length parameters_total, f_string_lengths *remaining) {
+  f_return_status fl_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining) {
     #ifndef _di_level_1_parameter_checking_
       if (remaining == 0) return f_status_set_error(f_invalid_parameter);
     #endif // _di_level_1_parameter_checking_
@@ -65,10 +65,10 @@ extern "C" {
       if (needs_additional.used > 0) {
         parameter_counter = needs_additional.array[0];
 
-        if (parameters[parameter_counter].additional.used >= parameters[parameter_counter].additional.size) {
+        if (parameters.parameter[parameter_counter].additional.used >= parameters.parameter[parameter_counter].additional.size) {
           f_status allocation_status = f_none;
 
-          f_macro_string_lengths_resize(allocation_status, parameters[parameter_counter].additional, parameters[parameter_counter].additional.size + f_console_default_allocation_step);
+          f_macro_string_lengths_resize(allocation_status, parameters.parameter[parameter_counter].additional, parameters.parameter[parameter_counter].additional.size + f_console_default_allocation_step);
 
           if (f_status_is_error(allocation_status)) {
             f_macro_string_lengths_delete(status, needs_additional);
@@ -76,9 +76,9 @@ extern "C" {
           }
         }
 
-        parameters[parameter_counter].result = f_console_result_additional;
-        parameters[parameter_counter].additional.array[parameters[parameter_counter].additional.used] = location;
-        parameters[parameter_counter].additional.used++;
+        parameters.parameter[parameter_counter].result = f_console_result_additional;
+        parameters.parameter[parameter_counter].additional.array[parameters.parameter[parameter_counter].additional.used] = location;
+        parameters.parameter[parameter_counter].additional.used++;
 
         needs_additional.used--;
 
@@ -90,26 +90,26 @@ extern "C" {
       else if (console_short > f_console_none) {
         // The sub_location is used on a per increment basis (such as 'tar -xcf', the '-' would have an increment of 1, therefore x, c, and f would all be three separate parameters).
         while (sub_location < string_length) {
-          for (parameter_counter = 0; parameter_counter < parameters_total; parameter_counter++) {
-            if (parameters[parameter_counter].type != console_type) {
+          for (parameter_counter = 0; parameter_counter < parameters.used; parameter_counter++) {
+            if (parameters.parameter[parameter_counter].type != console_type) {
               continue;
             }
 
             if (result == console_short) {
-              if (parameters[parameter_counter].symbol_short == 0) {
+              if (parameters.parameter[parameter_counter].symbol_short == 0) {
                 continue;
               }
 
-              if (strncmp(&arguments.argv[location][sub_location], parameters[parameter_counter].symbol_short, increment_by + 1) != 0) {
+              if (strncmp(&arguments.argv[location][sub_location], parameters.parameter[parameter_counter].symbol_short, increment_by + 1) != 0) {
                 continue;
               }
             }
             else if (result == console_long) {
-              if (parameters[parameter_counter].symbol_long == 0) {
+              if (parameters.parameter[parameter_counter].symbol_long == 0) {
                 continue;
               }
 
-              if (strncmp(&arguments.argv[location][sub_location], parameters[parameter_counter].symbol_long, increment_by + 1) != 0) {
+              if (strncmp(&arguments.argv[location][sub_location], parameters.parameter[parameter_counter].symbol_long, increment_by + 1) != 0) {
                 continue;
               }
             }
@@ -117,20 +117,20 @@ extern "C" {
               continue;
             }
 
-            parameters[parameter_counter].result = f_console_result_found;
-            parameters[parameter_counter].location = location;
-            parameters[parameter_counter].location_sub = 0;
-            parameters[parameter_counter].total++;
+            parameters.parameter[parameter_counter].result = f_console_result_found;
+            parameters.parameter[parameter_counter].location = location;
+            parameters.parameter[parameter_counter].location_sub = 0;
+            parameters.parameter[parameter_counter].total++;
 
             if (result == console_short) {
-              parameters[parameter_counter].location_sub = sub_location;
+              parameters.parameter[parameter_counter].location_sub = sub_location;
             }
 
-            if (parameters[parameter_counter].has_additional) {
-              if (needs_additional.used + parameters[parameter_counter].has_additional > needs_additional.size) {
+            if (parameters.parameter[parameter_counter].has_additional) {
+              if (needs_additional.used + parameters.parameter[parameter_counter].has_additional > needs_additional.size) {
                 f_status allocation_status = f_none;
 
-                f_macro_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
+                f_macro_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters.parameter[parameter_counter].has_additional);
 
                 if (f_status_is_error(allocation_status)) {
                   f_macro_string_lengths_delete(status, needs_additional);
@@ -138,7 +138,7 @@ extern "C" {
                 }
               }
 
-              for (f_array_length additional = 0; additional < parameters[parameter_counter].has_additional; additional++) {
+              for (f_array_length additional = 0; additional < parameters.parameter[parameter_counter].has_additional; additional++) {
                 needs_additional.array[needs_additional.used] = parameter_counter;
                 needs_additional.used++;
               } // for
@@ -153,29 +153,29 @@ extern "C" {
       else {
         found = f_false;
 
-        for (parameter_counter = 0; parameter_counter < parameters_total; parameter_counter++) {
-          if (parameters[parameter_counter].type != f_console_type_other) {
+        for (parameter_counter = 0; parameter_counter < parameters.used; parameter_counter++) {
+          if (parameters.parameter[parameter_counter].type != f_console_type_other) {
             continue;
           }
 
-          if (parameters[parameter_counter].symbol_other == 0) {
+          if (parameters.parameter[parameter_counter].symbol_other == 0) {
             continue;
           }
 
-          if (strncmp(arguments.argv[location], parameters[parameter_counter].symbol_other, string_length + 1) != 0) {
+          if (strncmp(arguments.argv[location], parameters.parameter[parameter_counter].symbol_other, string_length + 1) != 0) {
             continue;
           }
 
-          parameters[parameter_counter].result = f_console_result_found;
-          parameters[parameter_counter].location = location;
-          parameters[parameter_counter].location_sub = 0;
-          parameters[parameter_counter].total++;
+          parameters.parameter[parameter_counter].result = f_console_result_found;
+          parameters.parameter[parameter_counter].location = location;
+          parameters.parameter[parameter_counter].location_sub = 0;
+          parameters.parameter[parameter_counter].total++;
 
-          if (parameters[parameter_counter].has_additional) {
-            if (needs_additional.used + parameters[parameter_counter].has_additional > needs_additional.size) {
+          if (parameters.parameter[parameter_counter].has_additional) {
+            if (needs_additional.used + parameters.parameter[parameter_counter].has_additional > needs_additional.size) {
               f_status allocation_status = f_none;
 
-              f_macro_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters[parameter_counter].has_additional);
+              f_macro_string_lengths_resize(allocation_status, needs_additional, needs_additional.used + parameters.parameter[parameter_counter].has_additional);
 
               if (f_status_is_error(allocation_status)) {
                 f_macro_string_lengths_delete(status, needs_additional);
@@ -183,7 +183,7 @@ extern "C" {
               }
             }
 
-            for (f_array_length additional = 0; additional < parameters[parameter_counter].has_additional; additional++) {
+            for (f_array_length additional = 0; additional < parameters.parameter[parameter_counter].has_additional; additional++) {
               needs_additional.array[needs_additional.used] = parameter_counter;
               needs_additional.used++;
             } // for
@@ -194,7 +194,7 @@ extern "C" {
         } // for
 
         if (!found) {
-          // populate list of remaining parameters not associated with anything.
+          // populate list of remaining parameters.parameter not associated with anything.
           if (remaining->used >= remaining->size) {
             f_status allocation_status = f_none;
 
@@ -231,11 +231,11 @@ extern "C" {
 #endif // _di_fl_console_parameter_process_
 
 #ifndef _di_fl_console_parameter_prioritize_
-  f_return_status fl_console_parameter_prioritize(const f_console_parameter parameters[], const f_array_length parameters_total, const f_console_parameter_ids choices, f_console_parameter_id *decision) {
+  f_return_status fl_console_parameter_prioritize(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision) {
     #ifndef _di_level_1_parameter_checking_
       if (decision == 0) return f_status_set_error(f_invalid_parameter);
-      if (parameters_total == 0) return f_status_set_error(f_invalid_parameter);
-      if (choices.ids == 0) return f_status_set_error(f_invalid_parameter);
+      if (parameters.used == 0) return f_status_set_error(f_invalid_parameter);
+      if (choices.id == 0) return f_status_set_error(f_invalid_parameter);
       if (choices.used == 0) return f_status_set_error(f_invalid_parameter);
     #endif // _di_level_1_parameter_checking_
 
@@ -244,17 +244,17 @@ extern "C" {
     f_console_parameter_id priority = 0;
 
     for (f_array_length i = 0; i < choices.used; i++) {
-      if (choices.ids[i] > parameters_total) return f_status_set_error(f_invalid_parameter);
+      if (choices.id[i] > parameters.used) return f_status_set_error(f_invalid_parameter);
 
-      if (parameters[choices.ids[i]].result == f_console_result_found) {
-        if (parameters[choices.ids[i]].location > location) {
-          location = parameters[choices.ids[i]].location;
-          location_sub = parameters[choices.ids[i]].location_sub;
-          priority = choices.ids[i];
+      if (parameters.parameter[choices.id[i]].result == f_console_result_found) {
+        if (parameters.parameter[choices.id[i]].location > location) {
+          location = parameters.parameter[choices.id[i]].location;
+          location_sub = parameters.parameter[choices.id[i]].location_sub;
+          priority = choices.id[i];
         }
-        else if (parameters[choices.ids[i]].location == location && parameters[choices.ids[i]].location_sub > location_sub) {
-          location_sub = parameters[choices.ids[i]].location_sub;
-          priority = choices.ids[i];
+        else if (parameters.parameter[choices.id[i]].location == location && parameters.parameter[choices.id[i]].location_sub > location_sub) {
+          location_sub = parameters.parameter[choices.id[i]].location_sub;
+          priority = choices.id[i];
         }
       }
     } // for
index 223d67b1f7f4fbb3cabe9a6b51a5420c3709160d..eb2334a07158e09d8cc2f1d8e49d2ef93d6b1033 100644 (file)
@@ -52,8 +52,7 @@ extern "C" {
  *   The parameters passed to the process.
  * @param parameters
  *   The console parameters to look for.
- * @param parameters_total
- *   The used size of the parameters array.
+ *   This will be updated by this function with the results.
  * @param remaining
  *   A list of remaining parameters not associated with anything.
  *
@@ -64,7 +63,7 @@ extern "C" {
  *   f_reallocation_error (with error bit) on memory reallocation error.
  */
 #ifndef _di_fl_console_parameter_process_
-  extern f_return_status fl_console_parameter_process(const f_console_arguments arguments, f_console_parameter parameters[], const f_array_length parameters_total, f_string_lengths *remaining);
+  extern f_return_status fl_console_parameter_process(const f_console_arguments arguments, f_console_parameters parameters, f_string_lengths *remaining);
 #endif // _di_fl_console_parameter_process_
 
 /**
@@ -81,8 +80,6 @@ extern "C" {
  *
  * @param parameters
  *   The parameters to process.
- * @param parameters_total
- *   The used size of the parameters array.
  * @param choices
  *   An array of numeric ids, each representing a parameter within the parameters variable.
  *   The order does not matter.
@@ -96,7 +93,7 @@ extern "C" {
  *   f_invalid_parameter (with error bit) if a parameter is invalid.
  */
 #ifndef _di_fl_console_parameter_prioritize__
-  extern f_return_status fl_console_parameter_prioritize(const f_console_parameter parameters[], const f_array_length parameters_total, const f_console_parameter_ids choices, f_console_parameter_id *decision);
+  extern f_return_status fl_console_parameter_prioritize(const f_console_parameters parameters, const f_console_parameter_ids choices, f_console_parameter_id *decision);
 #endif // _di_fl_console_parameter_prioritize__
 
 #ifdef __cplusplus
index 184ca4bc02731712c5af193f9620161656497137..175af26590212b70bcfcc7c67e45a650ba90dd95 100644 (file)
@@ -79,20 +79,20 @@ extern "C" {
 #endif // _di_fll_program_print_version_
 
 #ifndef _di_fll_program_process_parameters_
-  f_return_status fll_program_process_parameters(const f_console_arguments arguments, f_console_parameter parameters[], const f_array_length parameters_total, const f_array_length parameter_no_color, const f_array_length parameter_light, const f_array_length parameter_dark, f_string_lengths *remaining, fl_color_context *context) {
+  f_return_status fll_program_process_parameters(const f_console_arguments arguments, f_console_parameters parameters, const f_array_length parameter_no_color, const f_array_length parameter_light, const f_array_length parameter_dark, f_string_lengths *remaining, fl_color_context *context) {
     f_status status = f_none;
     f_status allocation_status = f_none;
 
-    status = fl_console_parameter_process(arguments, parameters, parameters_total, remaining);
+    status = fl_console_parameter_process(arguments, parameters, remaining);
 
     f_console_parameter_ids choices = f_console_parameter_ids_initialize;
     f_console_parameter_id decision = parameter_dark;
     f_console_parameter_id ids[3] = { parameter_no_color, parameter_light, parameter_dark};
 
-    choices.ids = ids;
+    choices.id = ids;
     choices.used = 3;
 
-    fl_console_parameter_prioritize(parameters, parameters_total, choices, &decision);
+    fl_console_parameter_prioritize(parameters, choices, &decision);
 
     // load colors unless told not to.
     if (decision != parameter_no_color) {
index 2a5b86518e3acf6c348a4703c7a3befd08ff022c..923aa7cc35446b5ec270a3d35490d2b5a2f18b0a 100644 (file)
@@ -124,8 +124,6 @@ extern "C" {
  *   The parameters passed to the process.
  * @param parameters
  *   The console parameters to look for.
- * @param parameters_total
- *   The used size of the parameters array.
  * @param parameter_no_color
  *   The parameter in the parameters array representing the no-color option.
  * @param parameter_light
@@ -144,7 +142,7 @@ extern "C" {
  *   f_reallocation_error (with error bit) on memory reallocation error.
  */
 #ifndef _di_fll_program_process_parameters_
-  extern f_return_status fll_program_process_parameters(const f_console_arguments arguments, f_console_parameter parameters[], const f_array_length parameters_total, const f_array_length parameter_no_color, const f_array_length parameter_light, const f_array_length parameter_dark, f_string_lengths *remaining, fl_color_context *context);
+  extern f_return_status fll_program_process_parameters(const f_console_arguments arguments, f_console_parameters parameters, const f_array_length parameter_no_color, const f_array_length parameter_light, const f_array_length parameter_dark, f_string_lengths *remaining, fl_color_context *context);
 #endif // _di_fll_program_process_parameters_
 
 #ifdef __cplusplus
index b4a9a39dd04be17a777359d70d07e1b79e343947..c3362ae36545d51f1a8d873b7769fd4d0d311661 100644 (file)
@@ -40,7 +40,12 @@ extern "C" {
 
 #ifndef _di_bit_dump_main_
   f_return_status bit_dump_main(const f_console_arguments arguments, bit_dump_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, bit_dump_total_parameters, bit_dump_parameter_no_color, bit_dump_parameter_light, bit_dump_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, bit_dump_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, bit_dump_parameter_no_color, bit_dump_parameter_light, bit_dump_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       bit_dump_delete_data(data);
index 39d400731fcd9b729db392aeda4d517e9928f274..7d9fa5bb4f09595adbc525a38bb1080b03d9fdfd 100644 (file)
@@ -56,7 +56,12 @@ extern "C" {
 
 #ifndef _di_firewall_main_
   f_return_status firewall_main(const f_console_arguments arguments, firewall_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, firewall_total_parameters, firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, firewall_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, firewall_parameter_no_color, firewall_parameter_light, firewall_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       firewall_delete_data(data);
index f8573dfc68fa68e6b5a77642f4de96513c09128f..26e75f32295375c258aaf783cc8167cc09c43a7b 100644 (file)
@@ -33,7 +33,12 @@ extern "C" {
   f_return_status fss_basic_list_read_main_process_file(const f_console_arguments arguments, fss_basic_list_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility ("internal")));
 
   f_return_status fss_basic_list_read_main(const f_console_arguments arguments, fss_basic_list_read_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_basic_list_read_total_parameters, fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_basic_list_read_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_basic_list_read_parameter_no_color, fss_basic_list_read_parameter_light, fss_basic_list_read_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_basic_list_read_delete_data(data);
index 642825371c6341f3ad09e60f66100d40fd2210b8..4cca4dc4b52a8a44ab35297ed1e3a4bbe0064a9e 100644 (file)
@@ -28,7 +28,12 @@ extern "C" {
 
 #ifndef _di_fss_basic_list_write_main_
   f_return_status fss_basic_list_write_main(const f_console_arguments arguments, fss_basic_list_write_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_basic_list_write_total_parameters, fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_basic_list_write_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_basic_list_write_parameter_no_color, fss_basic_list_write_parameter_light, fss_basic_list_write_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_basic_list_write_delete_data(data);
index fc73792d55b96e7be12ddaf95a28bd8eb3dc9ebc..611467a5dabc971fd60e8ff921980cbdbc99ba1e 100644 (file)
@@ -31,7 +31,12 @@ extern "C" {
   f_return_status fss_basic_read_main_process_file(const f_console_arguments arguments, fss_basic_read_data *data, const f_string filename, const f_string_length target) f_gcc_attribute_visibility_internal;
 
   f_return_status fss_basic_read_main(const f_console_arguments arguments, fss_basic_read_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_basic_read_total_parameters, fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_basic_read_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_basic_read_parameter_no_color, fss_basic_read_parameter_light, fss_basic_read_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_basic_read_delete_data(data);
index 966ab7ce276d4d46b2afe3c79de40fd8322b5da4..3c28a6d9c2e346ddb509089cb01c03318248286f 100644 (file)
@@ -28,7 +28,12 @@ extern "C" {
 
 #ifndef _di_fss_basic_write_main_
   f_return_status fss_basic_write_main(const f_console_arguments arguments, fss_basic_write_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_basic_write_total_parameters, fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_basic_write_total_parameters };
+       status = fll_program_process_parameters(arguments, parameters, fss_basic_write_parameter_no_color, fss_basic_write_parameter_light, fss_basic_write_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_basic_write_delete_data(data);
index 9e98b042567dd1bae4e073113b8168d2dedd9850..6ce66f297088bcab0a604a3180bdb879b3aded10 100644 (file)
@@ -32,7 +32,12 @@ extern "C" {
   f_return_status fss_extended_read_main_process_file(const f_console_arguments arguments, fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) f_gcc_attribute_visibility_internal;
 
   f_return_status fss_extended_read_main(const f_console_arguments arguments, fss_extended_read_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_extended_read_total_parameters, fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_extended_read_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_extended_read_parameter_no_color, fss_extended_read_parameter_light, fss_extended_read_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_extended_read_delete_data(data);
index 226efcb41174ec19ed0ccc613f81252140114d8e..fcf36ed1c53eeda12a69ddecb4e753487745d27b 100644 (file)
@@ -29,7 +29,12 @@ extern "C" {
 
 #ifndef _di_fss_extended_write_main_
   f_return_status fss_extended_write_main(const f_console_arguments arguments, fss_extended_write_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_extended_write_total_parameters, fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_extended_write_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_extended_write_parameter_no_color, fss_extended_write_parameter_light, fss_extended_write_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_extended_write_delete_data(data);
index 453ff0611f6a8c5ae4d4e1ef0ddd2c343cd13fa0..796e04cdca4c8e4de6f95d92bd5f0144fd87f841 100644 (file)
@@ -29,7 +29,12 @@ extern "C" {
 
 #ifndef _di_fss_status_code_main_
   f_return_status fss_status_code_main(const f_console_arguments arguments, fss_status_code_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, fss_status_code_total_parameters, fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, fss_status_code_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, fss_status_code_parameter_no_color, fss_status_code_parameter_light, fss_status_code_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       fss_status_code_delete_data(data);
index 46c9aac511d801beacec6316e68c05ef74b9532b..b84189367066c1901018a6c0f0bfcf272f3a0e45 100644 (file)
@@ -52,7 +52,10 @@ extern "C" {
     f_u_short do_socket_file = f_true;
     f_u_short do_socket_port = f_false;
 
-    status = fll_program_process_parameters(arguments, data->parameters, init_total_parameters, init_parameter_no_color, init_parameter_light, init_parameter_dark, &data->remaining, &data->context);
+    {
+      f_console_parameters parameters = { data->parameters, init_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, init_parameter_no_color, init_parameter_light, init_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       init_delete_data(data);
index 1dcf67fdd6e3d200491ace970ad9166496d5da72..634cba032da0a7951e0134f3bdeb7b69075bcf7e 100644 (file)
@@ -29,7 +29,12 @@ extern "C" {
 
 #ifndef _di_status_code_main_
   f_return_status status_code_main(const f_console_arguments arguments, status_code_data *data) {
-    f_status status = fll_program_process_parameters(arguments, data->parameters, status_code_total_parameters, status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark, &data->remaining, &data->context);
+    f_status status = f_none;
+
+    {
+      f_console_parameters parameters = { data->parameters, status_code_total_parameters };
+      status = fll_program_process_parameters(arguments, parameters, status_code_parameter_no_color, status_code_parameter_light, status_code_parameter_dark, &data->remaining, &data->context);
+    }
 
     if (f_status_is_error(status)) {
       status_code_delete_data(data);