]> Kevux Git Server - fll/commitdiff
Progress: Continue mass converting to f_string_static_t.
authorKevin Day <thekevinday@gmail.com>
Fri, 11 Feb 2022 04:32:22 +0000 (22:32 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 11 Feb 2022 04:32:22 +0000 (22:32 -0600)
This should get all of the programs compiling again.
There is still more work to do with switching to f_string_static_t, but the current pass is considered complete.
Another pass will follow up shortly.

52 files changed:
level_1/fl_print/c/private-print.c
level_1/fl_string/c/string.c
level_1/fl_string/c/string.h
level_2/fll_fss/c/fss.c
level_2/fll_fss/c/fss.h
level_3/control/c/control.h
level_3/control/c/private-common.h
level_3/control/data/build/dependencies
level_3/control/data/build/settings
level_3/controller/c/control/private-control.c
level_3/controller/c/controller/private-controller.c
level_3/fake/c/private-make-operate_process_type.c
level_3/fake/c/private-make-operate_validate.c
level_3/fss_basic_list_read/c/private-common.h
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-common.h
level_3/fss_basic_read/c/private-read.c
level_3/fss_basic_read/c/private-read.h
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_embedded_list_write/c/private-write.c
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-common.h
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_list_read/c/private-read.h
level_3/fss_extended_list_write/c/common.h
level_3/fss_extended_list_write/c/fss_extended_list_write.c
level_3/fss_extended_list_write/c/private-write.c
level_3/fss_extended_read/c/common.h
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-common.h
level_3/fss_extended_read/c/private-read.c
level_3/fss_extended_read/c/private-read.h
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/private-write.c
level_3/fss_extended_write/c/private-write.h
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/private-common.h
level_3/fss_identify/c/private-identify.c
level_3/fss_identify/c/private-identify.h
level_3/fss_identify/c/private-print.c
level_3/fss_identify/c/private-print.h
level_3/fss_payload_read/c/common.c
level_3/fss_payload_read/c/common.h
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/private-common.h
level_3/fss_payload_read/c/private-read.c
level_3/fss_payload_read/c/private-read.h
level_3/fss_payload_write/c/common.c
level_3/fss_payload_write/c/fss_payload_write.c
level_3/fss_payload_write/c/private-write.c
level_3/fss_payload_write/c/private-write.h
level_3/utf8/c/private-common.h

index 61592ad9e40103589f15c514fe3a196395f05292..f7df6262cb5b60f232dd49aa34c01ddeea2ae689 100644 (file)
@@ -1034,50 +1034,50 @@ extern "C" {
         char format[32];
         char buffer[128];
 
-        format[f++] = '%';
+        format[f++] = f_string_ascii_percent_s.string[0];
 
         if (flag & F_print_format_flag_sign_always_d) {
-          format[f++] = '+';
+          format[f++] = f_string_ascii_plus_s.string[0];
         }
         else if (flag & F_print_format_flag_sign_pad_d) {
-          format[f++] = ' ';
+          format[f++] = f_string_ascii_space_s.string[0];
         }
 
         if (flag & F_print_format_flag_align_left_d) {
-          format[f++] = '-';
+          format[f++] = f_string_ascii_minus_s.string[0];
         }
 
         if (flag & F_print_format_flag_zeros_leading_d) {
-          format[f++] = '0';
+          format[f++] = f_string_ascii_0_s.string[0];
         }
 
         if (flag & F_print_format_flag_width_d) {
-          format[f++] = '*';
+          format[f++] = f_string_ascii_asterisk_s.string[0];
         }
 
         if (flag & F_print_format_flag_precision_d) {
-          format[f++] = '.';
-          format[f++] = '*';
+          format[f++] = f_string_ascii_period_s.string[0];
+          format[f++] = f_string_ascii_asterisk_s.string[0];
         }
 
         if (flag & F_print_format_flag_exponent_d) {
           if (flag & F_print_format_flag_exponent_upper_d) {
-            format[f++] = 'E';
+            format[f++] = f_string_ascii_E_s.string[0];
           }
           else {
-            format[f++] = 'e';
+            format[f++] = f_string_ascii_e_s.string[0];
           }
         }
         else if (flag & F_print_format_flag_exponent_either_d) {
           if (flag & F_print_format_flag_exponent_upper_d) {
-            format[f++] = 'G';
+            format[f++] = f_string_ascii_G_s.string[0];
           }
           else {
-            format[f++] = 'g';
+            format[f++] = f_string_ascii_g_s.string[0];
           }
         }
         else {
-          format[f++] = 'f';
+          format[f++] = f_string_ascii_f_s.string[0];
         }
 
         format[f] = 0;
@@ -1415,7 +1415,7 @@ extern "C" {
 
       status = f_utf_is_whitespace(string + i, (length - i) + 1);
 
-      // consider invalid data not-whitespace.
+      // Consider invalid data not-whitespace.
       if (F_status_is_error(status) || status == F_false) break;
 
       i += macro_f_utf_byte_width(string[i]);
@@ -1449,7 +1449,7 @@ extern "C" {
 
       status = f_utf_is_whitespace(string + i, (length - i) + 1);
 
-      // determine if this is an end of string whitespace that needs to be trimmed.
+      // Determine if this is an end of string whitespace that needs to be trimmed.
       if (status == F_true || !string[i]) {
         j = i + macro_f_utf_byte_width(string[i]);
         status = F_none;
index 98f623986599354f877030cb35b809126a3ddc16..12592d90ab2330d3571ce5d0fa544a02db62aa16 100644 (file)
@@ -682,7 +682,7 @@ extern "C" {
 #endif // _di_fl_string_dynamic_seek_to_utf_character_
 
 #ifndef _di_fl_string_fll_identify_
-  f_status_t fl_string_fll_identify(const f_string_t buffer, f_string_range_t *range, f_fll_id_t *id) {
+  f_status_t fl_string_fll_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_id_t *id) {
     #ifndef _di_level_1_parameter_checking_
       if (!range) return F_status_set_error(F_parameter);
     #endif // _di_level_1_parameter_checking_
@@ -694,7 +694,7 @@ extern "C" {
 
     // Skip past all leading NULLs.
     for (; range->start <= range->stop; ++range->start) {
-      if (buffer[range->start]) break;
+      if (buffer.string[range->start]) break;
     } // for
 
     if (range->start > range->stop) {
@@ -707,13 +707,13 @@ extern "C" {
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       return F_found_not;
@@ -723,7 +723,7 @@ extern "C" {
 
     for (; range->start <= range->stop; ) {
 
-      status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+      status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
 
       if (F_status_is_error(status)) {
         if (F_status_set_fine(status) == F_maybe) {
@@ -734,7 +734,7 @@ extern "C" {
       }
 
       if (status == F_false) {
-        if (!buffer[range->start]) {
+        if (!buffer.string[range->start]) {
           ++range->start;
 
           continue;
@@ -743,13 +743,13 @@ extern "C" {
         break;
       }
 
-      if (buffer[range->start] == f_string_eol_s.string[0]) {
+      if (buffer.string[range->start] == f_string_eol_s.string[0]) {
         ++range->start;
 
         return F_found_not;
       }
 
-      range->start += macro_f_utf_byte_width(buffer[range->start]);
+      range->start += macro_f_utf_byte_width(buffer.string[range->start]);
     } // for
 
     if (range->start > range->stop) {
@@ -761,13 +761,13 @@ extern "C" {
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       return F_found_not;
@@ -777,11 +777,11 @@ extern "C" {
 
     for (; range->start <= range->stop; ) {
 
-      status = f_utf_is_word(buffer + range->start, (range->stop - range->start) + 1, F_true);
+      status = f_utf_is_word(buffer.string + range->start, (range->stop - range->start) + 1, F_true);
       if (F_status_is_error(status)) return status;
 
       if (status == F_false) {
-        if (!buffer[range->start]) {
+        if (!buffer.string[range->start]) {
           ++range->start;
 
           continue;
@@ -790,21 +790,21 @@ extern "C" {
         break;
       }
 
-      range->start += macro_f_utf_byte_width(buffer[range->start]);
+      range->start += macro_f_utf_byte_width(buffer.string[range->start]);
     } // for
 
-    if (range->start > range->stop || buffer[range->start] != f_string_ascii_minus_s.string[0]) {
+    if (range->start > range->stop || buffer.string[range->start] != f_string_ascii_minus_s.string[0]) {
 
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       return F_found_not;
@@ -817,18 +817,18 @@ extern "C" {
       for (++range->start; range->start <= range->stop && j < 4; ++range->start, ++j) {
 
         // The hexidecimal representing the number may only be ASCII.
-        if (macro_f_utf_byte_width_is(buffer[range->start])) {
+        if (macro_f_utf_byte_width_is(buffer.string[range->start])) {
 
           // Increment until stop, while taking into consideration UTF-8 character widths.
           for (; range->start <= range->stop; ) {
 
-            if (buffer[range->start] == f_string_eol_s.string[0]) {
+            if (buffer.string[range->start] == f_string_eol_s.string[0]) {
               ++range->start;
 
               break;
             }
 
-            range->start += macro_f_utf_byte_width(buffer[range->start]);
+            range->start += macro_f_utf_byte_width(buffer.string[range->start]);
           } // for
 
           if (id) {
@@ -838,11 +838,11 @@ extern "C" {
           return F_found_not;
         }
 
-        if (isxdigit(buffer[range->start])) {
-          number[j] = buffer[range->start];
+        if (isxdigit(buffer.string[range->start])) {
+          number[j] = buffer.string[range->start];
         }
         else {
-          if (!buffer[range->start]) continue;
+          if (!buffer.string[range->start]) continue;
 
           break;
         }
@@ -858,13 +858,13 @@ extern "C" {
         // Increment until stop, while taking into consideration UTF-8 character widths.
         for (; range->start <= range->stop; ) {
 
-          if (buffer[range->start] == f_string_eol_s.string[0]) {
+          if (buffer.string[range->start] == f_string_eol_s.string[0]) {
             ++range->start;
 
             break;
           }
 
-          range->start += macro_f_utf_byte_width(buffer[range->start]);
+          range->start += macro_f_utf_byte_width(buffer.string[range->start]);
         } // for
 
         if (id) {
@@ -875,14 +875,14 @@ extern "C" {
       }
     }
 
-    // skip past all NULLs.
+    // Skip past all NULLs.
     for (; range->start <= range->stop; ++range->start) {
-      if (buffer[range->start]) break;
+      if (buffer.string[range->start]) break;
     } // for
 
     // The end of line, whitespace, or range stop point are the only valid stop points.
     if (range->start <= range->stop) {
-      status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+      status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
 
       if (F_status_is_error(status)) {
         if (id) {
@@ -897,13 +897,13 @@ extern "C" {
         // Increment until stop, while taking into consideration UTF-8 character widths.
         for (; range->start <= range->stop; ) {
 
-          if (buffer[range->start] == f_string_eol_s.string[0]) {
+          if (buffer.string[range->start] == f_string_eol_s.string[0]) {
             ++range->start;
 
             break;
           }
 
-          range->start += macro_f_utf_byte_width(buffer[range->start]);
+          range->start += macro_f_utf_byte_width(buffer.string[range->start]);
         } // for
 
         if (id) {
@@ -914,17 +914,17 @@ extern "C" {
       }
     }
 
-    if (buffer[range->start] == f_string_eol_s.string[0]) {
+    if (buffer.string[range->start] == f_string_eol_s.string[0]) {
       ++range->start;
     }
 
     if (id) {
       for (f_array_length_t j = i, i = 0; j <= range->stop; ++j) {
 
-        if (!buffer[j]) continue;
-        if (buffer[j] == f_string_ascii_minus_s.string[0]) break;
+        if (!buffer.string[j]) continue;
+        if (buffer.string[j] == f_string_ascii_minus_s.string[0]) break;
 
-        id->name[i] = buffer[j];
+        id->name[i] = buffer.string[j];
         ++i;
       } // for
 
index 08dce11bc0021ebe12133acc21554f77957aa05b..fa7d68946feee5cece6d684bcbcb420b96193a6e 100644 (file)
@@ -967,7 +967,7 @@ extern "C" {
  * @see f_utf_is_word()
  */
 #ifndef _di_fl_string_fll_identify_
-  extern f_status_t fl_string_fll_identify(const f_string_t buffer, f_string_range_t *range, f_fll_id_t *id);
+  extern f_status_t fl_string_fll_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_id_t *id);
 #endif // _di_fl_string_fll_identify_
 
 /**
index bb5be88b33fa6f6876dca1680a548fd8c191668d..c886d8b51028989980e6cba009287ed4a14466ed 100644 (file)
@@ -6,14 +6,14 @@ extern "C" {
 #endif
 
 #ifndef _di_fll_fss_identify_
-  f_status_t fll_fss_identify(const f_string_t buffer, f_string_range_t *range, f_fll_ids_t *ids) {
+  f_status_t fll_fss_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_ids_t *ids) {
     #ifndef _di_level_2_parameter_checking_
       if (!range) return F_status_set_error(F_parameter);
     #endif // _di_level_2_parameter_checking_
 
     // Skip past all NULLs.
     for (; range->start <= range->stop; ++range->start) {
-      if (buffer[range->start]) break;
+      if (buffer.string[range->start]) break;
     }
 
     if (range->start > range->stop) {
@@ -21,18 +21,18 @@ extern "C" {
     }
 
     // The first character must be a '#'.
-    if (buffer[range->start] != f_fss_pound_s.string[0]) {
+    if (buffer.string[range->start] != f_fss_pound_s.string[0]) {
 
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       if (ids) {
@@ -44,7 +44,7 @@ extern "C" {
 
     // skip past all NULLs after the '#'.
     for (++range->start; range->start <= range->stop; ++range->start) {
-      if (buffer[range->start]) break;
+      if (buffer.string[range->start]) break;
     }
 
     if (range->start > range->stop) {
@@ -61,13 +61,13 @@ extern "C" {
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       if (ids) {
@@ -77,7 +77,7 @@ extern "C" {
       return F_found_not;
     }
 
-    f_status_t status = f_utf_is_whitespace(buffer + range->start, (range->stop - range->start) + 1);
+    f_status_t status = f_utf_is_whitespace(buffer.string + range->start, (range->stop - range->start) + 1);
 
     if (F_status_is_error(status)) {
       if (F_status_set_fine(status) == F_maybe) {
@@ -92,19 +92,19 @@ extern "C" {
       // Increment until stop, while taking into consideration UTF-8 character widths.
       for (; range->start <= range->stop; ) {
 
-        if (buffer[range->start] == f_string_eol_s.string[0]) {
+        if (buffer.string[range->start] == f_string_eol_s.string[0]) {
           ++range->start;
 
           break;
         }
 
-        range->start += macro_f_utf_byte_width(buffer[range->start]);
+        range->start += macro_f_utf_byte_width(buffer.string[range->start]);
       } // for
 
       return F_found_not;
     }
 
-    if (buffer[range->start] == f_string_eol_s.string[0]) {
+    if (buffer.string[range->start] == f_string_eol_s.string[0]) {
       ++range->start;
 
       if (ids) {
index 69783fbf30908cd2fdec2d55b26e259b1b4d7788..f116306c2262c61406b3b761e670c25ff72b9237 100644 (file)
@@ -74,7 +74,7 @@ extern "C" {
  * @see fl_string_fll_identify()
  */
 #ifndef _di_fll_fss_identify_
-  extern f_status_t fll_fss_identify(const f_string_t buffer, f_string_range_t *range, f_fll_ids_t *ids);
+  extern f_status_t fll_fss_identify(const f_string_static_t buffer, f_string_range_t *range, f_fll_ids_t *ids);
 #endif // _di_fll_fss_identify_
 
 /**
index 7c2b6770a6361c920a4190719b50e034a466a5a8..b3bc210c311d5071d271006d00d607435df75e48 100644 (file)
@@ -27,6 +27,7 @@
 #include <fll/level_0/directory.h>
 #include <fll/level_0/file.h>
 #include <fll/level_0/fss.h>
+#include <fll/level_0/path.h>
 #include <fll/level_0/pipe.h>
 #include <fll/level_0/print.h>
 #include <fll/level_0/signal.h>
index dcfea3aeb05567be46f0f2a98b427a82db9f4262..2fafdbfda35822e233d127a81e450a3adb292b61 100644 (file)
@@ -236,10 +236,10 @@ extern "C" {
 /**
  * The control data.
  *
+ * argv:    The argument structure in the progam data parameters for simplifying syntax.
  * command: The command type code.
  * cache:   A cache.
  * socket:  A socket used to connect to the controller.
- * argv:    The argument structure in fll_program_data_t.parameters for simplifying syntax.
  */
 #ifndef _di_control_data_t_
   typedef struct {
index 0e9b310d373a7b6f8c454644d715d869075268ac..7af7025df8796f4b40392b336b19666414ddd2f1 100644 (file)
@@ -9,6 +9,7 @@ f_color
 f_console
 f_file
 f_fss
+f_path
 f_pipe
 f_print
 f_signal
index 0a5a10b5ad1a91fbd18188c787c5dd5415eb3949..d1d6ca7c1de17fa9814573f33b565c97561f1a6f 100644 (file)
@@ -21,7 +21,7 @@ build_indexer ar
 build_indexer_arguments rcs
 build_language c
 build_libraries -lc
-build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_pipe -lf_print -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
index 9159d5f5741ad56782689b217201db5bf40f237e..6dad89fea6e6170d744c844e174d64313b0a841e 100644 (file)
@@ -131,8 +131,6 @@ extern "C" {
 
     // @todo process the data.
 
-    fll_print_format("\nDEBUG: received packet: '%Q'\n", stdout, control->input);
-
     // @todo send any responses.
 
     f_socket_disconnect(&client, f_socket_close_fast_e);
index 38078b7593b69c6958eaecfaa3cca6d53923ac4d..273c5d29fcf6cea137c94cf49c73fc9cb5d1da58 100644 (file)
@@ -19,7 +19,7 @@ extern "C" {
 
       if (!buffer.string[result.start]) continue;
 
-      if (buffer.string[result.start] == '-' || buffer.string[result.start] == '+') {
+      if (buffer.string[result.start] == f_string_ascii_minus_s.string[0] || buffer.string[result.start] == f_string_ascii_plus_s.string[0]) {
         ++result.start;
       }
 
index f5ed6c38b5f5cd91df326561284ae15c6d9b7eb2..dcdcc15603c021d98a74e61b834df489717b9d4f 100644 (file)
@@ -641,10 +641,10 @@ extern "C" {
     range.start = 0;
     range.stop = arguments.array[i].used - 1;
 
-    if (arguments.array[i].string[0] == '+') {
+    if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
       range.start = 1;
     }
-    else if (arguments.array[i].string[0] == '-') {
+    else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
       range.start = 1;
       is_negative_left = F_true;
     }
@@ -665,10 +665,10 @@ extern "C" {
 
           is_negative_right = F_false;
 
-          if (arguments.array[i].string[0] == '+') {
+          if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
             range.start = 1;
           }
-          else if (arguments.array[i].string[0] == '-') {
+          else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
             range.start = 1;
             is_negative_right = F_true;
           }
index e48a6966770d8186428a7be81ce065e7cf07eb4b..7f0d47bdb9c90c13e0c2f9690b0ad94f2135f6ac 100644 (file)
@@ -1004,10 +1004,10 @@ extern "C" {
                 range.start = 0;
                 range.stop = arguments.array[i].used - 1;
 
-                if (arguments.array[i].string[0] == '+') {
+                if (arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) {
                   range.start = 1;
                 }
-                else if (arguments.array[i].string[0] == '-') {
+                else if (arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) {
                   range.start = 1;
                   is_negative = F_true;
                 }
index 46e122beb12625c17e923c25b0388dcb0e94d01d..3d85cdf6498ad6c7b2d2cee924f7dd1297cb8d9b 100644 (file)
@@ -140,6 +140,7 @@ extern "C" {
  *   - total:   The total lines found and selected is printed instead of the Content.
  *   - trim:    Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *
+ * argv:             The argument structure in the progam data parameters for simplifying syntax.
  * options:          Bitwise flags representing parameters.
  * delimit_mode:     The delimit mode.
  * delimit_depth:    The delimit depth.
index af533bfc4187e7e02ee26c159498828a4d295c93..46aba998e4f29f6b993a1abd73d11d2039e8ed5e 100644 (file)
@@ -195,8 +195,6 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     status = F_none;
 
     if (main->parameters.array[fss_basic_read_parameter_help_e].result == f_console_result_found_e) {
@@ -219,6 +217,7 @@ extern "C" {
     fss_basic_read_file_t files_array[main->parameters.remaining.used + 1];
     fss_basic_read_data_t data = fss_basic_read_data_t_initialize;
 
+    data.argv = main->parameters.arguments.array;
     data.files.array = files_array;
     data.files.used = 1;
     data.files.size = main->parameters.remaining.used + 1;
@@ -367,7 +366,7 @@ extern "C" {
           }
 
           index = main->parameters.array[fss_basic_read_parameter_delimit_e].values.array[i];
-          length = argv[index].used;
+          length = data.argv[index].used;
 
           if (!length) {
             flockfile(main->error.to.stream);
@@ -382,13 +381,13 @@ extern "C" {
 
             break;
           }
-          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, argv[index]) == F_equal_to) {
+          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, data.argv[index]) == F_equal_to) {
             data.delimit_mode = fss_basic_read_delimit_mode_none_e;
           }
-          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, argv[index]) == F_equal_to) {
+          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, data.argv[index]) == F_equal_to) {
             data.delimit_mode = fss_basic_read_delimit_mode_all_e;
           }
-          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, argv[index]) == F_equal_to) {
+          else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, data.argv[index]) == F_equal_to) {
             switch (data.delimit_mode) {
               case 0:
                 data.delimit_mode = fss_basic_read_delimit_mode_object_e;
@@ -425,7 +424,7 @@ extern "C" {
               data.delimit_mode = fss_basic_read_delimit_mode_content_object_e;
             }
 
-            if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) {
+            if (data.argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) {
               if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_basic_read_delimit_mode_content_greater_object_e;
@@ -438,7 +437,7 @@ extern "C" {
               // Shorten the length to better convert the remainder to a number.
               --length;
             }
-            else if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) {
+            else if (data.argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) {
               if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_basic_read_delimit_mode_content_lesser_object_e;
@@ -455,14 +454,14 @@ extern "C" {
             f_string_range_t range = macro_f_string_range_t_initialize(length);
 
             // Ignore leading plus sign.
-            if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
+            if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
               ++range.start;
             }
 
-            status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.delimit_depth);
+            status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
 
             if (F_status_is_error(status)) {
-              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_delimit_s, argv[index]);
+              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_delimit_s, data.argv[index]);
 
               break;
             }
@@ -488,7 +487,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_basic_read_depth_process(main, arguments, &data);
+        status = fss_basic_read_depth_process(main, &data);
       }
 
       // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
@@ -568,10 +567,10 @@ extern "C" {
           file.stream = 0;
           file.id = -1;
 
-          status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+          status = f_file_stream_open(data.argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -580,7 +579,7 @@ extern "C" {
           status = f_file_size_by_id(file.id, &size_file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -591,13 +590,13 @@ extern "C" {
             status = f_file_stream_read(file, &data.buffer);
 
             if (F_status_is_error(status)) {
-              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
               break;
             }
 
             if (data.buffer.used > data.files.array[data.files.used].range.start) {
-              data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+              data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
               data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
 
               // This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
@@ -620,7 +619,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_basic_read_process(main, arguments, &data);
+        status = fss_basic_read_process(main, &data);
       }
 
       fss_basic_read_data_delete_simple(&data);
index 99955fead8a80fd9a2f5b9c043c87562909fed2e..bab1c6d56c5369f0943547a3dd90e1709cd03020 100644 (file)
@@ -140,6 +140,7 @@ extern "C" {
  *   - total:   The total lines found and selected is printed instead of the Content.
  *   - trim:    Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *
+ * argv:          The argument structure in the progam data parameters for simplifying syntax.
  * options:       Bitwise flags representing parameters.
  * delimit_mode:  The delimit mode.
  * delimit_depth: The delimit depth.
@@ -172,6 +173,8 @@ extern "C" {
     f_number_unsigned_t select;
     f_number_unsigned_t line;
 
+    f_string_static_t *argv;
+
     fss_basic_read_files_t files;
     fss_basic_read_depths_t depths;
 
@@ -189,6 +192,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
       fss_basic_read_files_t_initialize, \
       fss_basic_read_depths_t_initialize, \
       f_string_dynamic_t_initialize, \
index a8016a20e3c7ac771a30816018e919ae3b541aa8..101a308363ac3c924d6b83e76b7500e547424d4f 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_basic_read_delimit_object_is_
-  f_status_t fss_basic_read_delimit_object_is(const f_array_length_t depth, fss_basic_read_data_t * const data) {
+  f_status_t fss_basic_read_delimit_object_is(fss_basic_read_data_t * const data, const f_array_length_t depth) {
 
     switch (data->delimit_mode) {
       case fss_basic_read_delimit_mode_none_e:
@@ -33,7 +33,7 @@ extern "C" {
 #endif // _di_fss_basic_read_delimit_object_is_
 
 #ifndef _di_fss_basic_read_depth_process_
-  f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+  f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -61,8 +61,6 @@ extern "C" {
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (fss_basic_read_signal_received(main)) {
@@ -82,12 +80,12 @@ extern "C" {
       else {
         position_depth = main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i];
 
-        const f_string_range_t range = macro_f_string_range_t_initialize(argv[position_depth].used);
+        const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
 
-        status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth);
+        status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
 
         if (F_status_is_error(status)) {
-          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_depth_s, argv[position_depth]);
+          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_depth_s, data->argv[position_depth]);
 
           return status;
         }
@@ -106,12 +104,12 @@ extern "C" {
 
           data->depths.array[i].index_at = main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at];
 
-          const f_string_range_t range = macro_f_string_range_t_initialize(argv[data->depths.array[i].index_at].used);
+          const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
 
-          status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+          status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
 
           if (F_status_is_error(status)) {
-            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_at_s, argv[data->depths.array[i].index_at]);
+            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_at_s, data->argv[data->depths.array[i].index_at]);
 
             return status;
           }
@@ -132,10 +130,10 @@ extern "C" {
           data->depths.array[i].index_name = main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name];
 
           if (main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) {
-            status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
+            status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
           }
           else {
-            status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+            status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
           }
 
           if (F_status_is_error(status)) {
@@ -215,7 +213,7 @@ extern "C" {
 #endif // _di_fss_basic_read_file_identify_
 
 #ifndef _di_fss_basic_read_load_
-  f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) {
+  f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
     f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, 0, 0);
     f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
@@ -248,16 +246,16 @@ extern "C" {
 #endif // _di_fss_basic_read_load_
 
 #ifndef _di_fss_basic_read_load_number_
-  f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
+  f_status_t fss_basic_read_load_number(fll_program_data_t * const main, fss_basic_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
 
     if (main->parameters.array[parameter].result == f_console_result_additional_e) {
       const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
-      const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
+      const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
 
-      const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+      const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
 
       if (F_status_is_error(status)) {
-        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
+        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
 
         return status;
       }
@@ -270,9 +268,9 @@ extern "C" {
 #endif // _di_fss_basic_read_load_number_
 
 #ifndef _di_fss_basic_read_process_
-  f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+  f_status_t fss_basic_read_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
-    f_status_t status = fss_basic_read_process_option(main, arguments, data);
+    f_status_t status = fss_basic_read_process_option(main, data);
     if (F_status_is_error(status)) return status;
 
     // This standard does not support multiple content groups.
@@ -313,7 +311,7 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
 
     for (f_array_length_t i = 0; i < data->contents.used; ++i) {
 
@@ -327,7 +325,7 @@ extern "C" {
 #endif // _di_fss_basic_read_process_
 
 #ifndef _di_fss_basic_read_process_at_
-  f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+  f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
 
     if (data->depths.array[0].value_at >= data->objects.used) {
       if (data->option & (fss_basic_read_data_option_columns_d | fss_basic_read_data_option_total_d)) {
@@ -357,7 +355,7 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
 
     f_array_length_t at = 0;
 
@@ -424,7 +422,7 @@ extern "C" {
 #endif // _di_fss_basic_read_process_at_
 
 #ifndef _di_fss_basic_read_process_columns_
-  f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+  f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
 
     if (!(data->option & fss_basic_read_data_option_content_d)) {
       flockfile(main->output.to.stream);
@@ -458,10 +456,10 @@ extern "C" {
 #endif // _di_fss_basic_read_process_columns_
 
 #ifndef _di_fss_basic_read_process_line_
-  f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+  f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
+    f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(data, 0) ? &data->delimits : &except_none;
 
     f_array_length_t line = 0;
 
@@ -507,7 +505,7 @@ extern "C" {
 #endif // _di_fss_basic_read_process_line_
 
 #ifndef _di_fss_basic_read_process_name_
-  f_status_t fss_basic_read_process_name(fss_basic_read_data_t *data, bool names[]) {
+  f_status_t fss_basic_read_process_name(fss_basic_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
 
@@ -542,7 +540,7 @@ extern "C" {
 #endif // _di_fss_basic_read_process_name_
 
 #ifndef _di_fss_basic_read_process_option_
-  f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+  f_status_t fss_basic_read_process_option(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -565,7 +563,7 @@ extern "C" {
     if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) {
       data->option |= fss_basic_read_data_option_line_d;
 
-      status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, &data->line);
+      status = fss_basic_read_load_number(main, data, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, &data->line);
       if (F_status_is_error(status)) return status;
     }
 
@@ -584,7 +582,7 @@ extern "C" {
     if (main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_additional_e) {
       data->option |= fss_basic_read_data_option_select_d;
 
-      status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, &data->select);
+      status = fss_basic_read_load_number(main, data, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, &data->select);
       if (F_status_is_error(status)) return status;
     }
 
@@ -606,7 +604,7 @@ extern "C" {
 #endif // _di_fss_basic_read_process_option_
 
 #ifndef _di_fss_basic_read_process_total_
-  f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
+  f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) {
 
     f_array_length_t total = 0;
 
index 9e0f387f379f2de0f871e7c88fa57c75d0ebc697..d3a15ac7501ff08d0e53bd909049b9e11ce446fb 100644 (file)
@@ -15,17 +15,17 @@ extern "C" {
 /**
  * Determine if the given depth is to be delimited or not for an Object.
  *
- * @param depth
- *   The depth to check.
  * @param data
  *   The program data.
+ * @param depth
+ *   The depth to check.
  *
  * @return
  *   F_true if to apply delimits.
  *   F_false if to not apply delimits.
  */
 #ifndef _di_fss_basic_read_delimit_object_is_
-  extern f_status_t fss_basic_read_delimit_object_is(const f_array_length_t depth, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_delimit_object_is(fss_basic_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_delimit_object_is_
 
 /**
@@ -56,7 +56,7 @@ extern "C" {
  * @see fss_basic_read_depths_resize()
  */
 #ifndef _di_fss_basic_read_depth_process_
-  extern f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_depth_process_
 
 /**
@@ -100,7 +100,7 @@ extern "C" {
  * @see fss_basic_read_process_option()
  */
 #ifndef _di_fss_basic_read_load_
-  extern f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_load_
 
 /**
@@ -110,6 +110,8 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param parameter
  *   An ID representing the parameter.
  * @param name
@@ -128,7 +130,7 @@ extern "C" {
  * @see fss_basic_read_depths_resize()
  */
 #ifndef _di_fss_basic_read_load_number_
-  extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, fss_basic_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_load_number_
 
 /**
@@ -138,8 +140,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -153,7 +153,7 @@ extern "C" {
  * @see fss_basic_read_process_option()
  */
 #ifndef _di_fss_basic_read_process_
-  extern f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_
 
 /**
@@ -171,7 +171,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_basic_read_process_at_
-  extern f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_at_
 
 /**
@@ -189,7 +189,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_basic_read_process_columns_
-  extern f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_columns_
 
 /**
@@ -207,7 +207,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_basic_read_process_line_
-  extern f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_line_
 
 /**
@@ -225,7 +225,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_basic_read_process_name_
-  extern f_status_t fss_basic_read_process_name(fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_name(fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_name_
 
 /**
@@ -233,8 +233,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -248,7 +246,7 @@ extern "C" {
  * @see fss_basic_read_load_setting()
  */
 #ifndef _di_fss_basic_read_process_option_
-  extern f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_option(fll_program_data_t * const main, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_option_
 
 /**
@@ -266,7 +264,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_basic_read_process_total_
-  extern f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_basic_read_process_total_
 
 #ifdef __cplusplus
index 3a0111212ddff66cfc66e42ba471837f1d1e4bcf..7c3dd54172a464b52dd08da9aefd53fdb479b532 100644 (file)
@@ -182,10 +182,10 @@ extern "C" {
             }
           }
           else {
-            status = f_string_append(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name);
+            status = f_string_dynamic_append(argv[values_order[i]], &depths->array[depths->used].value_name);
 
             if (F_status_is_error(status)) {
-              fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
+              fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
 
               return status;
             }
index 07ec520770fc0216c1fc911770312e7fb8295ff7..5539572658515ffc75a511b927d3b9c0a132b655 100644 (file)
@@ -116,7 +116,6 @@ extern "C" {
         prepend = &main->parameters.arguments.array[index];
       }
 
-
       status = fl_fss_embedded_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, ignore, state, &range, buffer);
 
       if (F_status_is_error(status)) {
index b59601916916229838c9a19e7378a0902557767f..aa21681fc04277bff1ff4935400079279867c098 100644 (file)
@@ -195,8 +195,6 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     status = F_none;
 
     if (main->parameters.array[fss_extended_list_read_parameter_help_e].result == f_console_result_found_e) {
@@ -219,6 +217,7 @@ extern "C" {
     fss_extended_list_read_file_t files_array[main->parameters.remaining.used + 1];
     fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize;
 
+    data.argv = main->parameters.arguments.array;
     data.files.array = files_array;
     data.files.used = 1;
     data.files.size = main->parameters.remaining.used + 1;
@@ -367,7 +366,7 @@ extern "C" {
           }
 
           index = main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.array[i];
-          length = argv[index].used;
+          length = data.argv[index].used;
 
           if (!length) {
             flockfile(main->error.to.stream);
@@ -382,13 +381,13 @@ extern "C" {
 
             break;
           }
-          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_none_s.string, argv[index], fss_extended_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
+          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_none_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_none_s.used) == F_equal_to) {
             data.delimit_mode = fss_extended_list_read_delimit_mode_none_e;
           }
-          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_all_s.string, argv[index], fss_extended_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
+          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_all_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_all_s.used) == F_equal_to) {
             data.delimit_mode = fss_extended_list_read_delimit_mode_all_e;
           }
-          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_object_s.string, argv[index], fss_extended_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
+          else if (fl_string_dynamic_compare_string(fss_extended_list_read_delimit_mode_name_object_s.string, data.argv[index], fss_extended_list_read_delimit_mode_name_object_s.used) == F_equal_to) {
             switch (data.delimit_mode) {
               case 0:
                 data.delimit_mode = fss_extended_list_read_delimit_mode_object_e;
@@ -425,7 +424,7 @@ extern "C" {
               data.delimit_mode = fss_extended_list_read_delimit_mode_content_object_e;
             }
 
-            if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) {
+            if (data.argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) {
               if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_extended_list_read_delimit_mode_content_greater_object_e;
@@ -438,7 +437,7 @@ extern "C" {
               // Shorten the length to better convert the remainder to a number.
               --length;
             }
-            else if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) {
+            else if (data.argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) {
               if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_extended_list_read_delimit_mode_content_lesser_object_e;
@@ -455,14 +454,14 @@ extern "C" {
             f_string_range_t range = macro_f_string_range_t_initialize(length);
 
             // Ignore leading plus sign.
-            if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
+            if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
               ++range.start;
             }
 
-            status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.delimit_depth);
+            status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
 
             if (F_status_is_error(status)) {
-              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_delimit_s, argv[index]);
+              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_delimit_s, data.argv[index]);
 
               break;
             }
@@ -488,7 +487,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_extended_list_read_depth_process(main, arguments, &data);
+        status = fss_extended_list_read_depth_process(main, &data);
       }
 
       // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
@@ -568,10 +567,10 @@ extern "C" {
           file.stream = 0;
           file.id = -1;
 
-          status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+          status = f_file_stream_open(data.argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -580,7 +579,7 @@ extern "C" {
           status = f_file_size_by_id(file.id, &size_file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -591,12 +590,12 @@ extern "C" {
             status = f_file_stream_read(file, &data.buffer);
 
             if (F_status_is_error(status)) {
-              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
               break;
             }
             else if (data.buffer.used > data.files.array[data.files.used].range.start) {
-              data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+              data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
               data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
 
               // This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
@@ -619,7 +618,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_extended_list_read_process(main, arguments, &data);
+        status = fss_extended_list_read_process(main, &data);
       }
 
       fss_extended_list_read_data_delete_simple(&data);
index 4d4679f91481b9dbe52bb0c5dc044467a96cae5e..238f36f9e63eaba429f314af0f436a30e356e994 100644 (file)
@@ -141,6 +141,7 @@ extern "C" {
  *   - total:   The total lines found and selected is printed instead of the Content.
  *   - trim:    Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *
+ * argv:             The argument structure in the progam data parameters for simplifying syntax.
  * options:          Bitwise flags representing parameters.
  * delimit_mode:     The delimit mode.
  * delimit_depth:    The delimit depth.
@@ -174,6 +175,8 @@ extern "C" {
     f_number_unsigned_t select;
     f_number_unsigned_t line;
 
+    f_string_static_t *argv;
+
     fss_extended_list_read_files_t files;
     fss_extended_list_read_depths_t depths;
 
@@ -193,6 +196,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
       fss_extended_list_read_files_t_initialize, \
       fss_extended_list_read_depths_t_initialize, \
       f_string_dynamic_t_initialize, \
index e96ccd290df97de9c1b4993e76874b518804bad2..43d4dc58db5237433e8f45a3ecb8347121385780 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_extended_list_read_delimit_content_is_
-  f_status_t fss_extended_list_read_delimit_content_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) {
+  f_status_t fss_extended_list_read_delimit_content_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) {
 
     if (data->delimit_mode == fss_extended_list_read_delimit_mode_none_e) {
       return F_false;
@@ -31,7 +31,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_delimit_content_is_
 
 #ifndef _di_fss_extended_list_read_delimit_object_is_
-  f_status_t fss_extended_list_read_delimit_object_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) {
+  f_status_t fss_extended_list_read_delimit_object_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) {
 
     switch (data->delimit_mode) {
       case fss_extended_list_read_delimit_mode_none_e:
@@ -56,7 +56,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_delimit_object_is_
 
 #ifndef _di_fss_extended_list_read_depth_process_
-  f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+  f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -84,8 +84,6 @@ extern "C" {
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     for (f_array_length_t i = 0; i < data->depths.used; ++i) {
 
       if (fss_extended_list_read_signal_received(main)) {
@@ -105,12 +103,12 @@ extern "C" {
       else {
         position_depth = main->parameters.array[fss_extended_list_read_parameter_depth_e].values.array[i];
 
-        const f_string_range_t range = macro_f_string_range_t_initialize(argv[position_depth].used);
+        const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
 
-        status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth);
+        status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
 
         if (F_status_is_error(status)) {
-          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_depth_s, argv[position_depth]);
+          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_depth_s, data->argv[position_depth]);
 
           return status;
         }
@@ -129,12 +127,12 @@ extern "C" {
 
           data->depths.array[i].index_at = main->parameters.array[fss_extended_list_read_parameter_at_e].values.array[position_at];
 
-          const f_string_range_t range = macro_f_string_range_t_initialize(argv[data->depths.array[i].index_at].used);
+          const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
 
-          status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
+          status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
 
           if (F_status_is_error(status)) {
-            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_at_s, argv[data->depths.array[i].index_at]);
+            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_list_read_long_at_s, data->argv[data->depths.array[i].index_at]);
 
             return status;
           }
@@ -155,10 +153,10 @@ extern "C" {
           data->depths.array[i].index_name = main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name];
 
           if (main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) {
-            status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
+            status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
           }
           else {
-            status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+            status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
           }
 
           if (F_status_is_error(status)) {
@@ -237,7 +235,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_file_identify_
 
 #ifndef _di_fss_extended_list_read_load_
-  f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) {
+  f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
     f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
     f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
@@ -270,16 +268,16 @@ extern "C" {
 #endif // _di_fss_extended_list_read_load_
 
 #ifndef _di_fss_extended_list_read_load_number_
-  f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
+  f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
 
     if (main->parameters.array[parameter].result == f_console_result_additional_e) {
       const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
-      const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
+      const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
 
-      const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+      const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
 
       if (F_status_is_error(status)) {
-        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
+        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
 
         return status;
       }
@@ -292,9 +290,9 @@ extern "C" {
 #endif // _di_fss_extended_list_read_load_number_
 
 #ifndef _di_fss_extended_list_read_process_
-  f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+  f_status_t fss_extended_list_read_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
-    f_status_t status = fss_extended_list_read_process_option(main, arguments, data);
+    f_status_t status = fss_extended_list_read_process_option(main, data);
     if (F_status_is_error(status)) return status;
 
     // This standard does not support multiple content groups.
@@ -331,8 +329,8 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
 
     if (data->option & fss_extended_list_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -351,7 +349,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_
 
 #ifndef _di_fss_extended_list_read_process_at_
-  f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
 
     if (data->depths.array[0].value_at >= data->objects.used) {
       if (data->option & (fss_extended_list_read_data_option_columns_d | fss_extended_list_read_data_option_total_d)) {
@@ -366,8 +364,8 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
 
     if (data->option & fss_extended_list_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -385,7 +383,7 @@ extern "C" {
         if (data->option & fss_extended_list_read_data_option_line_d) {
           f_array_length_t line = 0;
 
-          status = fss_extended_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+          status = fss_extended_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
           if (status == F_success) return F_none;
         }
         else if (data->option & fss_extended_list_read_data_option_columns_d) {
@@ -470,7 +468,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_at_
 
 #ifndef _di_fss_extended_list_read_process_at_line_
-  f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) {
+  f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) {
 
     if (data->option & fss_extended_list_read_data_option_object_d) {
 
@@ -566,7 +564,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_at_line_
 
 #ifndef _di_fss_extended_list_read_process_columns_
-  f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
 
     if (!(data->option & fss_extended_list_read_data_option_content_d)) {
       flockfile(main->output.to.stream);
@@ -596,11 +594,11 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_columns_
 
 #ifndef _di_fss_extended_list_read_process_line_
-  f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_extended_list_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
 
     if (data->option & fss_extended_list_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -614,7 +612,7 @@ extern "C" {
 
       if (!names[i]) continue;
 
-      status = fss_extended_list_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+      status = fss_extended_list_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
       if (status == F_success) break;
     } // for
 
@@ -623,7 +621,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_line_
 
 #ifndef _di_fss_extended_list_read_process_name_
-  f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
 
@@ -649,7 +647,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_name_
 
 #ifndef _di_fss_extended_list_read_process_option_
-  f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+  f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -672,7 +670,7 @@ extern "C" {
     if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) {
       data->option |= fss_extended_list_read_data_option_line_d;
 
-      status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, &data->line);
+      status = fss_extended_list_read_load_number(main, data, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, &data->line);
       if (F_status_is_error(status)) return status;
     }
 
@@ -691,7 +689,7 @@ extern "C" {
     if (main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_additional_e) {
       data->option |= fss_extended_list_read_data_option_select_d;
 
-      status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, &data->select);
+      status = fss_extended_list_read_load_number(main, data, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, &data->select);
       if (F_status_is_error(status)) return status;
     }
 
@@ -713,7 +711,7 @@ extern "C" {
 #endif // _di_fss_extended_list_read_process_option_
 
 #ifndef _di_fss_extended_list_read_process_total_
-  f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) {
 
     f_array_length_t total = 0;
     f_string_range_t range = f_string_range_t_initialize;
index 426cff42575293e42c18b1b59e1acd7b7a00f248..15a3230ae6f8e48207e364fdd9fcd7a68a3d6077 100644 (file)
@@ -15,33 +15,33 @@ extern "C" {
 /**
  * Determine if the given depth is to be delimited or not for Content.
  *
- * @param depth
- *   The depth to check.
  * @param data
  *   The program data.
+ * @param depth
+ *   The depth to check.
  *
  * @return
  *   F_true if to apply delimits.
  *   F_false if to not apply delimits.
  */
 #ifndef _di_fss_extended_list_read_delimit_content_is_
-  extern f_status_t fss_extended_list_read_delimit_content_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_delimit_content_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_delimit_content_is_
 
 /**
  * Determine if the given depth is to be delimited or not for an Object.
  *
- * @param depth
- *   The depth to check.
  * @param data
  *   The program data.
+ * @param depth
+ *   The depth to check.
  *
  * @return
  *   F_true if to apply delimits.
  *   F_false if to not apply delimits.
  */
 #ifndef _di_fss_extended_list_read_delimit_object_is_
-  extern f_status_t fss_extended_list_read_delimit_object_is(const f_array_length_t depth, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_delimit_object_is(fss_extended_list_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_delimit_object_is_
 
 /**
@@ -51,8 +51,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -72,7 +70,7 @@ extern "C" {
  * @see fss_extended_list_read_depths_resize()
  */
 #ifndef _di_fss_extended_list_read_depth_process_
-  extern f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_depth_process_
 
 /**
@@ -116,7 +114,7 @@ extern "C" {
  * @see fss_extended_list_read_process_option()
  */
 #ifndef _di_fss_extended_list_read_load_
-  extern f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_load_
 
 /**
@@ -126,6 +124,8 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param parameter
  *   An ID representing the parameter.
  * @param name
@@ -144,7 +144,7 @@ extern "C" {
  * @see fss_extended_list_read_depths_resize()
  */
 #ifndef _di_fss_extended_list_read_load_number_
-  extern f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_load_number_
 
 /**
@@ -154,8 +154,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -169,7 +167,7 @@ extern "C" {
  * @see fss_extended_list_read_process_option()
  */
 #ifndef _di_fss_extended_list_read_process_
-  extern f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_
 
 /**
@@ -189,7 +187,7 @@ extern "C" {
  * @see fss_extended_list_read_process_at_line()
  */
 #ifndef _di_fss_extended_list_read_process_at_
-  extern f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_at_
 
 /**
@@ -197,12 +195,12 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param delimits_object
  *   The delimits to be applied to an Object.
  * @param delimits_content
  *   The delimits to be applied to Content.
- * @param data
- *   The program data.
  * @param line
  *   The current line being processed.
  *   This will be incremented as necessary.
@@ -212,7 +210,7 @@ extern "C" {
  *   F_success on success and the line was matched (and possibly printed).
  */
 #ifndef _di_fss_extended_list_read_process_at_line_
-  extern f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_at_line_
 
 /**
@@ -230,7 +228,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_list_read_process_columns_
-  extern f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_columns_
 
 /**
@@ -248,7 +246,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_list_read_process_line_
-  extern f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_line_
 
 /**
@@ -266,14 +264,12 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_list_read_process_name_
-  extern f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_name(fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_name_
 
 /**
  * Process the parameters, populating the option property of the program data.
  *
- * @param arguments
- *   The parameters passed to the process.
  * @param main
  *   The main program data.
  * @param data
@@ -289,7 +285,7 @@ extern "C" {
  * @see fss_extended_list_read_load_setting()
  */
 #ifndef _di_fss_extended_list_read_process_option_
-  extern f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_option_
 
 /**
@@ -307,7 +303,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_list_read_process_total_
-  extern f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_list_read_process_total_
 
 #ifdef __cplusplus
index 3bb56480dff811096931346813c6ad45391b501b..76d15b6e46174234d732b07ff98695aa7a4c8637 100644 (file)
@@ -71,9 +71,9 @@ extern "C" {
 #ifndef _di_fss_extended_list_write_defines_
   #define fss_extended_list_write_signal_check_d 10000
 
-  #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)"
+  #define FSS_EXTENDED_LIST_WRITE_pipe_name_s "(pipe)"
 
-  #define FSS_EXTENDED_LIST_READ_pipe_name_s_length 6
+  #define FSS_EXTENDED_LIST_WRITE_pipe_name_s_length 6
 
   #define FSS_EXTENDED_LIST_WRITE_pipe_content_end_s    "\f"
   #define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s "\v"
@@ -83,7 +83,7 @@ extern "C" {
   #define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s_length 1
   #define FSS_EXTENDED_LIST_WRITE_pipe_content_start_s_length  1
 
-  extern const f_string_static_t fss_extended_list_read_pipe_name_s;
+  extern const f_string_static_t fss_extended_list_write_pipe_name_s;
 
   extern const f_string_static_t fss_extended_list_write_pipe_content_end_s;
   extern const f_string_static_t fss_extended_list_write_pipe_content_ignore_s;
index 40998137b2aaf21e3f41f7d3601e3fc38246dc7e..890bb79a12715301db7b0eb49075b4fb39b8fb05 100644 (file)
@@ -325,16 +325,12 @@ extern "C" {
       else if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
         const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1];
 
-        if (length) {
-          f_string_range_t range = macro_f_string_range_t_initialize(length);
+        if (argv[index].used) {
+          f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
 
-          main->prepend.string = argv[index];
-          main->prepend.used = length;
-          main->prepend.size = length;
+          for (; range.start < argv[index].used; ++range.start) {
 
-          for (; range.start < length; ++range.start) {
-
-            status = f_fss_is_space(main->prepend, range);
+            status = f_fss_is_space(argv[index], range);
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
@@ -402,7 +398,7 @@ extern "C" {
       }
     }
 
-    f_fss_quote_t quote = f_fss_delimit_quote_double_s;
+    f_fss_quote_t quote = f_fss_quote_type_double_e;
 
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_extended_list_write_parameter_double_e].result == f_console_result_found_e) {
index 649eac70f5cf323c56a6d950a169aedd1d738abe..47dbf96d89869251c6ec8b427e494673c312e4e8 100644 (file)
@@ -108,7 +108,15 @@ extern "C" {
       range.start = 0;
       range.stop = content->used - 1;
 
-      status = fl_fss_extended_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, ignore, state, &range, buffer);
+      const f_string_static_t *prepend = 0;
+
+      if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) {
+        const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1];
+
+        prepend = &main->parameters.arguments.array[index];
+      }
+
+      status = fl_fss_extended_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, ignore, state, &range, buffer);
 
       if (F_status_is_error(status)) {
         fll_error_print(main->error, F_status_set_fine(status), "fl_fss_extended_list_content_write", F_true);
@@ -401,7 +409,7 @@ extern "C" {
       index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[i * 2];
 
       range.start = 0;
-      range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
+      range.stop = argv[index].used - 1;
 
       // allow and ignore the positive sign.
       if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
@@ -421,7 +429,7 @@ extern "C" {
       index = main->parameters.array[fss_extended_list_write_parameter_ignore_e].values.array[(i * 2) + 1];
 
       range.start = 0;
-      range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1;
+      range.stop = argv[index].used - 1;
 
       // allow and ignore the positive sign.
       if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
index c22c4cd21b9b50d75a4bb5301ed483d0c8bb2306..79c37aa7e668c98dcd32e934e434a26fcdf5226b 100644 (file)
@@ -255,17 +255,17 @@ extern "C" {
  *   - object:                 Objects arre to have delimits applied.
  */
 #ifndef _di_fss_extended_read_delimit_mode_
-  #define FSS_EXTENDED_READ_delimit_mode_name_none    "none"
-  #define FSS_EXTENDED_READ_delimit_mode_name_all     "all"
-  #define FSS_EXTENDED_READ_delimit_mode_name_object  "object"
-  #define FSS_EXTENDED_READ_delimit_mode_name_greater "+"
-  #define FSS_EXTENDED_READ_delimit_mode_name_lesser  "-"
-
-  #define FSS_EXTENDED_READ_delimit_mode_name_none_length    4
-  #define FSS_EXTENDED_READ_delimit_mode_name_all_length     3
-  #define FSS_EXTENDED_READ_delimit_mode_name_object_length  6
-  #define FSS_EXTENDED_READ_delimit_mode_name_greater_length 1
-  #define FSS_EXTENDED_READ_delimit_mode_name_lesser_length  1
+  #define FSS_EXTENDED_READ_delimit_mode_name_none_s    "none"
+  #define FSS_EXTENDED_READ_delimit_mode_name_all_s     "all"
+  #define FSS_EXTENDED_READ_delimit_mode_name_object_s  "object"
+  #define FSS_EXTENDED_READ_delimit_mode_name_greater_s "+"
+  #define FSS_EXTENDED_READ_delimit_mode_name_lesser_s  "-"
+
+  #define FSS_EXTENDED_READ_delimit_mode_name_none_s_length    4
+  #define FSS_EXTENDED_READ_delimit_mode_name_all_s_length     3
+  #define FSS_EXTENDED_READ_delimit_mode_name_object_s_length  6
+  #define FSS_EXTENDED_READ_delimit_mode_name_greater_s_length 1
+  #define FSS_EXTENDED_READ_delimit_mode_name_lesser_s_length  1
 
   extern const f_string_static_t fss_extended_read_delimit_mode_name_none_s;
   extern const f_string_static_t fss_extended_read_delimit_mode_name_all_s;
index 05aba446d7fadf91b458897a3fbbd6d830a10d61..752829ab0319566dff304919fc1f102991a1627d 100644 (file)
@@ -91,18 +91,18 @@ extern "C" {
     fl_print_format("  Both the Object and Content are separated by a space.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
 
     fl_print_format("  The parameter %[%r%r%] accepts the following:%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable, f_string_eol_s);
-    fl_print_format("  - %[%r%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable, f_string_eol_s);
-    fl_print_format("  - %[%r%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable, f_string_eol_s);
-    fl_print_format("  - %[%r%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_object, context.set.notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Do not apply delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none_s, context.set.notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: (default) Apply all delimits.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all_s, context.set.notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Apply delimits for Objects.%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_object_s, context.set.notable, f_string_eol_s);
     fl_print_format("  - A number, 0 or greater: apply delimits for Content at the specified depth.%r", file.stream, f_string_eol_s);
-    fl_print_format("  - A number, 0 or greater, followed by a %[%r%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s, f_string_eol_s);
-    fl_print_format("  - A number, 0 or lesser, followed by a %[%r%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s, f_string_eol_s);
+    fl_print_format("  - A number, 0 or greater, followed by a %[%r%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+    fl_print_format("  - A number, 0 or lesser, followed by a %[%r%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%r%r", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser_s, context.set.notable, f_string_eol_s, f_string_eol_s);
 
     fl_print_format("  The %[%r%r%] parameter may be specified multiple times to customize the delimit behavior.%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable, f_string_eol_s);
 
     fl_print_format("  The %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit_s, context.set.notable);
-    fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable);
-    fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable);
+    fl_print_format(" values %[%r%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none_s, context.set.notable);
+    fl_print_format(" and %[%r%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all_s, context.set.notable);
     fl_print_format(" overrule all other delimit values.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
 
     fl_print_format("  The parameters %[%r%r%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns_s, context.set.notable);
@@ -195,8 +195,6 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     status = F_none;
 
     if (main->parameters.array[fss_extended_read_parameter_help_e].result == f_console_result_found_e) {
@@ -219,6 +217,7 @@ extern "C" {
     fss_extended_read_file_t files_array[main->parameters.remaining.used + 1];
     fss_extended_read_data_t data = fss_extended_read_data_t_initialize;
 
+    data.argv = main->parameters.arguments.array;
     data.files.array = files_array;
     data.files.used = 1;
     data.files.size = main->parameters.remaining.used + 1;
@@ -285,7 +284,7 @@ extern "C" {
           fss_extended_read_parameter_total_e,
         };
 
-        const f_string_t parameter_name[] = {
+        const f_string_static_t parameter_name[] = {
           fss_extended_read_long_depth_s,
           fss_extended_read_long_line_s,
           fss_extended_read_long_pipe_s,
@@ -350,7 +349,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_extended_read_parameter_delimit_e].result == f_console_result_additional_e) {
-        f_array_length_t location = 0;
+        f_array_length_t index = 0;
         f_array_length_t length = 0;
         uint16_t signal_check = 0;
 
@@ -362,14 +361,15 @@ extern "C" {
           if (!((++signal_check) % fss_extended_read_signal_check_d)) {
             if (fss_extended_read_signal_received(main)) {
               status = F_status_set_error(F_signal);
+
               break;
             }
 
             signal_check = 0;
           }
 
-          location = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i];
-          length = strnlen(argv[location], F_console_parameter_size_d);
+          index = main->parameters.array[fss_extended_read_parameter_delimit_e].values.array[i];
+          length = data.argv[index].used;
 
           if (!length) {
             flockfile(main->error.to.stream);
@@ -384,13 +384,13 @@ extern "C" {
 
             break;
           }
-          else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_none, length, fss_extended_read_delimit_mode_name_none_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_none_s) == F_equal_to) {
             data.delimit_mode = fss_extended_read_delimit_mode_none_e;
           }
-          else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_all, length, fss_extended_read_delimit_mode_name_all_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_all_s) == F_equal_to) {
             data.delimit_mode = fss_extended_read_delimit_mode_all_e;
           }
-          else if (fl_string_compare(argv[location], fss_extended_read_delimit_mode_name_object, length, fss_extended_read_delimit_mode_name_object_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_extended_read_delimit_mode_name_object_s) == F_equal_to) {
             switch (data.delimit_mode) {
               case 0:
                 data.delimit_mode = fss_extended_read_delimit_mode_object_e;
@@ -427,7 +427,7 @@ extern "C" {
               data.delimit_mode = fss_extended_read_delimit_mode_content_object_e;
             }
 
-            if (argv[location][length - 1] == fss_extended_read_delimit_mode_name_greater[0]) {
+            if (data.argv[index].string[length - 1] == fss_extended_read_delimit_mode_name_greater_s.string[0]) {
               if (!(data.delimit_mode == fss_extended_read_delimit_mode_none_e || data.delimit_mode == fss_extended_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_extended_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_extended_read_delimit_mode_content_greater_object_e;
@@ -440,7 +440,7 @@ extern "C" {
               // Shorten the length to better convert the remainder to a number.
               --length;
             }
-            else if (argv[location][length - 1] == fss_extended_read_delimit_mode_name_lesser[0]) {
+            else if (data.argv[index].string[length - 1] == fss_extended_read_delimit_mode_name_lesser_s.string[0]) {
               if (!(data.delimit_mode == fss_extended_read_delimit_mode_none_e || data.delimit_mode == fss_extended_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_extended_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_extended_read_delimit_mode_content_lesser_object_e;
@@ -457,14 +457,14 @@ extern "C" {
             f_string_range_t range = macro_f_string_range_t_initialize(length);
 
             // Ignore leading plus sign.
-            if (argv[location][0] == '+') {
+            if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
               ++range.start;
             }
 
-            status = fl_conversion_string_to_number_unsigned(argv[location], range, &data.delimit_depth);
+            status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
 
             if (F_status_is_error(status)) {
-              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_delimit_s, argv[location]);
+              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_delimit_s, data.argv[index]);
 
               break;
             }
@@ -490,7 +490,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_extended_read_depth_process(main, arguments, &data);
+        status = fss_extended_read_depth_process(main, &data);
       }
 
       // This standard does not support nesting, so any depth greater than 0 can be predicted without processing the file.
@@ -536,7 +536,7 @@ extern "C" {
         status = f_file_stream_read(file, &data.buffer);
 
         if (F_status_is_error(status)) {
-          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
         }
         else if (data.buffer.used) {
           data.files.array[0].range.stop = data.buffer.used - 1;
@@ -574,10 +574,10 @@ extern "C" {
           file.stream = 0;
           file.id = -1;
 
-          status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+          status = f_file_stream_open(data.argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -586,7 +586,7 @@ extern "C" {
           status = f_file_size_by_id(file.id, &size_file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -597,13 +597,13 @@ extern "C" {
             status = f_file_stream_read(file, &data.buffer);
 
             if (F_status_is_error(status)) {
-              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
               break;
             }
 
             if (data.buffer.used > data.files.array[data.files.used].range.start) {
-              data.files.array[data.files.used].name = argv[main->parameters.remaining.array[i]];
+              data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
               data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
 
               // This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
@@ -626,7 +626,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_extended_read_process(main, arguments, &data);
+        status = fss_extended_read_process(main, &data);
       }
 
       fss_extended_read_data_delete_simple(&data);
index b9211a0c7098aa76c6d50008fc8c99729dab3579..a8bbd96c9000540ba5d74985cbce61c5081d52e5 100644 (file)
@@ -140,6 +140,7 @@ extern "C" {
  *   - total:   The total lines found and selected is printed instead of the Content.
  *   - trim:    Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *
+ * argv:             The argument structure in the progam data parameters for simplifying syntax.
  * options:          Bitwise flags representing parameters.
  * delimit_mode:     The delimit mode.
  * delimit_depth:    The delimit depth.
@@ -173,6 +174,8 @@ extern "C" {
     f_number_unsigned_t select;
     f_number_unsigned_t line;
 
+    f_string_static_t *argv;
+
     fss_extended_read_files_t files;
     fss_extended_read_depths_t depths;
 
@@ -192,6 +195,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
       fss_extended_read_files_t_initialize, \
       fss_extended_read_depths_t_initialize, \
       f_string_dynamic_t_initialize, \
index 272b21b0d4cf0da2f8e624f2f08d001cbd3d4a01..b653b46b88d11adf8862f89458967a9bc16b7c8c 100644 (file)
@@ -60,7 +60,7 @@ extern "C" {
 #endif // _di_fss_extended_read_delimit_content_is_
 
 #ifndef _di_fss_extended_read_depth_process_
-  f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+  f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -112,12 +112,12 @@ extern "C" {
       else {
         position_depth = main->parameters.array[fss_extended_read_parameter_depth_e].values.array[i];
 
-        const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth]));
+        const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
 
-        status = fl_conversion_string_to_number_unsigned(arguments->argv[position_depth], range, &data->depths.array[i].depth);
+        status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
 
         if (F_status_is_error(status)) {
-          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_depth_s, arguments->argv[position_depth]);
+          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_depth_s, data->argv[position_depth]);
 
           return status;
         }
@@ -136,12 +136,12 @@ extern "C" {
 
           data->depths.array[i].index_at = main->parameters.array[fss_extended_read_parameter_at_e].values.array[position_at];
 
-          const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at]));
+          const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
 
-          status = fl_conversion_string_to_number_unsigned(arguments->argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at);
+          status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
 
           if (F_status_is_error(status)) {
-            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_at_s, arguments->argv[data->depths.array[i].index_at]);
+            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_extended_read_long_at_s, data->argv[data->depths.array[i].index_at]);
 
             return status;
           }
@@ -162,14 +162,14 @@ extern "C" {
           data->depths.array[i].index_name = main->parameters.array[fss_extended_read_parameter_name_e].values.array[position_name];
 
           if (main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e) {
-            status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+            status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
           }
           else {
-            status = f_string_append(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+            status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
           }
 
           if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true);
+            fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_extended_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_dynamic_append", F_true);
 
             return status;
           }
@@ -248,7 +248,7 @@ extern "C" {
 #endif // _di_fss_extended_read_file_identify_
 
 #ifndef _di_fss_extended_read_load_
-  f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) {
+  f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
     f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
     f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
@@ -283,16 +283,16 @@ extern "C" {
 #endif // _di_fss_extended_read_load_
 
 #ifndef _di_fss_extended_read_load_number_
-  f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
+  f_status_t fss_extended_read_load_number(fll_program_data_t * const main, fss_extended_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
 
     if (main->parameters.array[parameter].result == f_console_result_additional_e) {
       const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
-      const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used);
+      const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
 
-      const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+      const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
 
       if (F_status_is_error(status)) {
-        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
+        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
 
         return status;
       }
@@ -305,9 +305,9 @@ extern "C" {
 #endif // _di_fss_extended_read_load_number_
 
 #ifndef _di_fss_extended_read_process_
-  f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+  f_status_t fss_extended_read_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
-    f_status_t status = fss_extended_read_process_option(main, arguments, data);
+    f_status_t status = fss_extended_read_process_option(main, data);
     if (F_status_is_error(status)) return status;
 
     status = fss_extended_read_load(main, data);
@@ -355,7 +355,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_
 
 #ifndef _di_fss_extended_read_process_at_
-  f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
 
     if (data->depths.array[0].value_at >= data->objects.used) {
       if (data->option & (fss_extended_read_data_option_columns_d | fss_extended_read_data_option_total_d)) {
@@ -461,7 +461,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_at_
 
 #ifndef _di_fss_extended_read_process_columns_
-  f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
 
     if (!(data->option & fss_extended_read_data_option_content_d)) {
       flockfile(main->output.to.stream);
@@ -491,7 +491,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_columns_
 
 #ifndef _di_fss_extended_read_process_line_
-  f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
     f_array_lengths_t *delimits_object = fss_extended_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
@@ -542,7 +542,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_line_
 
 #ifndef _di_fss_extended_read_process_name_
-  f_status_t fss_extended_read_process_name(fss_extended_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_read_process_name(fss_extended_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
 
@@ -577,7 +577,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_name_
 
 #ifndef _di_fss_extended_read_process_option_
-  f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+  f_status_t fss_extended_read_process_option(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -600,7 +600,7 @@ extern "C" {
     if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) {
       data->option |= fss_extended_read_data_option_line_d;
 
-      status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, &data->line);
+      status = fss_extended_read_load_number(main, data, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, &data->line);
       if (F_status_is_error(status)) return status;
     }
 
@@ -619,7 +619,7 @@ extern "C" {
     if (main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_additional_e) {
       data->option |= fss_extended_read_data_option_select_d;
 
-      status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, &data->select);
+      status = fss_extended_read_load_number(main, data, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, &data->select);
       if (F_status_is_error(status)) return status;
     }
 
@@ -641,7 +641,7 @@ extern "C" {
 #endif // _di_fss_extended_read_process_option_
 
 #ifndef _di_fss_extended_read_process_total_
-  f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
+  f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) {
 
     f_array_length_t total = 0;
 
index 3cf437e12f07585f7a580c072cba802b5d3c6cbe..1e6f45cbc4cd7f5f48f033efd6dafc23e4df5e05 100644 (file)
@@ -51,8 +51,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -72,7 +70,7 @@ extern "C" {
  * @see fss_extended_read_depths_resize()
  */
 #ifndef _di_fss_extended_read_depth_process_
-  extern f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_depth_process_
 
 /**
@@ -116,7 +114,7 @@ extern "C" {
  * @see fss_extended_read_process_option()
  */
 #ifndef _di_fss_extended_read_load_
-  extern f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_load_
 
 /**
@@ -126,6 +124,8 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param parameter
  *   An ID representing the parameter.
  * @param name
@@ -144,7 +144,7 @@ extern "C" {
  * @see fss_extended_read_depths_resize()
  */
 #ifndef _di_fss_extended_read_load_number_
-  extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, fss_extended_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_load_number_
 
 /**
@@ -154,8 +154,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -169,7 +167,7 @@ extern "C" {
  * @see fss_extended_read_process_option()
  */
 #ifndef _di_fss_extended_read_process_
-  extern f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_
 
 /**
@@ -187,7 +185,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_read_process_at_
-  extern f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_at_
 
 /**
@@ -205,7 +203,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_read_process_columns_
-  extern f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_columns_
 
 /**
@@ -223,7 +221,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_read_process_line_
-  extern f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_line_
 
 /**
@@ -241,7 +239,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_read_process_name_
-  extern f_status_t fss_extended_read_process_name(fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_name(fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_name_
 
 /**
@@ -249,8 +247,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -264,7 +260,7 @@ extern "C" {
  * @see fss_extended_read_load_setting()
  */
 #ifndef _di_fss_extended_read_process_option_
-  extern f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_option(fll_program_data_t * const main, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_option_
 
 /**
@@ -282,52 +278,9 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_extended_read_process_total_
-  extern f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_read_process_total_
 
-/**
- * Determine if the given depth is to be delimited or not.
- *
- * @param main
- *   The main program data.
- * @param depth
- *   The depth to check.
- *
- * @return
- *   F_true if delimited.
- *   F_false if not delimited.
- */
-#ifndef _di_fss_extended_read_is_delimited_at_depth_
-  extern f_status_t fss_extended_read_is_delimited_at_depth(fll_program_data_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_is_delimited_at_depth_
-
-/**
- * Process a given file.
- *
- * @param main
- *   The main program data.
- * @param arguments
- *   The console arguments passed to the program.
- * @param file_name
- *   The name of the file being processed.
- * @param depths
- *   The processed depth parameters.
- * @param objects_delimits
- *   An array of delimits detected during processing, for top-level objects.
- * @param contents_delimits
- *   An array of delimits detected during processing, for contents.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_read_main_preprocess_depth()
- */
-#ifndef _di_fss_extended_read_main_process_file_
-  extern f_status_t fss_extended_read_main_process_file(fll_program_data_t * const main, const f_console_arguments_t arguments, const f_string_t file_name, const fss_extended_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_main_process_file_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a1bab6c5ed9dca78ccfd4f53b6816ee5461a3cbd..139496df2aa60eef088e679ef428f621cf3fd479 100644 (file)
@@ -187,7 +187,7 @@ extern "C" {
         }
       }
       else if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_found_e) {
-        fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string fss_extended_write_long_file_s);
+        fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_extended_write_long_file_s);
         status = F_status_set_error(F_parameter);
       }
     }
@@ -339,7 +339,7 @@ extern "C" {
         if (argv[index].used) {
           f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
 
-          for (; range.start < length; ++range.start) {
+          for (; range.start < argv[index].used; ++range.start) {
 
             status = f_fss_is_space(argv[index], range);
             if (F_status_is_error(status)) break;
@@ -425,7 +425,6 @@ extern "C" {
     }
 
     f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
-    f_string_dynamic_t object = f_string_dynamic_t_initialize;
     f_string_dynamics_t contents = f_string_dynamics_t_initialize;
 
     if (F_status_is_error_not(status)) {
@@ -450,6 +449,7 @@ extern "C" {
         if (main->parameters.array[fss_extended_write_parameter_partial_e].result == f_console_result_found_e) {
           if (main->parameters.array[fss_extended_write_parameter_object_e].result == f_console_result_additional_e) {
             contents.used = 0;
+
             uint16_t signal_check = 0;
 
             for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
@@ -464,17 +464,11 @@ extern "C" {
                 signal_check = 0;
               }
 
-              object.string = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]];
-              object.used = strnlen(object.string, F_console_parameter_size_d);
-              object.size = object.used;
-
-              status = fss_extended_write_process(main, output, quote, &object, 0, &buffer);
+              status = fss_extended_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]], 0, &buffer);
               if (F_status_is_error(status)) break;
             } // for
           }
           else {
-            object.used = 0;
-
             status = f_string_dynamics_increase_by(main->parameters.array[fss_extended_write_parameter_content_e].values.used, &contents);
 
             if (status == F_array_too_large) {
@@ -493,16 +487,6 @@ extern "C" {
               } // for
 
               status = fss_extended_write_process(main, output, quote, 0, &contents, &buffer);
-
-              // clear the contents array of the static strings to avoid deallocation attempts on static variables.
-              for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) {
-                contents.array[contents.used].string = 0;
-                contents.array[contents.used].used = 0;
-                contents.array[contents.used].size = 0;
-              } // for
-
-              contents.used = 0;
-              contents.size = 0;
             }
           }
         }
@@ -518,6 +502,7 @@ extern "C" {
             if (!((++signal_check) % fss_extended_write_signal_check_d)) {
               if (fss_extended_write_signal_received(main)) {
                 status = F_status_set_error(F_interrupt);
+
                 break;
               }
 
@@ -530,8 +515,6 @@ extern "C" {
               object_next = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i + 1];
             }
 
-            object = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]];
-
             contents.used = 0;
 
             for (; j < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++j) {
@@ -554,10 +537,10 @@ extern "C" {
                 contents.array[contents.used].used = 0;
               }
 
-              status = f_string_append(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], strnlen(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], F_console_parameter_size_d), &contents.array[contents.used]);
+              status = f_string_dynamic_append(argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[j]], &contents.array[contents.used]);
 
               if (F_status_is_error(status)) {
-                fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
+                fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
 
                 break;
               }
@@ -567,7 +550,7 @@ extern "C" {
 
             if (F_status_is_error(status)) break;
 
-            status = fss_extended_write_process(main, output, quote, &object, &contents, &buffer);
+            status = fss_extended_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]], &contents, &buffer);
             if (F_status_is_error(status)) break;
           } // for
         }
@@ -590,14 +573,6 @@ extern "C" {
       }
 
       f_string_dynamic_resize(0, &escaped);
-
-      // Object, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
-      object.string = 0;
-      object.used = 0;
-      object.size = 0;
-
-      // Reset contents used, it is dynamically allocated so leave everything else alone.
-      contents.used = 0;
     }
 
     if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_additional_e) {
@@ -618,7 +593,6 @@ extern "C" {
     }
 
     f_string_dynamic_resize(0, &buffer);
-    f_string_dynamic_resize(0, &object);
     f_string_dynamics_resize(0, &contents);
     fss_extended_write_main_delete(main);
 
index e0190fd7c26a1f0d31a9fc48b0f8cf75146e4d21..c2c07085685a68ae344ee9cd83c2e684c36391d7 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
 #endif // _di_fss_extended_write_error_parameter_at_least_once_print_
 
 #ifndef _di_fss_extended_write_error_parameter_value_missing_print_
-  void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
+  void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) {
       return;
index b5a5066cc215c47976976337f88ad6af54f220aa..9226487410af13b387fb27b97c1850d075bde317 100644 (file)
@@ -41,7 +41,7 @@ extern "C" {
  *   F_failure (with error bit) for any othe failure.
  */
 #ifndef _di_fss_extended_write_error_parameter_value_missing_print_
-  void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+  void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
 #endif // _di_fss_extended_write_error_parameter_value_missing_print_
 
 /**
index 96e7c22ad8d57223c24ee6a5806805c36017857d..36e8e590ecc368f24fbabc11deaabd5d98188ebf 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 
     flockfile(file.stream);
 
-    fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version);
+    fll_program_print_help_header(file, context, fss_identify_program_name_long_s, fss_identify_program_version_s);
 
     fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "    Print this help message.");
     fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "    Output using colors that show up better on dark backgrounds.");
@@ -140,8 +140,6 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     status = F_none;
 
     if (main->parameters.array[fss_identify_parameter_help_e].result == f_console_result_found_e) {
@@ -153,7 +151,7 @@ extern "C" {
     }
 
     if (main->parameters.array[fss_identify_parameter_version_e].result == f_console_result_found_e) {
-      fll_program_print_version(main->output.to, fss_identify_program_version);
+      fll_program_print_version(main->output.to, fss_identify_program_version_s);
 
       fss_identify_main_delete(main);
 
@@ -162,6 +160,8 @@ extern "C" {
 
     fss_identify_data_t data = fss_identify_data_t_initialize;
 
+    data.argv = main->parameters.arguments.array;
+
     if (F_status_is_error_not(status)) {
       if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_found_e) {
         flockfile(main->error.to.stream);
@@ -176,12 +176,12 @@ extern "C" {
       }
       else if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) {
         const f_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].values.used - 1];
-        const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
+        const f_string_range_t range = macro_f_string_range_t_initialize(data.argv[index].used);
 
-        status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.line);
+        status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.line);
 
         if (F_status_is_error(status)) {
-          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, argv[index]);
+          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, data.argv[index]);
         }
       }
     }
@@ -229,7 +229,7 @@ extern "C" {
       }
       else if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_additional_e) {
         const f_array_length_t index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].values.used - 1];
-        const f_array_length_t length = argv[index].used;
+        const f_array_length_t length = data.argv[index].used;
         const f_string_range_t range = macro_f_string_range_t_initialize(length);
 
         if (length == 0) {
@@ -255,7 +255,7 @@ extern "C" {
 
           for (f_array_length_t i = range.start; i <= range.stop; ++i) {
 
-            status = f_utf_is_word(argv[index].string + i, length, F_true);
+            status = f_utf_is_word(data.argv[index].string + i, length, F_true);
 
             if (F_status_is_error(status)) {
               fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word", F_true);
@@ -266,7 +266,7 @@ extern "C" {
               flockfile(main->error.to.stream);
 
               fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
-              fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, argv[index], main->error.notable);
+              fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, data.argv[index], main->error.notable);
               fl_print_format("%[' for the parameter '%]", main->error.to.stream, main->error.context, main->error.context);
               fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable);
               fl_print_format("%[' may only contain word characters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
@@ -278,7 +278,7 @@ extern "C" {
               break;
             }
 
-            data.name.string[data.name.used++] = argv[index].string[i];
+            data.name.string[data.name.used++] = data.argv[index].string[i];
           } // for
         }
       }
@@ -293,10 +293,10 @@ extern "C" {
       file.stream = F_type_input_d;
       file.size_read = 512;
 
-      status = fss_identify_load_line(main, file, "-", &buffer, &range);
+      status = fss_identify_load_line(main, file, f_string_empty_s, &buffer, &range);
 
       if (F_status_is_error_not(status)) {
-        status = fss_identify_process(main, "-", buffer, &range, &data);
+        status = fss_identify_process(main, &data, f_string_ascii_minus_s, buffer, &range);
       }
     }
 
@@ -322,16 +322,16 @@ extern "C" {
 
         file.size_read = 512;
 
-        status = f_file_stream_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
+        status = f_file_stream_open(data.argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
 
         if (F_status_is_error(status)) {
-          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
         }
         else {
-          status = fss_identify_load_line(main, file, argv[main->parameters.remaining.array[i]], &buffer, &range);
+          status = fss_identify_load_line(main, file, data.argv[main->parameters.remaining.array[i]], &buffer, &range);
 
           if (F_status_is_error_not(status)) {
-            status = fss_identify_process(main, argv[main->parameters.remaining.array[i]], buffer, &range, &data);
+            status = fss_identify_process(main, &data, data.argv[main->parameters.remaining.array[i]], buffer, &range);
           }
         }
 
index d10266522b4772f00a7f123e2f95dda8af47a68e..c578f0e6d35780168b79881b302171c9c75419e5 100644 (file)
@@ -15,10 +15,11 @@ extern "C" {
 /**
  * The data structure for FSS Identify.
  *
+ * argv:    The argument structure in the progam data parameters for simplifying syntax.
  * current: The current position within the ids, used to determine when the line is matched.
  * line:    The line number to select.
- * total:   The total ids across all files.
  * name:    The name to select.
+ * total:   The total ids across all files.
  */
 #ifndef _di_fss_identify_data_t_
   typedef struct {
@@ -26,6 +27,8 @@ extern "C" {
     f_array_length_t line;
     f_array_length_t total;
 
+    f_string_static_t *argv;
+
     f_string_dynamic_t name;
   } fss_identify_data_t;
 
@@ -34,6 +37,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
       f_string_dynamic_t_initialize, \
     }
 #endif // _di_fss_identify_data_t_
index 29091529f0902b686f1cc058a3df920497b0e0e3..4b4d6d3b26d2a6e06a0e437b9a4353908314be73 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
       if (!((++signal_check) % fss_identify_signal_check_d)) {
         if (fss_identify_signal_received(main)) {
           status = F_status_set_error(F_interrupt);
+
           break;
         }
 
@@ -32,7 +33,7 @@ extern "C" {
         status = f_string_dynamic_resize(buffer->size + file.size_read, buffer);
 
         if (F_status_is_error(status)) {
-          fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+          fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
 
           return status;
         }
@@ -41,7 +42,7 @@ extern "C" {
       status = f_file_stream_read_block(file, buffer);
 
       if (F_status_is_error(status)) {
-        fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+        fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name.used ? name : f_string_ascii_minus_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
 
         return status;
       }
@@ -56,7 +57,7 @@ extern "C" {
 
     } while (F_status_is_error_not(status) && status != F_none_eof);
 
-    // reset the start point to prepare the buffer for processing.
+    // Reset the start point to prepare the buffer for processing.
     range->start = 0;
 
     return status;
@@ -64,15 +65,15 @@ extern "C" {
 #endif // _di_fss_identify_load_line_
 
 #ifndef _di_fss_identify_process_
-  f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) {
+  f_status_t fss_identify_process(fll_program_data_t * const main, fss_identify_data_t * const data, const f_string_static_t name, const f_string_static_t buffer, f_string_range_t *range) {
 
     f_status_t status = F_none;
     f_fll_ids_t ids = f_fll_ids_t_initialize;
 
-    status = fll_fss_identify(buffer.string, range, &ids);
+    status = fll_fss_identify(buffer, range, &ids);
 
     if (F_status_is_error(status)) {
-      fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+      fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name.used ? name : f_string_ascii_pipe_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
 
       f_type_fll_ids_resize(0, &ids);
 
index 05c04bf10ea4cdc12518142a0d981ac669341a9b..ab6542bb34f7279307cddd7afe09803bc284de30 100644 (file)
@@ -37,7 +37,7 @@ extern "C" {
  * @see f_string_dynamic_resize()
  */
 #ifndef _di_fss_identify_load_line_
-  extern f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
+  extern f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_static_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
 #endif // _di_fss_identify_load_line_
 
 /**
@@ -45,6 +45,8 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param name
  *   The name of the file.
  *   Set to NULL to designate that this is a pipe.
@@ -52,8 +54,6 @@ extern "C" {
  *   The string representing the file to process.
  * @param range
  *   The range representing the line in the buffer.
- * @param data
- *   The program data.
  *
  * @return
  *   F_none on success.
@@ -63,7 +63,7 @@ extern "C" {
  * @see fll_fss_identify()
  */
 #ifndef _di_fss_identify_process_
-  extern f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_identify_process(fll_program_data_t * const main, fss_identify_data_t * const data, const f_string_static_t name, const f_string_static_t buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
 #endif // _di_fss_identify_process_
 
 #ifdef __cplusplus
index bc8b53b5aae10b8197532584ec5501a35f5e0dc9..a5dcfac81e52279b2eba34ea8a1add60b387578a 100644 (file)
@@ -7,12 +7,12 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_identify_print_
-  void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) {
+  void fss_identify_print(fll_program_data_t * const main, const f_fll_id_t id) {
 
     flockfile(main->output.to.stream);
 
     if (main->parameters.array[fss_identify_parameter_object_e].result == f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result != f_console_result_found_e) {
-      f_print(id.name, id.used, main->output.to.stream);
+      f_print((const f_string_t) id.name, id.used, main->output.to.stream);
 
       if (main->parameters.array[fss_identify_parameter_object_e].result != f_console_result_found_e || main->parameters.array[fss_identify_parameter_content_e].result == f_console_result_found_e) {
         f_print_dynamic_raw(f_fss_type_header_part5_s, main->output.to.stream);
index a03314d3a567e97061fe959e6bdc03606f0b6356..8ebcb576d43d1641a26d47f723372399354f32aa 100644 (file)
@@ -21,7 +21,7 @@ extern "C" {
  *   The Identifier to print.
  */
 #ifndef _di_fss_identify_print_
-  extern void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) F_attribute_visibility_internal_d;
+  extern void fss_identify_print(fll_program_data_t * const main, const f_fll_id_t id) F_attribute_visibility_internal_d;
 #endif // _di_fss_identify_print_
 
 #ifdef __cplusplus
index 61f353e0b73b293e245f3d718b364ad8359c8b04..1f472c2456dfa12902f59e2d8fb3fef822564ac1 100644 (file)
@@ -5,6 +5,8 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_payload_read_defines_
+  const f_string_static_t fss_payload_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_name_s, 0, FSS_PAYLOAD_READ_pipe_name_s_length);
+
   const f_string_static_t fss_payload_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_end_s, 0, FSS_PAYLOAD_READ_pipe_content_end_s_length);
   const f_string_static_t fss_payload_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_ignore_s, 0, FSS_PAYLOAD_READ_pipe_content_ignore_s_length);
   const f_string_static_t fss_payload_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_start_s, 0, FSS_PAYLOAD_READ_pipe_content_start_s_length);
index 9ffe69822474677fa0c603f8f861d25d8414f46b..9755de24e501d23ef8d7884dbb754cd4c44e7dfd 100644 (file)
@@ -65,17 +65,23 @@ extern "C" {
 #ifndef _di_fss_payload_read_defines_
   #define fss_payload_read_signal_check_d 10000
 
-  #define FSS_PAYLOAD_READ_pipe_content_end_s    '\f'
-  #define FSS_PAYLOAD_READ_pipe_content_ignore_s '\v'
-  #define FSS_PAYLOAD_READ_pipe_content_start_s  '\b'
+  #define FSS_PAYLOAD_READ_pipe_name_s "(pipe)"
+
+  #define FSS_PAYLOAD_READ_pipe_content_end_s    "\f"
+  #define FSS_PAYLOAD_READ_pipe_content_ignore_s "\v"
+  #define FSS_PAYLOAD_READ_pipe_content_start_s  "\b"
+
+  #define FSS_PAYLOAD_READ_pipe_name_s_length 6
 
   #define FSS_PAYLOAD_READ_pipe_content_end_s_length    1
   #define FSS_PAYLOAD_READ_pipe_content_ignore_s_length 1
   #define FSS_PAYLOAD_READ_pipe_content_start_s_length  1
 
-  extern const fss_payload_read_pipe_content_end_s;
-  extern const fss_payload_read_pipe_content_ignore_s;
-  extern const fss_payload_read_pipe_content_start_s;
+  extern const f_string_static_t fss_payload_read_pipe_name_s;
+
+  extern const f_string_static_t fss_payload_read_pipe_content_end_s;
+  extern const f_string_static_t fss_payload_read_pipe_content_ignore_s;
+  extern const f_string_static_t fss_payload_read_pipe_content_start_s;
 #endif // _di_fss_payload_read_defines_
 
 /**
@@ -226,7 +232,7 @@ extern "C" {
       macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s.string, fss_payload_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
     }
 
-  #define fss_payload_total_parameters_d 23
+  #define fss_payload_read_total_parameters_d 23
 #endif // _di_fss_payload_read_parameters_
 
 /**
index 425f825dea741d99a45020603a4106929450eddc..6a582b49de6ac8f1e971a5149fb19a1548b55e15 100644 (file)
@@ -21,7 +21,7 @@ extern "C" {
 
     flockfile(file.stream);
 
-    fll_program_print_help_header(file, context, fss_payload_program_name_long_s, fss_payload_program_version_s);
+    fll_program_print_help_header(file, context, fss_payload_read_program_name_long_s, fss_payload_read_program_version_s);
 
     fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "    Print this help message.");
     fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "    Output using colors that show up better on dark backgrounds.");
@@ -50,7 +50,7 @@ extern "C" {
     fll_program_print_help_option(file, context, fss_payload_read_short_total_s, fss_payload_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "   Print the total number of lines.");
     fll_program_print_help_option(file, context, fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "    Trim Object names on select or print.");
 
-    fll_program_print_help_usage(file, context, fss_payload_program_name_s, fll_program_parameter_filenames_s);
+    fll_program_print_help_usage(file, context, fss_payload_read_program_name_s, fll_program_parameter_filenames_s);
 
     fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
 
@@ -214,21 +214,21 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
-
     status = F_none;
 
     if (main->parameters.array[fss_payload_read_parameter_help_e].result == f_console_result_found_e) {
       fss_payload_read_print_help(main->output.to, main->context);
 
       fss_payload_read_main_delete(main);
+
       return status;
     }
 
     if (main->parameters.array[fss_payload_read_parameter_version_e].result == f_console_result_found_e) {
-      fll_program_print_version(main->output.to, fss_payload_program_version_s);
+      fll_program_print_version(main->output.to, fss_payload_read_program_version_s);
 
       fss_payload_read_main_delete(main);
+
       return status;
     }
 
@@ -236,6 +236,7 @@ extern "C" {
     fss_payload_read_file_t files_array[main->parameters.remaining.used + 1];
     fss_payload_read_data_t data = fss_payload_read_data_t_initialize;
 
+    data.argv = main->parameters.arguments.array;
     data.files.array = files_array;
     data.files.used = 1;
     data.files.size = main->parameters.remaining.used + 1;
@@ -302,7 +303,7 @@ extern "C" {
           fss_payload_read_parameter_total_e,
         };
 
-        const f_string_t parameter_name[] = {
+        const f_string_static_t parameter_name[] = {
           fss_payload_read_long_depth_s,
           fss_payload_read_long_line_s,
           fss_payload_read_long_pipe_s,
@@ -332,6 +333,7 @@ extern "C" {
             funlockfile(main->error.to.stream);
 
             status = F_status_set_error(F_parameter);
+
             break;
           }
         } // for
@@ -367,7 +369,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status) && main->parameters.array[fss_payload_read_parameter_delimit_e].result == f_console_result_additional_e) {
-        f_array_length_t location = 0;
+        f_array_length_t index = 0;
         f_array_length_t length = 0;
         uint16_t signal_check = 0;
 
@@ -379,14 +381,15 @@ extern "C" {
           if (!((++signal_check) % fss_payload_read_signal_check_d)) {
             if (fss_payload_read_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
+
               break;
             }
 
             signal_check = 0;
           }
 
-          location = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i];
-          length = strnlen(arguments->argv[location], F_console_parameter_size_d);
+          index = main->parameters.array[fss_payload_read_parameter_delimit_e].values.array[i];
+          length = data.argv[index].used;
 
           if (!length) {
             flockfile(main->error.to.stream);
@@ -398,15 +401,16 @@ extern "C" {
             funlockfile(main->error.to.stream);
 
             status = F_status_set_error(F_parameter);
+
             break;
           }
-          else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_none_s, length, fss_payload_read_delimit_mode_name_none_s_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_none_s) == F_equal_to) {
             data.delimit_mode = fss_payload_read_delimit_mode_none_e;
           }
-          else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_all_s, length, fss_payload_read_delimit_mode_name_all_s_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_all_s) == F_equal_to) {
             data.delimit_mode = fss_payload_read_delimit_mode_all_e;
           }
-          else if (fl_string_compare(arguments->argv[location], fss_payload_read_delimit_mode_name_object_s, length, fss_payload_read_delimit_mode_name_object_s_length) == F_equal_to) {
+          else if (fl_string_dynamic_compare(data.argv[index], fss_payload_read_delimit_mode_name_object_s) == F_equal_to) {
             switch (data.delimit_mode) {
               case 0:
                 data.delimit_mode = fss_payload_read_delimit_mode_object_e;
@@ -443,7 +447,7 @@ extern "C" {
               data.delimit_mode = fss_payload_read_delimit_mode_content_object_e;
             }
 
-            if (arguments->argv[location][length - 1] == fss_payload_read_delimit_mode_name_greater_s.string[0]) {
+            if (data.argv[index].string[length - 1] == fss_payload_read_delimit_mode_name_greater_s.string[0]) {
               if (!(data.delimit_mode == fss_payload_read_delimit_mode_none_e || data.delimit_mode == fss_payload_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_payload_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_payload_read_delimit_mode_content_greater_object_e;
@@ -456,7 +460,7 @@ extern "C" {
               // Shorten the length to better convert the remainder to a number.
               --length;
             }
-            else if (arguments->argv[location][length - 1] == fss_payload_read_delimit_mode_name_lesser_s.string[0]) {
+            else if (data.argv[index].string[length - 1] == fss_payload_read_delimit_mode_name_lesser_s.string[0]) {
               if (!(data.delimit_mode == fss_payload_read_delimit_mode_none_e || data.delimit_mode == fss_payload_read_delimit_mode_all_e)) {
                 if (data.delimit_mode == fss_payload_read_delimit_mode_content_object_e) {
                   data.delimit_mode = fss_payload_read_delimit_mode_content_lesser_object_e;
@@ -473,14 +477,14 @@ extern "C" {
             f_string_range_t range = macro_f_string_range_t_initialize(length);
 
             // Ignore leading plus sign.
-            if (arguments->argv[location][0] == '+') {
+            if (data.argv[index].string[0] == f_string_ascii_plus_s.string[0]) {
               ++range.start;
             }
 
-            status = fl_conversion_string_to_number_unsigned(arguments->argv[location], range, &data.delimit_depth);
+            status = fl_conversion_string_to_number_unsigned(data.argv[index].string, range, &data.delimit_depth);
 
             if (F_status_is_error(status)) {
-              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_delimit_s, arguments->argv[location]);
+              fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_delimit_s, data.argv[index]);
 
               break;
             }
@@ -506,7 +510,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_payload_read_depth_process(main, arguments, &data);
+        status = fss_payload_read_depth_process(main, &data);
       }
 
       // This standard only partially supports nesting, so any depth greater than 1 can be predicted without processing the file.
@@ -565,7 +569,7 @@ extern "C" {
         status = f_file_stream_read(file, &data.buffer);
 
         if (F_status_is_error(status)) {
-          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+          fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
         }
         else if (data.buffer.used) {
           data.files.array[0].range.stop = data.buffer.used - 1;
@@ -575,7 +579,7 @@ extern "C" {
           status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
           }
         }
         else {
@@ -605,10 +609,10 @@ extern "C" {
           file.stream = 0;
           file.id = -1;
 
-          status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
+          status = f_file_stream_open(data.argv[main->parameters.remaining.array[i]], f_string_empty_s, &file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -617,7 +621,7 @@ extern "C" {
           status = f_file_size_by_id(file.id, &size_file);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
             break;
           }
@@ -639,12 +643,12 @@ extern "C" {
             status = f_file_stream_read(file, &data.buffer);
 
             if (F_status_is_error(status)) {
-              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+              fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, data.argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
 
               break;
             }
             else if (data.buffer.used > data.files.array[data.files.used].range.start) {
-              data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
+              data.files.array[data.files.used].name = data.argv[main->parameters.remaining.array[i]];
               data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
             }
           }
@@ -659,7 +663,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(status)) {
-        status = fss_payload_read_process(main, arguments, &data);
+        status = fss_payload_read_process(main, &data);
       }
 
       fss_payload_read_data_delete_simple(&data);
index 8e3ea3e991f627926b1fcbd33f0b44106e03b097..4d9f3b0aef29872d4cf1655434132264c962c793 100644 (file)
@@ -141,6 +141,7 @@ extern "C" {
  *   - total:    The total lines found and selected is printed instead of the Content.
  *   - trim:     Empty space before and after Objects and Content will not be printed (They will be trimmed).
  *
+ * argv:                    The argument structure in the progam data parameters for simplifying syntax.
  * options:                 Bitwise flags representing parameters.
  * delimit_mode:            The delimit mode.
  * delimit_depth:           The delimit depth.
@@ -180,6 +181,8 @@ extern "C" {
     f_number_unsigned_t select;
     f_number_unsigned_t line;
 
+    f_string_static_t *argv;
+
     fss_payload_read_files_t files;
     fss_payload_read_depths_t depths;
 
@@ -206,6 +209,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
       fss_payload_read_files_t_initialize, \
       fss_payload_read_depths_t_initialize, \
       f_string_dynamic_t_initialize, \
index 1a8b98e1b881b9b3e37d3aa568b750bc786cd697..fd558a9418ab6ec992502b8cc3129ae6da85f668 100644 (file)
@@ -8,7 +8,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_payload_read_delimit_content_is_
-  f_status_t fss_payload_read_delimit_content_is(const f_array_length_t depth, fss_payload_read_data_t * const data) {
+  f_status_t fss_payload_read_delimit_content_is(fss_payload_read_data_t * const data, const f_array_length_t depth) {
 
     if (data->delimit_mode == fss_payload_read_delimit_mode_none_e) {
       return F_false;
@@ -31,7 +31,7 @@ extern "C" {
 #endif // _di_fss_payload_read_delimit_content_is_
 
 #ifndef _di_fss_payload_read_delimit_object_is_
-  f_status_t fss_payload_read_delimit_object_is(const f_array_length_t depth, fss_payload_read_data_t * const data) {
+  f_status_t fss_payload_read_delimit_object_is(fss_payload_read_data_t * const data, const f_array_length_t depth) {
 
     switch (data->delimit_mode) {
       case fss_payload_read_delimit_mode_none_e:
@@ -56,7 +56,7 @@ extern "C" {
 #endif // _di_fss_payload_read_delimit_object_is_
 
 #ifndef _di_fss_payload_read_depth_process_
-  f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+  f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -108,12 +108,12 @@ extern "C" {
       else {
         position_depth = main->parameters.array[fss_payload_read_parameter_depth_e].values.array[i];
 
-        const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[position_depth]));
+        const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[position_depth].used);
 
-        status = fl_conversion_string_to_number_unsigned(arguments->argv[position_depth], range, &data->depths.array[i].depth);
+        status = fl_conversion_string_to_number_unsigned(data->argv[position_depth].string, range, &data->depths.array[i].depth);
 
         if (F_status_is_error(status)) {
-          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_depth_s, arguments->argv[position_depth]);
+          fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_depth_s, data->argv[position_depth]);
 
           return status;
         }
@@ -132,12 +132,12 @@ extern "C" {
 
           data->depths.array[i].index_at = main->parameters.array[fss_payload_read_parameter_at_e].values.array[position_at];
 
-          const f_string_range_t range = macro_f_string_range_t_initialize(strlen(arguments->argv[data->depths.array[i].index_at]));
+          const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[data->depths.array[i].index_at].used);
 
-          status = fl_conversion_string_to_number_unsigned(arguments->argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at);
+          status = fl_conversion_string_to_number_unsigned(data->argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at);
 
           if (F_status_is_error(status)) {
-            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_at_s, arguments->argv[data->depths.array[i].index_at]);
+            fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_payload_read_long_at_s, data->argv[data->depths.array[i].index_at]);
 
             return status;
           }
@@ -158,14 +158,14 @@ extern "C" {
           data->depths.array[i].index_name = main->parameters.array[fss_payload_read_parameter_name_e].values.array[position_name];
 
           if (main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e) {
-            status = fl_string_rip(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+            status = fl_string_rip(data->argv[data->depths.array[i].index_name].string, data->argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name);
           }
           else {
-            status = f_string_append(arguments->argv[data->depths.array[i].index_name], strlen(arguments->argv[data->depths.array[i].index_name]), &data->depths.array[i].value_name);
+            status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
           }
 
           if (F_status_is_error(status)) {
-            fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_append", F_true);
+            fll_error_print(main->error, F_status_set_fine(status), main->parameters.array[fss_payload_read_parameter_trim_e].result == f_console_result_found_e ? "fl_string_rip" : "f_string_dynamic_append", F_true);
 
             return status;
           }
@@ -244,7 +244,7 @@ extern "C" {
 #endif // _di_fss_payload_read_file_identify_
 
 #ifndef _di_fss_payload_read_load_
-  f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) {
+  f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
     f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
     f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
@@ -314,16 +314,16 @@ extern "C" {
 #endif // _di_fss_payload_read_load_
 
 #ifndef _di_fss_payload_read_load_number_
-  f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
+  f_status_t fss_payload_read_load_number(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) {
 
     if (main->parameters.array[parameter].result == f_console_result_additional_e) {
       const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
-      const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(main->parameters.arguments.array[index], F_console_parameter_size_d));
+      const f_string_range_t range = macro_f_string_range_t_initialize(data->argv[index].used);
 
-      const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number);
+      const f_status_t status = fl_conversion_string_to_number_unsigned(data->argv[index].string, range, number);
 
       if (F_status_is_error(status)) {
-        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]);
+        fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, data->argv[index]);
 
         return status;
       }
@@ -336,9 +336,9 @@ extern "C" {
 #endif // _di_fss_payload_read_load_number_
 
 #ifndef _di_fss_payload_read_process_
-  f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+  f_status_t fss_payload_read_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
-    f_status_t status = fss_payload_read_process_option(main, arguments, data);
+    f_status_t status = fss_payload_read_process_option(main, data);
     if (F_status_is_error(status)) return status;
 
     // This standard does not support multiple content groups, except for "headers" FSS-0001 Extended at depth 1.
@@ -406,8 +406,8 @@ extern "C" {
       }
 
       f_array_lengths_t except_none = f_array_lengths_t_initialize;
-      f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
-      f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+      f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+      f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
 
       if (data->option & fss_payload_read_data_option_raw_d) {
         delimits_object = &except_none;
@@ -441,8 +441,8 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
     uint16_t signal_check = 0;
     bool is_payload = F_false;
 
@@ -473,7 +473,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_
 
 #ifndef _di_fss_payload_read_process_at_
-  f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     if (data->depths.array[0].value_at >= data->objects.used) {
       if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
@@ -488,8 +488,8 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
 
     if (data->option & fss_payload_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -517,7 +517,7 @@ extern "C" {
         if (data->option & fss_payload_read_data_option_line_d) {
           f_array_length_t line = 0;
 
-          status = fss_payload_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+          status = fss_payload_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
           if (status == F_success) return F_none;
         }
         else if (data->option & fss_payload_read_data_option_columns_d) {
@@ -560,7 +560,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_at_
 
 #ifndef _di_fss_payload_read_process_at_extended_
-  f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     if (data->depths.array[data->depths.used - 1].value_at >= data->objects_header.used) {
       if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
@@ -590,8 +590,8 @@ extern "C" {
     }
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
-    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
 
     if (data->option & fss_payload_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -666,7 +666,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_at_extended_
 
 #ifndef _di_fss_payload_read_process_at_line_
-  f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) {
+  f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) {
 
     if (data->option & fss_payload_read_data_option_object_d) {
       if (*line == data->line) {
@@ -770,7 +770,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_at_line_
 
 #ifndef _di_fss_payload_read_process_columns_
-  f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     if (!(data->option & fss_payload_read_data_option_content_d)) {
       flockfile(main->output.to.stream);
@@ -809,7 +809,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_columns_
 
 #ifndef _di_fss_payload_read_process_columns_extended_
-  f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     if (!(data->option & fss_payload_read_data_option_content_d)) {
       flockfile(main->output.to.stream);
@@ -839,11 +839,11 @@ extern "C" {
 #endif // _di_fss_payload_read_process_columns_extended_
 
 #ifndef _di_fss_payload_read_process_line_
-  f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
-    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(0, data) ? &data->delimits_content : &except_none;
+    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object : &except_none;
+    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, 0) ? &data->delimits_content : &except_none;
 
     if (data->option & fss_payload_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -866,7 +866,7 @@ extern "C" {
         signal_check = 0;
       }
 
-      status = fss_payload_read_process_at_line(main, i, *delimits_object, *delimits_content, data, &line);
+      status = fss_payload_read_process_at_line(main, data, i, *delimits_object, *delimits_content, &line);
       if (status == F_success) break;
     } // for
 
@@ -875,11 +875,11 @@ extern "C" {
 #endif // _di_fss_payload_read_process_line_
 
 #ifndef _di_fss_payload_read_process_line_extended_
-  f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
-    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
-    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is((data->option & fss_payload_read_data_option_select_d) ? data->select : 0, data) ? &data->delimits_content_header : &except_none;
+    f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(data, 0) ? &data->delimits_object_header : &except_none;
+    f_array_lengths_t *delimits_content = fss_payload_read_delimit_content_is(data, (data->option & fss_payload_read_data_option_select_d) ? data->select : 0) ? &data->delimits_content_header : &except_none;
 
     if (data->option & fss_payload_read_data_option_raw_d) {
       delimits_object = &except_none;
@@ -926,7 +926,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_line_extended_
 
 #ifndef _di_fss_payload_read_process_name_
-  f_status_t fss_payload_read_process_name(fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_name(fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
 
@@ -952,7 +952,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_name_
 
 #ifndef _di_fss_payload_read_process_name_extended_
-  f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_lengths_t except_none = f_array_lengths_t_initialize;
 
@@ -987,7 +987,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_name_extended_
 
 #ifndef _di_fss_payload_read_process_option_
-  f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+  f_status_t fss_payload_read_process_option(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
     f_status_t status = F_none;
 
@@ -1010,7 +1010,7 @@ extern "C" {
     if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) {
       data->option |= fss_payload_read_data_option_line_d;
 
-      status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, &data->line);
+      status = fss_payload_read_load_number(main, data, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, &data->line);
       if (F_status_is_error(status)) return status;
     }
 
@@ -1029,7 +1029,7 @@ extern "C" {
     if (main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_additional_e) {
       data->option |= fss_payload_read_data_option_select_d;
 
-      status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, &data->select);
+      status = fss_payload_read_load_number(main, data, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, &data->select);
       if (F_status_is_error(status)) return status;
     }
 
@@ -1051,7 +1051,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_option_
 
 #ifndef _di_fss_payload_read_process_total_
-  f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_length_t total = 0;
     f_string_range_t range = f_string_range_t_initialize;
@@ -1126,7 +1126,7 @@ extern "C" {
 #endif // _di_fss_payload_read_process_total_
 
 #ifndef _di_fss_payload_read_process_total_extended_
-  f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
+  f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) {
 
     f_array_length_t total = 0;
 
index cfe60df149006951716ba57a2513bce7e0108e0f..e6149656cefca40e7df1b92febd7e13b9f7c1b39 100644 (file)
@@ -25,23 +25,23 @@ extern "C" {
  *   F_false if to not apply delimits.
  */
 #ifndef _di_fss_payload_read_delimit_content_is_
-  extern f_status_t fss_payload_read_delimit_content_is(const f_array_length_t depth, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_delimit_content_is(fss_payload_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_delimit_content_is_
 
 /**
  * Determine if the given depth is to be delimited or not for an Object.
  *
- * @param depth
- *   The depth to check.
  * @param data
  *   The program data.
+ * @param depth
+ *   The depth to check.
  *
  * @return
  *   F_true if to apply delimits.
  *   F_false if to not apply delimits.
  */
 #ifndef _di_fss_payload_read_delimit_object_is_
-  extern f_status_t fss_payload_read_delimit_object_is(const f_array_length_t depth, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_delimit_object_is(fss_payload_read_data_t * const data, const f_array_length_t depth) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_delimit_object_is_
 
 /**
@@ -74,7 +74,7 @@ extern "C" {
  * @see fss_payload_read_depths_resize()
  */
 #ifndef _di_fss_payload_read_depth_process_
-  extern f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_depth_process_
 
 /**
@@ -118,7 +118,7 @@ extern "C" {
  * @see fss_payload_read_process_option()
  */
 #ifndef _di_fss_payload_read_load_
-  extern f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_load_
 
 /**
@@ -128,6 +128,8 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param parameter
  *   An ID representing the parameter.
  * @param name
@@ -146,7 +148,7 @@ extern "C" {
  * @see fss_payload_read_depths_resize()
  */
 #ifndef _di_fss_payload_read_load_number_
-  extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_load_number_
 
 /**
@@ -156,8 +158,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -171,7 +171,7 @@ extern "C" {
  * @see fss_payload_read_process_option()
  */
 #ifndef _di_fss_payload_read_process_
-  extern f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_
 
 /**
@@ -191,7 +191,7 @@ extern "C" {
  * @see fss_payload_read_process_at_line()
  */
 #ifndef _di_fss_payload_read_process_at_
-  extern f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_at_
 
 /**
@@ -211,7 +211,7 @@ extern "C" {
  * @see fss_payload_read_process_at_line()
  */
 #ifndef _di_fss_payload_read_process_at_extended_
-  extern f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_at_extended_
 
 /**
@@ -219,12 +219,12 @@ extern "C" {
  *
  * @param main
  *   The main program data.
+ * @param data
+ *   The program data.
  * @param delimits_object
  *   The delimits to be applied to an Object.
  * @param delimits_content
  *   The delimits to be applied to Content.
- * @param data
- *   The program data.
  * @param line
  *   The current line being processed.
  *   This will be incremented as necessary.
@@ -234,7 +234,7 @@ extern "C" {
  *   F_success on success and the line was matched (and possibly printed).
  */
 #ifndef _di_fss_payload_read_process_at_line_
-  extern f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, f_array_length_t *line) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_at_line_
 
 /**
@@ -252,7 +252,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_columns_
-  extern f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_columns_
 
 /**
@@ -270,7 +270,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_columns_extended_
-  extern f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_columns_extended_
 
 /**
@@ -288,7 +288,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_line_
-  extern f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_line_
 
 /**
@@ -306,7 +306,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_line_extended_
-  extern f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_line_extended_
 
 /**
@@ -324,7 +324,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_name_
-  extern f_status_t fss_payload_read_process_name(fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_name(fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_name_
 
 /**
@@ -342,7 +342,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_name_extended_
-  extern f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_name_extended(fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_name_extended_
 
 /**
@@ -350,8 +350,6 @@ extern "C" {
  *
  * @param main
  *   The main program data.
- * @param arguments
- *   The parameters passed to the process.
  * @param data
  *   The program data.
  *
@@ -365,7 +363,7 @@ extern "C" {
  * @see fss_payload_read_load_setting()
  */
 #ifndef _di_fss_payload_read_process_option_
-  extern f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_option(fll_program_data_t * const main, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_option_
 
 /**
@@ -383,7 +381,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_total_
-  extern f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_total_
 
 /**
@@ -401,7 +399,7 @@ extern "C" {
  *   F_none on success.
  */
 #ifndef _di_fss_payload_read_process_total_extended_
-  extern f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+  extern f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t * const data, bool names[]) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_read_process_total_extended_
 
 #ifdef __cplusplus
index 2a8a2aab2a2f732cbb81cf9ee3d641f0a1ef69a6..50e369a3e25b02581f96e9530ace6925da787fef 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
   const f_string_static_t fss_payload_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_start_s, 0, FSS_PAYLOAD_WRITE_pipe_content_start_s_length);
 #endif // _di_fss_payload_write_defines_
 
-##ifndef _di_fss_payload_write_parameters_
+#ifndef _di_fss_payload_write_parameters_
   const f_string_static_t fss_payload_write_short_file_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_file_s, 0, FSS_PAYLOAD_WRITE_short_file_s_length);
   const f_string_static_t fss_payload_write_short_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_content_s, 0, FSS_PAYLOAD_WRITE_short_content_s_length);
   const f_string_static_t fss_payload_write_short_double_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_double_s, 0, FSS_PAYLOAD_WRITE_short_double_s_length);
index 77be49d7c7be88e0a98d2c25e82898f71aa790cf..4399f15e8b3f29ddad15936b2bffbade7205808b 100644 (file)
@@ -187,10 +187,10 @@ extern "C" {
 
           output.id = -1;
           output.stream = 0;
-          status = f_file_stream_open(arguments->argv[location], 0, &output);
+          status = f_file_stream_open(argv[location], f_string_empty_s, &output);
 
           if (F_status_is_error(status)) {
-            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[location], f_file_operation_open_s, fll_error_file_type_file_e);
+            fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, argv[location], f_file_operation_open_s, fll_error_file_type_file_e);
           }
         }
       }
@@ -328,18 +328,13 @@ extern "C" {
       }
       else if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
         const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
-        const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d);
 
-        if (length) {
-          f_string_range_t range = macro_f_string_range_t_initialize(length);
+        if (argv[index].used) {
+          f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used);
 
-          main->prepend.string = arguments->argv[index];
-          main->prepend.used = length;
-          main->prepend.size = length;
+          for (; range.start < argv[index].used; range.start++) {
 
-          for (; range.start < length; range.start++) {
-
-            status = f_fss_is_space(main->prepend, range);
+            status = f_fss_is_space(argv[index], range);
             if (F_status_is_error(status)) break;
 
             if (status == F_false) {
@@ -422,8 +417,6 @@ extern "C" {
     }
 
     f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
-    f_string_dynamic_t object = f_string_dynamic_t_initialize;
-    f_string_dynamic_t content = f_string_dynamic_t_initialize;
 
     // @todo Go through the list of Objects, if given, and confirm that payload is specified and is specified last, otherwise error out.
     // @todo a new parameter needs to exist for specifying that a Content is a payload for cases where Object is not given (and then this needs to verify that only a single Content is given).
@@ -454,14 +447,11 @@ extern "C" {
 
               if (fss_payload_write_signal_received(main)) {
                 status = F_status_set_error(F_interrupt);
+
                 break;
               }
 
-              object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]];
-              object.used = strnlen(object.string, F_console_parameter_size_d);
-              object.size = object.used;
-
-              status = fss_payload_write_process(main, output, quote, &object, 0, &buffer);
+              status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], 0, &buffer);
               if (F_status_is_error(status)) break;
             } // for
           }
@@ -470,14 +460,11 @@ extern "C" {
 
               if (fss_payload_write_signal_received(main)) {
                 status = F_status_set_error(F_interrupt);
+
                 break;
               }
 
-              content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]];
-              content.used = strnlen(content.string, F_console_parameter_size_d);
-              content.size = content.used;
-
-              status = fss_payload_write_process(main, output, quote, 0, &content, &buffer);
+              status = fss_payload_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
               if (F_status_is_error(status)) break;
             } // for
           }
@@ -487,18 +474,11 @@ extern "C" {
 
             if (fss_payload_write_signal_received(main)) {
               status = F_status_set_error(F_interrupt);
+
               break;
             }
 
-            object.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]];
-            object.used = strnlen(object.string, F_console_parameter_size_d);
-            object.size = object.used;
-
-            content.string = arguments->argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]];
-            content.used = strnlen(content.string, F_console_parameter_size_d);
-            content.size = content.used;
-
-            status = fss_payload_write_process(main, output, quote, &object, &content, &buffer);
+            status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
             if (F_status_is_error(status)) break;
           } // for
         }
@@ -521,15 +501,6 @@ extern "C" {
       }
 
       f_string_dynamic_resize(0, &escaped);
-
-      // Object and content, though being a "dynamic" type, is being used statically, so clear them up to avoid invalid free().
-      object.string = 0;
-      object.used = 0;
-      object.size = 0;
-
-      content.string = 0;
-      content.used = 0;
-      content.size = 0;
     }
 
     if (main->parameters.array[fss_payload_write_parameter_file_e].result == f_console_result_additional_e) {
@@ -546,8 +517,6 @@ extern "C" {
     }
 
     f_string_dynamic_resize(0, &buffer);
-    f_string_dynamic_resize(0, &object);
-    f_string_dynamic_resize(0, &content);
     fss_payload_write_main_delete(main);
 
     return status;
index c2358b8758bebfebe6a653f9e09bfe6cedcc72f3..162ac5fb3854789b40f4d5695afa4a258e456526 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
 #endif // _di_fss_payload_write_error_parameter_unsupported_eol_print_
 
 #ifndef _di_fss_payload_write_error_parameter_value_missing_print_
-  void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
+  void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
 
     if (main->error.verbosity == f_console_verbosity_quiet_e) {
       return;
@@ -85,7 +85,15 @@ extern "C" {
           range.stop = 0;
         }
 
-        status = fll_fss_payload_write_string(*object, *content, trim, &main->prepend, state, buffer);
+        const f_string_static_t *prepend = 0;
+
+        if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+          const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+          prepend = &main->parameters.arguments.array[index];
+        }
+
+        status = fll_fss_payload_write_string(*object, *content, trim, prepend, state, buffer);
 
         if (F_status_set_fine(status) == F_none_eol) {
           fss_payload_write_error_parameter_unsupported_eol_print(main);
@@ -140,7 +148,15 @@ extern "C" {
         range.start = 0;
         range.stop = content->used - 1;
 
-        status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, state, &range, buffer);
+        const f_string_static_t *prepend = 0;
+
+        if (main->parameters.array[fss_payload_write_parameter_prepend_e].result == f_console_result_additional_e) {
+          const f_array_length_t index = main->parameters.array[fss_payload_write_parameter_prepend_e].values.array[main->parameters.array[fss_payload_write_parameter_prepend_e].values.used - 1];
+
+          prepend = &main->parameters.arguments.array[index];
+        }
+
+        status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, state, &range, buffer);
 
         if (F_status_is_error(status)) {
           fll_error_print(main->error, F_status_set_fine(status), "fl_fss_payload_content_write", F_true);
index ffe2782c6ea4236213d2435a96e4f1dcaeb55b56..f4d673baadd4e98be949a6b2e341e49d6b43ca4e 100644 (file)
@@ -43,7 +43,7 @@ extern "C" {
  *   The parameter name, such as "help" in "--help".
  */
 #ifndef _di_fss_payload_write_error_parameter_value_missing_print_
-  void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+  void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
 #endif // _di_fss_payload_write_error_parameter_value_missing_print_
 
 /**
index ee6b9bb9ad4ac3ed263648d8247e8df46ab911dd..3baa637a6f4e411506e830d11ed2a2180864c4b5 100644 (file)
@@ -37,8 +37,8 @@ extern "C" {
 /**
  * The program data.
  *
+ * argv:      The argument structure in the progam data parameters for simplifying syntax.
  * main:      The main program data.
- * argv:      The argument structure in fll_program_data_t.parameters for simplifying syntax.
  * file:      The output file for writing the processed data to (may potentially default to "output").
  * mode:      The input/output mode (see utf8_modes).
  * valid:     Designate the output context set for valid characters.