]> Kevux Git Server - fll/commitdiff
Progress: Continue work on refactoring fss_*_read into fss_read.
authorKevin Day <kevin@kevux.org>
Wed, 24 May 2023 03:53:44 +0000 (22:53 -0500)
committerKevin Day <kevin@kevux.org>
Wed, 24 May 2023 03:53:44 +0000 (22:53 -0500)
The primary focus is on cleaning up the state of the code.

I will at some pointer later resume migrating the code.

39 files changed:
level_3/byte_dump/c/byte_dump.c
level_3/control/c/control.c
level_3/control/c/private-control.c
level_3/controller/c/controller.c
level_3/controller/c/rule/private-rule.c
level_3/fake/c/main/common.c
level_3/fake/c/main/fake.c
level_3/fss_basic_list_read/c/private-read.c
level_3/fss_basic_read/c/private-read.c
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_identify/c/fss_identify.c
level_3/fss_payload_read/c/private-read.c
level_3/fss_payload_read/c/private-read.h
level_3/fss_read/c/basic/fss_read.c
level_3/fss_read/c/basic/fss_read.h
level_3/fss_read/c/basic_list/fss_read.h
level_3/fss_read/c/embedded_list/fss_read.h
level_3/fss_read/c/extended/fss_read.h
level_3/fss_read/c/extended_list/fss_read.h
level_3/fss_read/c/main/common.c
level_3/fss_read/c/main/common/define.h
level_3/fss_read/c/main/common/type.c
level_3/fss_read/c/main/common/type.h
level_3/fss_read/c/main/fss_read.c
level_3/fss_read/c/main/fss_read.h
level_3/fss_read/c/main/print/data.c
level_3/fss_read/c/main/print/data.h
level_3/fss_read/c/main/print/error.c
level_3/fss_read/c/main/print/error.h
level_3/fss_read/c/main/process_normal.c
level_3/fss_read/c/main/process_normal.h
level_3/fss_read/c/payload/fss_read.c
level_3/fss_read/c/payload/fss_read.h
level_3/fss_read/c/payload/main.c
level_3/fss_read/data/build/settings
level_3/fss_write/c/main/common.c
level_3/fss_write/c/payload/fss_write.c
level_3/iki_read/c/main/common.c

index fa0693749bd1f6107d6cb06ec625241be8b68112..b01799193d9bad72409ac7d2e7933b3f2f91a7ac 100644 (file)
@@ -184,7 +184,7 @@ extern "C" {
       }
 
       if (main->parameters.array[byte_dump_parameter_width_e].result & f_console_result_value_e) {
-        const f_array_length_t index = main->parameters.array[byte_dump_parameter_width_e].values.array[main->parameters.array[byte_dump_parameter_width_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[byte_dump_parameter_width_e].values.array[main->parameters.array[byte_dump_parameter_width_e].location];
         f_number_unsigned_t number = 0;
 
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
@@ -223,7 +223,7 @@ extern "C" {
       }
 
       if (main->parameters.array[byte_dump_parameter_first_e].result & f_console_result_value_e) {
-        const f_array_length_t index = main->parameters.array[byte_dump_parameter_first_e].values.array[main->parameters.array[byte_dump_parameter_first_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[byte_dump_parameter_first_e].values.array[main->parameters.array[byte_dump_parameter_first_e].location];
         f_number_unsigned_t number = 0;
 
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
@@ -262,7 +262,7 @@ extern "C" {
       }
 
       if (main->parameters.array[byte_dump_parameter_last_e].result & f_console_result_value_e) {
-        const f_array_length_t index = main->parameters.array[byte_dump_parameter_last_e].values.array[main->parameters.array[byte_dump_parameter_last_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[byte_dump_parameter_last_e].values.array[main->parameters.array[byte_dump_parameter_last_e].location];
         f_number_unsigned_t number = 0;
 
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &number);
index b8d8e4d0b558ab407a8999724cb187d3255fa296..87b5db1ecc071510ae140fc94854a02243277ac6 100644 (file)
@@ -110,7 +110,7 @@ extern "C" {
           status = F_status_set_error(F_parameter);
         }
         else if (main->parameters.array[ids[i]].result & f_console_result_value_e) {
-          index = main->parameters.array[ids[i]].values.array[main->parameters.array[ids[i]].values.used - 1];
+          index = main->parameters.array[ids[i]].values.array[main->parameters.array[ids[i]].location];
 
           if (!main->parameters.arguments.array[index].used) {
             control_print_error_parameter_value_empty(main, names[i]);
index df063c06315be600263559646ff75178714248f6..afbbd50ac9425b53cb241fa5747cf5aa5318c02c 100644 (file)
@@ -615,7 +615,7 @@ extern "C" {
     data->cache.small.used = 0;
 
     if (main->parameters.array[control_parameter_settings_e].result & f_console_result_value_e) {
-      const f_array_length_t index = main->parameters.array[control_parameter_settings_e].values.array[main->parameters.array[control_parameter_settings_e].values.used - 1];
+      const f_array_length_t index = main->parameters.array[control_parameter_settings_e].values.array[main->parameters.array[control_parameter_settings_e].location];
 
       status = f_string_dynamic_append(data->argv[index], &data->cache.small);
     }
@@ -707,7 +707,7 @@ extern "C" {
       data->cache.small.used = 0;
 
       if (main->parameters.array[control_parameter_socket_e].result & f_console_result_value_e) {
-        const f_array_length_t index = main->parameters.array[control_parameter_socket_e].values.array[main->parameters.array[control_parameter_socket_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[control_parameter_socket_e].values.array[main->parameters.array[control_parameter_socket_e].location];
 
         status = f_string_dynamic_append(data->argv[index], &data->cache.small);
       }
@@ -772,7 +772,7 @@ extern "C" {
           for (uint8_t i = 0; i < 3; ++i) {
 
             if (append_ids[i] && main->parameters.array[append_ids[i]].result & f_console_result_value_e) {
-              const f_array_length_t index = main->parameters.array[append_ids[i]].values.array[main->parameters.array[append_ids[i]].values.used - 1];
+              const f_array_length_t index = main->parameters.array[append_ids[i]].values.array[main->parameters.array[append_ids[i]].location];
 
               status = f_string_dynamic_append(data->argv[index], &data->cache.small);
             }
index 85f2fd3900104dc0ea9aa2286dcb642c3cb87b1c..4b8762239bcd05b8c5fd46dbc0908643a0ca249c 100644 (file)
@@ -144,7 +144,7 @@ extern "C" {
         status = F_status_set_error(F_parameter);
       }
       else if (main->parameters.array[controller_parameter_settings_e].locations.used) {
-        const f_array_length_t index = main->parameters.array[controller_parameter_settings_e].values.array[main->parameters.array[controller_parameter_settings_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[controller_parameter_settings_e].values.array[main->parameters.array[controller_parameter_settings_e].location];
 
         status = controller_path_canonical_relative(&setting, argv[index], &setting.path_setting);
 
@@ -185,7 +185,7 @@ extern "C" {
       else if (main->parameters.array[controller_parameter_pid_e].locations.used) {
         setting.path_pid.used = 0;
 
-        const f_array_length_t index = main->parameters.array[controller_parameter_pid_e].values.array[main->parameters.array[controller_parameter_pid_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[controller_parameter_pid_e].values.array[main->parameters.array[controller_parameter_pid_e].location];
 
         if (argv[index].used) {
           status = controller_path_canonical_relative(&setting, argv[index], &setting.path_pid);
@@ -241,7 +241,7 @@ extern "C" {
         status = F_status_set_error(F_parameter);
       }
       else if (main->parameters.array[controller_parameter_cgroup_e].locations.used) {
-        const f_array_length_t index = main->parameters.array[controller_parameter_cgroup_e].values.array[main->parameters.array[controller_parameter_cgroup_e].values.used - 1];
+        const f_array_length_t index = main->parameters.array[controller_parameter_cgroup_e].values.array[main->parameters.array[controller_parameter_cgroup_e].location];
 
         if (argv[index].used) {
           status = controller_path_canonical_relative(&setting, argv[index], &setting.path_cgroup);
index dabdae7d9dd6995efdcd83cd0744196588da3b54..9b9b94ffdc28ba4a6db077e9cc8e8aabfd074636 100644 (file)
@@ -2218,7 +2218,7 @@ extern "C" {
         if (f_compare_dynamic_partial_string(options[i].string, source, options[i].used, content) == F_equal_to) {
           if (values[i]) {
             if (parameters->array[codes[i]].result & f_console_result_value_e) {
-              const f_array_length_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].values.used - 1];
+              const f_array_length_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].location];
 
               status = f_string_dynamic_increase_by(symbols[i].used + expands[i].used + f_string_ascii_space_s.used + argv[index].used + 1, destination);
               if (F_status_is_error(status)) return status;
@@ -2290,7 +2290,7 @@ extern "C" {
 
           if (f_compare_dynamic_partial_string(buffer.string, source, buffer.used, content) == F_equal_to) {
             if (parameters->array[codes[i]].result & f_console_result_value_e) {
-              const f_array_length_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].values.used - 1];
+              const f_array_length_t index = parameters->array[codes[i]].values.array[parameters->array[codes[i]].location];
 
               status = f_string_dynamic_append(argv[index], destination);
               if (F_status_is_error(status)) return status;
index 5be6e321c57bfc4f646050094b80a397991561f5..55ae3d9993dd4cf286fe6dc2d6212c56b7757478 100644 (file)
@@ -248,7 +248,7 @@ extern "C" {
           }
 
           if (main->program.parameters.array[parameters[i]].result & f_console_result_value_e) {
-            index = main->program.parameters.array[parameters[i]].values.array[main->program.parameters.array[parameters[i]].values.used - 1];
+            index = main->program.parameters.array[parameters[i]].values.array[main->program.parameters.array[parameters[i]].location;
 
             if (main->program.parameters.arguments.array[index].used) {
               if (parameters[i] == fake_parameter_process_e) {
index f2c4ac5a11a6db0cce0cb76fd6c8996a71fe5c25..793eac62f5c16496956e9b5742f4ae0f5bf4f83f 100644 (file)
@@ -454,7 +454,7 @@ extern "C" {
         ];
 
       if (parameter->result & f_console_result_value_e) {
-        const f_array_length_t index = parameter->values.array[parameter->values.used - 1];
+        const f_array_length_t index = parameter->values.array[parameter->location];
 
         if (f_path_is_absolute(main->program.parameters.arguments.array[index]) == F_true || f_path_is_relative_current(main->program.parameters.arguments.array[index]) == F_true) {
           requireds[1] = F_none; // fake_long_data_s
index 5eaa40276df26d3dce91b0077c94f8aae8ed5672..c5948753dfaf56809ed714fe9d6fe04990e5ca28 100644 (file)
@@ -274,7 +274,7 @@ extern "C" {
   f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, fss_basic_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_value_e) {
-      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
+      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].location];
 
       const f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[index], number);
 
index b69d1da55d7c97550fad2cd231185921d3825a82..492df15dd1789400b5a42e559069a8852ac24813 100644 (file)
@@ -259,7 +259,7 @@ extern "C" {
   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_value_e) {
-      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
+      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].location];
 
       const f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[index], number);
 
index b6bd4fbe66cd7e29a1c3060999cfa872fbc54ea4..5264b1b91bd0fc0446ad5ce98c63890f2226cba3 100644 (file)
@@ -299,7 +299,7 @@ extern "C" {
       f_number_unsigned_t select = 0;
 
       if (data->main->parameters.array[fss_embedded_list_read_parameter_select_e].result & f_console_result_value_e) {
-        const f_array_length_t index = data->main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[data->main->parameters.array[fss_embedded_list_read_parameter_select_e].values.used - 1];
+        const f_array_length_t index = data->main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[data->main->parameters.array[fss_embedded_list_read_parameter_select_e].location];
 
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->main->parameters.arguments.array[index], &select);
 
@@ -319,7 +319,7 @@ extern "C" {
     f_array_length_t line = 0;
 
     if (data->main->parameters.array[fss_embedded_list_read_parameter_line_e].result & f_console_result_value_e) {
-      const f_array_length_t index = data->main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[data->main->parameters.array[fss_embedded_list_read_parameter_line_e].values.used - 1];
+      const f_array_length_t index = data->main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[data->main->parameters.array[fss_embedded_list_read_parameter_line_e].location];
 
       status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->main->parameters.arguments.array[index], &line);
 
index be48d0d442add9f528d70b9b085c1dbb9f54e502..1e52bf31ec9189c9f1ba3666c16205836a693c9b 100644 (file)
@@ -281,7 +281,7 @@ extern "C" {
   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_value_e) {
-      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
+      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].location];
 
       const f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[index], number);
 
index 7e620942702d7d31239ca1639be0a27f147348e1..6bc276fd435a2cc33e0d1c72248e64a73d129f38 100644 (file)
@@ -103,7 +103,7 @@ extern "C" {
         status = F_status_set_error(F_parameter);
       }
       else if (main->parameters.array[fss_identify_parameter_line_e].result & f_console_result_value_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_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].location];
 
         status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data.argv[index], &data.line);
 
@@ -143,7 +143,7 @@ extern "C" {
         status = F_status_set_error(F_parameter);
       }
       else if (main->parameters.array[fss_identify_parameter_name_e].result & f_console_result_value_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 index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].location];
         const f_array_length_t length = data.argv[index].used;
         const f_string_range_t range = macro_f_string_range_t_initialize_2(length);
 
index 14d08889c78b85201851fcc26811a622248091e6..d52f0878408c95f283ebc1733b375637795e3d91 100644 (file)
@@ -300,7 +300,7 @@ extern "C" {
   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_value_e) {
-      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
+      const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].location];
 
       const f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[index], number);
 
index 0665a165cdaf19146100de901ad75a4337a523c8..0c94992e219a5bc7e8180b0de06688a88b8cf776 100644 (file)
@@ -61,15 +61,15 @@ extern "C" {
  *
  *   F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
  *
+ *   Errors (with error bit) from: f_rip_dynamic().
  *   Errors (with error bit) from: f_string_append().
  *   Errors (with error bit) from: fl_conversion_dynamic_partial_to_unsigned_detect().
- *   Errors (with error bit) from: f_rip_dynamic().
  *
  *   Errors (with error bit) from: fss_payload_read_depths_resize().
  *
+ * @see f_rip_dynamic()
  * @see f_string_append()
  * @see fl_conversion_dynamic_partial_to_unsigned_detect()
- * @see f_rip_dynamic()
  *
  * @see fss_payload_read_depths_resize()
  */
index 29b4ea14ab93877af6891d1c42b890fae0aa42ce..de01cdd3de0f4576d3d641ba053cc2dfec2f52c6 100644 (file)
@@ -21,17 +21,19 @@ extern "C" {
 
     f_string_range_t input = macro_f_string_range_t_initialize_2(main->setting.buffer.used);
 
-    main->setting.delimits.used = 0;
-    main->setting.quotes.used = 0;
+    main->setting.delimits_object.used = 0;
+    main->setting.delimits_content.used = 0;
+    main->setting.quotes_object.used = 0;
+    main->setting.quotes_content.used = 0;
 
-    fll_fss_basic_read(main->setting.buffer, &input, &main->setting.objects, &main->setting.contents, &main->setting.quotes_object, &main->setting.delimits, 0, &main->setting.state);
+    fll_fss_basic_read(main->setting.buffer, &input, &main->setting.objects, &main->setting.contents, &main->setting.quotes_object, &main->setting.delimits_object, &main->setting.delimits_content, &main->setting.state);
 
-    if (F_status_is_error(data.setting.state.status)) {
-      if (F_status_set_fine(data.setting.state.status) == F_interrupt) return;
+    if (F_status_is_error(main->setting.state.status)) {
+      if (F_status_set_fine(main->setting.state.status) == F_interrupt) return;
 
       fll_error_file_print(
-        &main->error,
-        F_status_set_fine(data.setting.state.status),
+        &main->program.error,
+        F_status_set_fine(main->setting.state.status),
         macro_fss_read_f(fll_fss_basic_read),
         fll_error_file_flag_fallback_e,
         fss_read_file_identify(input.start, main->setting.files),
@@ -42,15 +44,15 @@ extern "C" {
       return;
     }
 
-    if (data.setting.state.status == F_data_not_stop || data.setting.state.status == F_data_not_eos) {
+    if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) {
       if (!(main->setting.flag & fss_read_main_flag_total_e)) {
-        data.setting.state.status = F_status_set_warning(status);
+        main->setting.state.status = F_status_set_warning(main->setting.state.status);
 
         return;
       }
     }
 
-    data.setting.state.status = F_none;
+    main->setting.state.status = F_none;
   }
 #endif // _di_fss_read_basic_process_load_
 
index 11d551d2ba1dc19fc488acf075a6f87c64c626eb..8775908059b2fd52c194e076a25e0e57d97b556c 100644 (file)
@@ -40,6 +40,7 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
+#include <fll/level_2/fss/basic.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -51,6 +52,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
@@ -105,7 +107,7 @@ extern "C" {
  * @see fss_read_file_identify()
  */
 #ifndef _di_fss_read_basic_process_load_
-  extern f_status_t fss_read_basic_process_load(fss_read_main_t * const main);
+  extern void fss_read_basic_process_load(fss_read_main_t * const main);
 #endif // _di_fss_read_basic_process_load_
 
 #ifdef __cplusplus
index 2c5a958d4bc46ffcf1feaa896361263342bb6f8d..08f31a92eb6a9d9d24a0c69c468e130211fe46bf 100644 (file)
@@ -52,6 +52,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
index 836c18c06ebc2285438cc171604d59244b46676d..a41e739e65458bafab6c0107a56c66c5c40e9366 100644 (file)
@@ -40,6 +40,7 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
+#include <fll/level_2/fss/embedded_list.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -51,6 +52,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
index 9d6c8bd151bb0a824631f7ebc6d0bd178fb86feb..dd5ac8661bb05acbe3f6547a31bc270ba7cb256e 100644 (file)
@@ -40,6 +40,7 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
+#include <fll/level_2/fss/extended.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -51,6 +52,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
index d05a015e3d58a3b649e6df40cb5f812fbb7a4726..5b0c76de83400b50542720f3c82c63b420a042b7 100644 (file)
@@ -40,6 +40,7 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
+#include <fll/level_2/fss/extended_list.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
@@ -51,6 +52,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
index f08f2511fbbf0d825a36b2515c73dfb88d1d220d..2e7acb92efa49f0ed16c3162bc5d8ea84f21fc77 100644 (file)
@@ -140,11 +140,11 @@ extern "C" {
         fss_read_long_delimit_s,
       };
 
-      static const f_string_t message_positive_number = "a positive number";
-      static const f_string_t message_string = "a string";
-      static const f_string_t message_value = "a value";
+      static const f_string_static_t message_positive_number = macro_f_string_static_t_initialize_1("a positive number", 0, 17);
+      static const f_string_static_t message_string = macro_f_string_static_t_initialize_1("a string", 0, 8);
+      static const f_string_static_t message_value = macro_f_string_static_t_initialize_1("a value", 0, 7);
 
-      static const f_string_t parameter_message[] = {
+      static const f_string_static_t parameter_message[] = {
         message_positive_number,
         message_positive_number,
         message_positive_number,
@@ -173,27 +173,27 @@ extern "C" {
 
       for (i = 0; i < 6; ++i) {
 
-        if (parameters->array[parameter_code[i]].result & f_console_result_found_e)) {
+        if (parameters->array[parameter_code[i]].result & f_console_result_found_e) {
           main->setting.state.status = F_status_set_error(F_parameter);
 
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fss_read_print_error_parameter_requires_message(&main->error, f_console_symbol_long_normal_s, parameter_name[i], parameter_message[i]);
+          fss_read_print_error_parameter_requires_message(&main->program.error, f_console_symbol_long_normal_s, parameter_name[i], parameter_message[i]);
 
           return;
         }
-        else if (parameters->array[parameter_code[i]].result & f_console_result_value_e)) {
+        else if (parameters->array[parameter_code[i]].result & f_console_result_value_e) {
           main->setting.state.flag |= parameter_flag[i];
 
           if (parameter_value_digit[i]) {
-            index = parameters->array[parameter_code[i]].values.array[parameters->array[parameter_code[i]].values.used - 1];
+            index = parameters->array[parameter_code[i]].values.array[parameters->array[parameter_code[i]].location];
 
-            main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], parameter_value_digit_single[i]);
+            main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], parameter_value_digit[i]);
 
             if (F_status_is_error(main->setting.state.status)) {
-              fll_error_parameter_integer_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, parameter_name[i], parameters->arguments.array[index]);
+              fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, parameter_name[i], parameters->arguments.array[index]);
 
               return;
             }
@@ -232,12 +232,12 @@ extern "C" {
         if (parameters->array[parameter_code[i]].result & parameter_match[i]) {
           main->setting.state.status = F_status_set_error(F_parameter);
 
-          if (main->error.verbosity > f_console_verbosity_quiet_e) {
+          if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
             if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_program_print_error_parameter_cannot_use_with(&main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_read_long_columns_s, parameter_name[i]);
+            fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_read_long_columns_s, parameter_name[i]);
           }
 
           return;
@@ -251,13 +251,13 @@ extern "C" {
       if ((parameters->array[fss_read_parameter_total_e].result & f_console_result_found_e) || (parameters->array[fss_read_parameter_total_e].result & f_console_result_found_e)) {
         main->setting.state.status = F_status_set_error(F_parameter);
 
-        if (main->error.verbosity > f_console_verbosity_quiet_e) {
+        if (main->program.error.verbosity > f_console_verbosity_quiet_e) {
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
           fll_program_print_error_parameter_cannot_use_with(
-            &main->error, f_console_symbol_long_normal_s,
+            &main->program.error, f_console_symbol_long_normal_s,
             f_console_symbol_long_normal_s,
             fss_read_long_pipe_s,
             (parameters->array[fss_read_parameter_total_e].result & f_console_result_found_e)
@@ -290,7 +290,7 @@ extern "C" {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fll_program_print_error_parameter_empty_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_file_s);
+          fll_program_print_error_parameter_empty_value(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_delimit_s);
 
           return;
         }
@@ -390,7 +390,7 @@ extern "C" {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_error_parameter_integer_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_partial_to_unsigned_detect), F_true, fss_read_long_delimit_s, parameters->arguments.array[index]);
+            fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_partial_to_unsigned_detect), F_true, fss_read_long_delimit_s, parameters->arguments.array[index]);
 
             return;
           }
@@ -457,7 +457,7 @@ extern "C" {
       main->setting.flag |= fss_read_main_flag_trim_e;
     }
 
-    main->setting.state.status = fss_read_setting_load_depth(arguments, main, parameters);
+    fss_read_setting_load_depth(arguments, main, parameters);
     if (F_status_is_error(main->setting.state.status)) return;
 
     if (parameters->array[fss_read_parameter_select_e].result & f_console_result_found_e) {
@@ -467,7 +467,9 @@ extern "C" {
         fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
       }
 
-      fll_program_print_error_parameter_integer_not_positive(&main->error, f_console_symbol_long_normal_s, fss_read_long_select_s);
+      index = parameters->array[fss_read_parameter_select_e].values.array[i];
+
+      fll_program_print_error_parameter_integer_not_positive(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_select_s, parameters->arguments.array[index]);
 
       return;
     }
@@ -478,7 +480,7 @@ extern "C" {
 
     f_file_t file = f_file_t_initialize;
 
-    if (main->pipe & fll_program_data_pipe_input_e) {
+    if (main->program.pipe & fll_program_data_pipe_input_e) {
       file.id = F_type_descriptor_input_d;
       file.stream = F_type_input_d;
 
@@ -491,7 +493,7 @@ extern "C" {
           fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
         }
 
-        fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_read), fll_error_file_flag_fallback_e, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+        fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_read), fll_error_file_flag_fallback_e, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
 
         return;
       }
@@ -533,21 +535,21 @@ extern "C" {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_open), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+          fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_open), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
 
           break;
         }
 
         size_file = 0;
 
-        main->setting.state.status = f_file_size_by_id(file.id, &size_file);
+        main->setting.state.status = f_file_size_by_id(file, &size_file);
 
         if (F_status_is_error(main->setting.state.status)) {
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_size_by_id), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
+          fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_size_by_id), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
 
           break;
         }
@@ -555,15 +557,15 @@ extern "C" {
         if (size_file) {
 
           // Enforce a max block read size to allow for interrupts to be processed between blocks.
-          if (size_file > fss_basic_list_read_block_max) {
-            file.size_read = fss_basic_list_read_block_read_large;
-            size_block = fss_basic_list_read_block_max;
+          if (size_file > fss_read_allocation_block_max_d) {
+            file.size_read = fss_read_allocation_block_read_large_d;
+            size_block = fss_read_allocation_block_max_d;
 
             // Pre-allocate entire file buffer plus space for the terminating NULL.
             f_string_dynamic_increase_by(size_file + (size_block - (size_file % size_block)) + 1, &main->setting.buffer);
           }
           else {
-            file.size_read = fss_basic_list_read_block_read_small;
+            file.size_read = fss_read_allocation_block_read_small_d;
             size_block = size_file;
 
             // Pre-allocate entire file buffer plus space for the terminating NULL.
@@ -575,26 +577,26 @@ extern "C" {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_string_dynamic_increase_by), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_process_s, fll_error_file_type_file_e);
+            fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_string_dynamic_increase_by), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_process_s, fll_error_file_type_file_e);
 
             break;
           }
 
           for (size_read = 0; size_read < size_file; size_read += size_block) {
 
-            if (size_file > fss_basic_list_read_block_max && fss_read_signal_check(main)) break;
+            if (size_file > fss_read_allocation_block_max_d && fss_read_signal_check(main)) break;
 
             main->setting.state.status = f_file_stream_read_until(file, size_block, &main->setting.buffer);
             if (F_status_is_error(main->setting.state.status)) break;
           } // for
 
           if (F_status_is_error(main->setting.state.status)) {
-            if (F_status_set_fine(status) != F_interrupt) {
+            if (F_status_set_fine(main->setting.state.status) != F_interrupt) {
               if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
                 fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
               }
 
-              fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_read_until), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
+              fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_file_stream_read_until), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_read_s, fll_error_file_type_file_e);
             }
 
             break;
@@ -635,8 +637,8 @@ extern "C" {
       i = parameters->array[fss_read_parameter_depth_e].values.used;
     }
 
-    if (i > data->depths.size) {
-      main->setting.state.status = fss_read_depths_resize(i, &data->depths);
+    if (i > main->setting.depths.size) {
+      main->setting.state.status = fss_read_depths_resize(i, &main->setting.depths);
 
       if (F_status_is_error(main->setting.state.status)) {
         if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
@@ -649,23 +651,23 @@ extern "C" {
       }
     }
 
-    data->depths.used = depth_size;
+    main->setting.depths.used = i;
 
     f_array_length_t position_depth = 0;
     f_array_length_t position_at = 0;
     f_array_length_t position_name = 0;
 
-    for (i = 0; i < data->depths.used; ++i) {
+    for (i = 0; i < main->setting.depths.used; ++i) {
 
       if (fss_read_signal_check(main)) return;
 
-      data->depths.array[i].depth = 0;
-      data->depths.array[i].index_at = 0;
-      data->depths.array[i].index_name = 0;
-      data->depths.array[i].value_at = 0;
+      main->setting.depths.array[i].depth = 0;
+      main->setting.depths.array[i].index_at = 0;
+      main->setting.depths.array[i].index_name = 0;
+      main->setting.depths.array[i].value_at = 0;
 
       // This dynamic string is actually a static string, so clear it between loops.
-      macro_f_string_dynamic_t_clear(data->depths.array[i].value_name);
+      macro_f_string_dynamic_t_clear(main->setting.depths.array[i].value_name);
 
       if (!parameters->array[fss_read_parameter_depth_e].values.used) {
         position_depth = 0;
@@ -673,14 +675,14 @@ extern "C" {
       else {
         position_depth = parameters->array[fss_read_parameter_depth_e].values.array[i];
 
-        main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[position_depth], &data->depths.array[i].depth);
+        main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[position_depth], &main->setting.depths.array[i].depth);
 
         if (F_status_is_error(main->setting.state.status)) {
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_depth_s, data->argv[position_depth]);
+          fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_depth_s, parameters->arguments.array[position_depth]);
 
           return;
         }
@@ -693,20 +695,20 @@ extern "C" {
             continue;
           }
 
-          if (i + 1 < data->depths.used && parameters->array[fss_read_parameter_at_e].values.array[position_at] > parameters->array[fss_read_parameter_depth_e].values.array[i + 1]) {
+          if (i + 1 < main->setting.depths.used && parameters->array[fss_read_parameter_at_e].values.array[position_at] > parameters->array[fss_read_parameter_depth_e].values.array[i + 1]) {
             break;
           }
 
-          data->depths.array[i].index_at = parameters->array[fss_read_parameter_at_e].values.array[position_at];
+          main->setting.depths.array[i].index_at = parameters->array[fss_read_parameter_at_e].values.array[position_at];
 
-          main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, data->argv[data->depths.array[i].index_at], &data->depths.array[i].value_at);
+          main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[main->setting.depths.array[i].index_at], &main->setting.depths.array[i].value_at);
 
           if (F_status_is_error(main->setting.state.status)) {
             if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
               fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
             }
 
-            fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_at_s, data->argv[data->depths.array[i].index_at]);
+            fll_error_parameter_integer_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(fl_conversion_dynamic_to_unsigned_detect), F_true, fss_read_long_at_s, parameters->arguments.array[main->setting.depths.array[i].index_at]);
 
             return;
           }
@@ -720,17 +722,17 @@ extern "C" {
             continue;
           }
 
-          if (i + 1 < data->depths.used && parameters->array[fss_read_parameter_name_e].values.array[position_name] > parameters->array[fss_read_parameter_depth_e].values.array[i + 1]) {
+          if (i + 1 < main->setting.depths.used && parameters->array[fss_read_parameter_name_e].values.array[position_name] > parameters->array[fss_read_parameter_depth_e].values.array[i + 1]) {
             break;
           }
 
-          data->depths.array[i].index_name = parameters->array[fss_read_parameter_name_e].values.array[position_name];
+          main->setting.depths.array[i].index_name = parameters->array[fss_read_parameter_name_e].values.array[position_name];
 
           if (parameters->array[fss_read_parameter_trim_e].result & f_console_result_found_e) {
-            main->setting.state.status = f_rip_dynamic(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+            main->setting.state.status = f_rip_dynamic(parameters->arguments.array[main->setting.depths.array[i].index_name], &main->setting.depths.array[i].value_name);
           }
           else {
-            main->setting.state.status = f_string_dynamic_append(data->argv[data->depths.array[i].index_name], &data->depths.array[i].value_name);
+            main->setting.state.status = f_string_dynamic_append(parameters->arguments.array[main->setting.depths.array[i].index_name], &main->setting.depths.array[i].value_name);
           }
 
           if (F_status_is_error(main->setting.state.status)) {
@@ -748,32 +750,32 @@ extern "C" {
 
     f_array_length_t j = 0;
 
-    for (i = 0; i < data->depths.used; ++i) {
+    for (i = 0; i < main->setting.depths.used; ++i) {
 
-      for (j = i + 1; j < data->depths.used; ++j) {
+      for (j = i + 1; j < main->setting.depths.used; ++j) {
 
         if (fss_read_signal_check(main)) return;
 
-        if (data->depths.array[i].depth == data->depths.array[j].depth) {
+        if (main->setting.depths.array[i].depth == main->setting.depths.array[j].depth) {
           main->setting.state.status = F_status_set_error(F_parameter);
 
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fss_read_print_error_parameter_value_once_only_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, data->depths.array[i].depth);
+          fss_read_print_error_parameter_value_once_only_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, main->setting.depths.array[i].depth);
 
           return;
         }
 
-        if (data->depths.array[i].depth > data->depths.array[j].depth) {
+        if (main->setting.depths.array[i].depth > main->setting.depths.array[j].depth) {
           main->setting.state.status = F_status_set_error(F_parameter);
 
           if ((main->setting.flag & fss_read_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
             fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
           }
 
-          fss_read_print_error_parameter_value_before_value_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, data->depths.array[i].depth, data->depths.array[j].depth);
+          fss_read_print_error_parameter_value_before_value_number(&main->program.error, f_console_symbol_long_normal_s, fss_read_long_depth_s, main->setting.depths.array[i].depth, main->setting.depths.array[j].depth);
 
           return;
         }
index e192d837da40837ec93f686948caf960437897da..ecdbeb920bd41201e7bc497c127d4b4d041239b6 100644 (file)
@@ -33,6 +33,20 @@ extern "C" {
 #endif // _di_fss_read_allocation_d_
 
 /**
+ * The program allocation block defines.
+ *
+ * fss_payload_read_block_*:
+ *   - max:        The max block read size before checking for interrupt.
+ *   - read_small: The block read size for small files.
+ *   - read_large: The block read size for large files.
+ */
+#ifndef _di_fss_read_allocation_d_
+  #define fss_read_allocation_block_max_d        16777216
+  #define fss_read_allocation_block_read_small_d 8192
+  #define fss_read_allocation_block_read_large_d 65536
+#endif // _di_fss_read_allocation_d_
+
+/**
  * The program signal defines.
  *
  * fss_read_signal_*_d:
index a2397276894263b9fc63a970c1b92b194937bc4a..d5205132b82e69db5b12dd2d066b656f8f2bd305 100644 (file)
@@ -22,12 +22,10 @@ extern "C" {
     f_status_t status = F_none;
 
     for (f_array_length_t i = length; i < depths->size; ++i) {
-
-      status = private_f_string_ranges_adjust(0, &depths->array[i]);
-      if (F_status_is_error(status)) return status;
+      fss_read_depth_delete(&depths->array[i]);
     } // for
 
-    status = f_memory_adjust(depths->size, length, sizeof(fss_read_file_t), (void **) & depths->array);
+    status = f_memory_resize(depths->size, length, sizeof(fss_read_file_t), (void **) & depths->array);
     if (F_status_is_error(status)) return status;
 
     depths->size = length;
@@ -74,14 +72,11 @@ extern "C" {
 
     if (!setting) return F_status_set_error(F_parameter);
 
-    f_string_dynamic_resize(0, &setting->escaped);
-    f_string_dynamic_resize(0, &setting->block);
-    f_string_dynamic_resize(0, &setting->buffer);
-    f_string_dynamic_resize(0, &setting->prepend);
-
     fss_read_files_resize(0, &setting->files);
     fss_read_depths_resize(0, &setting->depths);
 
+    f_string_dynamic_resize(0, &setting->buffer);
+
     f_string_ranges_resize(0, &setting->objects);
     f_string_ranges_resize(0, &setting->comments);
     f_string_rangess_resize(0, &setting->contents);
index b14f227005b36a2acd55a8925dfbe0ffb6106775..dc18df28c89823bd52a8c5c4cf4c469cb40e86e6 100644 (file)
@@ -123,6 +123,7 @@ extern "C" {
  * process_last_line:  Process printing last line if necessary when loading in a file (or pipe).
  * process_load_depth: Process loading of the depth related parameters when loading the settings.
  * process_normal:     Process normally (data from parameters and files).
+ * process_pipe:       Process data piped to the program from standard input (stdin).
  *
  * process_at:       Process at parameter, usually called by the process_normal() callback.
  * process_columns:  Process columns parameter, usually called by the process_normal() callback.
@@ -144,6 +145,7 @@ extern "C" {
     void (*process_last_line)(void * const main);
     void (*process_load_depth)(const f_console_arguments_t arguments, void * const main);
     void (*process_normal)(void * const main);
+    void (*process_pipe)(void * const main);
 
     void (*process_at)(void * const main, const bool names[], const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content);
     void (*process_columns)(void * const main, const bool names[]);
@@ -154,7 +156,7 @@ extern "C" {
 
     void (*print_at)(void * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content);
     void (*print_object)(fl_print_t * const print, const f_array_length_t at, const f_fss_delimits_t delimits);
-    void (*print_content)(fl_print_t * const print, const f_array_length_t at, const uint8_t quote, const f_fss_delimits_t delimits);
+    void (*print_content)(fl_print_t * const print, const f_string_range_t range, const uint8_t quote, const f_fss_delimits_t delimits);
     void (*print_content_ignore)(fl_print_t * const print);
     void (*print_object_end)(fl_print_t * const print);
     void (*print_set_end)(fl_print_t * const print);
@@ -293,10 +295,11 @@ extern "C" {
  *
  * @param depth
  *   The depth to deallocate.
+ *
  *   Must not be NULL.
  */
 #ifndef _di_fss_read_depth_delete_
-  extern f_status_t fss_read_depth_delete(fss_read_depth_t * const depth);
+  extern void fss_read_depth_delete(fss_read_depth_t * const depth);
 #endif // _di_fss_read_depth_delete_
 
 /**
@@ -306,6 +309,7 @@ extern "C" {
  *   The new size to use.
  * @param depths
  *   The depths to resize.
+ *
  *   Must not be NULL.
  *
  * @return
@@ -328,6 +332,7 @@ extern "C" {
  *   The new size to use.
  * @param files
  *   The files to resize.
+ *
  *   Must not be NULL.
  *
  * @return
@@ -336,8 +341,10 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *
  *   Errors (with error bit) from: f_memory_resize().
+ *   Errors (with error bit) from: f_string_ranges_resize().
  *
  * @see f_memory_resize()
+ * @see f_string_ranges_resize()
  */
 #ifndef _di_fss_read_files_resize_
   extern f_status_t fss_read_files_resize(const f_array_length_t length, fss_read_files_t * const files);
index f5e0f51526346f45eced8033a5b9fda7d140bae6..3053a80c6f7b1a4a9f265f6011747d565ae2189c 100644 (file)
@@ -9,21 +9,10 @@ extern "C" {
 
     if (!main) return F_false;
 
-    if (main->setting.delimit_mode == fss_read_delimit_mode_none_e) {
-      return F_false;
-    }
-
-    if (main->setting.delimit_mode == fss_read_delimit_mode_all_e) {
-      return F_true;
-    }
-
-    if (depth < main->setting.delimit_depth) {
-      return main->setting.delimit_mode == fss_read_delimit_mode_content_lesser_e;
-    }
-
-    if (depth == main->setting.delimit_depth) {
-      return F_true;
-    }
+    if (main->setting.delimit_mode == fss_read_delimit_mode_none_e) return F_false;
+    if (main->setting.delimit_mode == fss_read_delimit_mode_all_e) return F_true;
+    if (depth < main->setting.delimit_depth) return main->setting.delimit_mode == fss_read_delimit_mode_content_lesser_e;
+    if (depth == main->setting.delimit_depth) return F_true;
 
     return main->setting.delimit_mode == fss_read_delimit_mode_content_greater_e;
   }
@@ -107,7 +96,7 @@ extern "C" {
     }
 
     if (F_status_is_error_not(main->setting.state.status)) {
-      if (main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e | fss_read_main_flag_object_open_e | fss_read_main_flag_content_next_e | fss_read_main_flag_content_end_e)) {
+      if (main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e)) {
         if (main->callback.process_normal) {
           main->callback.process_normal(void_main);
         }
@@ -180,7 +169,7 @@ extern "C" {
               fss_read_print_number(&main->program.output, 1);
             }
             else {
-              fss_read_print_content(&main->program.output, range, main->setting.quotes_content.array[at], delimits_content);
+              fss_read_print_content(&main->program.output, range, main->setting.quotes_content.array[at].array[0], delimits_content);
             }
 
             main->setting.state.status = F_success;
@@ -207,7 +196,7 @@ extern "C" {
           else {
             range.stop = main->setting.contents.array[at].array[0].stop;
 
-            fss_read_print_content(&main->program.output, range, main->setting.quotes_content.array[at], delimits_content);
+            fss_read_print_content(&main->program.output, range, main->setting.quotes_content.array[at].array[0], delimits_content);
             f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
           }
 
@@ -226,16 +215,11 @@ extern "C" {
   f_string_static_t fss_read_file_identify(const f_array_length_t at, const fss_read_files_t files) {
 
     for (f_array_length_t i = 0; i < files.used; ++i) {
-
-      if (at >= files.array[i].range.start && at <= files.array[i].range.stop) {
-        return files.array[i].name;
-      }
+      if (at >= files.array[i].range.start && at <= files.array[i].range.stop) return files.array[i].name;
     } // for
 
     // When stopped after the end of the buffer, the last file in the list is the correct file.
-    if (at > files.array[files.used - 1].range.stop) {
-      return files.array[files.used - 1].name;
-    }
+    if (at > files.array[files.used - 1].range.stop) return files.array[files.used - 1].name;
 
     return f_string_empty_s;
   }
@@ -255,7 +239,7 @@ extern "C" {
         fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
       }
 
-      fll_error_file_print(&main->error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_string_dynamic_append_assure), fll_error_file_flag_fallback_e, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+      fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_fss_read_f(f_string_dynamic_append_assure), fll_error_file_flag_fallback_e, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
     }
   }
 #endif // _di_fss_read_process_last_line_
index 25c5f9f483c3951839174ed3a0f03c10f986b385..0f57c42b357040132c7ef08d5eadd0dc1d60b69a 100644 (file)
@@ -54,6 +54,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
@@ -81,7 +82,7 @@ extern "C" {
  *   F_false if to not apply delimits (fallback when main is NULL).
  */
 #ifndef _di_fss_read_delimit_content_is_
-  extern f_status_t fss_read_delimit_content_is(fss_read_main_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
+  extern f_status_t fss_read_delimit_content_is(fss_read_main_t * const main, const f_array_length_t depth);
 #endif // _di_fss_read_delimit_content_is_
 
 /**
@@ -101,7 +102,7 @@ extern "C" {
  *   F_false if to not apply delimits (fallback when main is NULL).
  */
 #ifndef _di_fss_read_delimit_object_is_
-  extern f_status_t fss_read_delimit_object_is(fss_read_main_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
+  extern f_status_t fss_read_delimit_object_is(fss_read_main_t * const main, const f_array_length_t depth);
 #endif // _di_fss_read_delimit_object_is_
 
 /**
@@ -161,6 +162,7 @@ extern "C" {
  * @param line
  *   The current line being processed.
  *   This will be incremented as necessary.
+ *
  *   Must not be NULL.
  *
  * @return
@@ -185,7 +187,7 @@ extern "C" {
  *   On failure to identify, an empty string is returned.
  */
 #ifndef _di_fss_read_file_identify_
-  extern f_string_static_t fss_read_file_identify(const f_array_length_t at, const fss_read_files_t files) F_attribute_visibility_internal_d;
+  extern f_string_static_t fss_read_file_identify(const f_array_length_t at, const fss_read_files_t files);
 #endif // _di_fss_read_file_identify_
 
 /**
index 1e823f193a563e981320429b2fccd859165d334a..8b95673db3da08e6e930a2e84b0ac6662ccad3cc 100644 (file)
@@ -5,7 +5,7 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_read_print_at_
-  void fss_read_print_at(fl_print_t * const print, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content) {
+  f_status_t fss_read_print_at(fl_print_t * const print, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -28,7 +28,7 @@ extern "C" {
 
       if ((main->setting.flag & fss_read_main_flag_content_e) && main->setting.contents.array[at].used) {
         if (main->callback.print_content) {
-          main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at], delimits_content);
+          main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[0], main->setting.quotes_content.array[at].array[0], delimits_content);
         }
       }
 
@@ -48,8 +48,8 @@ extern "C" {
 
     fss_read_main_t * const main = (fss_read_main_t *) print->custom;
 
-    if (data.callback.print_content_ignore) {
-      data.callback.print_content_ignore(&main->program.output);
+    if (main->callback.print_content_ignore) {
+      main->callback.print_content_ignore(&main->program.output);
     }
 
     if (main->setting.flag & fss_read_main_flag_original_e) {
@@ -66,24 +66,26 @@ extern "C" {
       }
     }
 
-    if (data.callback.print_content_ignore) {
-      data.callback.print_content_ignore(&main->program.output);
+    if (main->callback.print_content_ignore) {
+      main->callback.print_content_ignore(&main->program.output);
     }
 
     return F_none;
   }
-#endif _di_fss_read_print_content_
+#endif // _di_fss_read_print_content_
 
 #ifndef _di_fss_read_print_content_ignore_
-  void fss_read_print_content_ignore(fl_print_t * const print) {
+  f_status_t fss_read_print_content_ignore(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom,
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
 
     if (main->setting.flag & fss_read_main_flag_pipe_e) {
       fll_print_dynamic_raw(fss_read_pipe_content_ignore_s, print->to);
     }
+
+    return F_none;
   }
 #endif // _di_fss_read_print_content_ignore_
 
@@ -103,40 +105,40 @@ extern "C" {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom,
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
 
     if (at >= main->setting.objects.used) return F_output_not;
 
-    if (main->setting.flag & fss_read_data_option_trim_d) {
-      if (main->setting.flag & fss_read_data_option_original_d) {
-        if (main->setting.quotes.array[at]) {
+    if (main->setting.flag & fss_read_main_flag_trim_e) {
+      if (main->setting.flag & fss_read_main_flag_original_e) {
+        if (main->setting.quotes_object.array[at]) {
           fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]);
         }
 
         fll_print_trim_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], main->program.output.to);
 
-        if (main->setting.quotes.array[at]) {
+        if (main->setting.quotes_object.array[at]) {
           fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]);
         }
       }
       else {
-        fll_print_trim_except_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], delimits_object, main->program.output.to);
+        fll_print_trim_except_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], delimits, main->program.output.to);
       }
     }
     else {
       if (main->setting.flag & fss_read_main_flag_original_e) {
-        if (main->setting.quotes.array[at]) {
+        if (main->setting.quotes_object.array[at]) {
           fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]);
         }
 
         fll_print_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], main->program.output.to);
 
-        if (main->setting.quotes.array[at]) {
+        if (main->setting.quotes_object.array[at]) {
           fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]);
         }
       }
       else {
-        fll_print_except_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], delimits_object, main->program.output.to);
+        fll_print_except_dynamic_partial(main->setting.buffer, main->setting.objects.array[at], delimits, main->program.output.to);
       }
     }
 
@@ -149,7 +151,7 @@ extern "C" {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom,
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
 
     if (main->setting.flag & fss_read_main_flag_pipe_e) {
       fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
@@ -168,6 +170,8 @@ extern "C" {
       }
       */
     }
+
+    return F_none;
   }
 #endif // _di_fss_read_print_object_end_
 
@@ -194,7 +198,7 @@ extern "C" {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom,
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
 
     if (main->setting.flag & fss_read_main_flag_pipe_e) {
       fll_print_dynamic_raw(fss_read_pipe_content_end_s, print->to);
index 500a281dbc3058c77b310f64b98c2265087185de..da206d286a1de0de7e4304d1fdf6f5937b2f4017 100644 (file)
@@ -89,7 +89,7 @@ extern "C" {
  * @see main.callback.print_set_end()
  */
 #ifndef _di_fss_read_print_content_
-  extern f_status_t fss_read_print_content(fl_print_t * const print, const f_array_length_t at, const uint8_t quote, const f_fss_delimits_t delimits);
+  extern f_status_t fss_read_print_content(fl_print_t * const print, const f_string_range_t range, const uint8_t quote, const f_fss_delimits_t delimits);
 #endif // _di_fss_read_print_content_
 
 /**
index 0faa7f328cd375615c0a21a80089483f6a207113..7373fa76017913aa53ba78739e0c96adcb6d285b 100644 (file)
@@ -28,28 +28,6 @@ extern "C" {
   }
 #endif // _di_fss_read_print_error_file_
 
-#ifndef _di_fss_read_print_error_parameter_same_times_at_least_
-  f_status_t fss_read_print_error_parameter_same_times_at_least(fl_print_t * const print) {
-
-    if (!print) return F_status_set_error(F_output_not);
-    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
-    f_file_stream_lock(print->to);
-
-    fl_print_format("%[%QMust specify the '%]", print->to, print->context, print->prefix, print->context);
-    fl_print_format("%[%r%r%]", print->to, print->notable, f_console_symbol_long_normal_s, fss_read_long_content_s, print->notable);
-    fl_print_format("%[' parameter at least the same number of times as the '%]", print->to, print->context, print->context);
-    fl_print_format("%[%r%r%]", print->to, print->notable, f_console_symbol_long_normal_s, fss_read_long_object_s, print->notable);
-    fl_print_format("%[' parameter when not specifying the '%]", print->to, print->context, print->context);
-    fl_print_format("%[%r%r%]", print->to, print->notable, f_console_symbol_long_normal_s, fss_read_long_partial_s, print->notable);
-    fl_print_format("%[' parameter.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
-    f_file_stream_unlock(print->to);
-
-    return F_none;
-  }
-#endif // _di_fss_read_print_error_parameter_same_times_at_least_
-
 #ifndef _di_fss_read_print_error_parameter_requires_message_
   f_status_t fss_read_print_error_parameter_requires_message(fl_print_t * const print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t message) {
 
@@ -128,24 +106,6 @@ extern "C" {
   }
 #endif // _di_fss_read_print_error_one_content_only_
 
-#ifndef _fss_read_print_error_prepend_only_whitespace_
-  f_status_t fss_read_print_error_prepend_only_whitespace(fl_print_t * const print) {
-
-    if (!print) return F_status_set_error(F_output_not);
-    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
-    f_file_stream_lock(print->to);
-
-    fl_print_format("%[%QThe value for the parameter '%]", print->to, print->set->error, print->prefix, print->set->error);
-    fl_print_format("%[%r%r%]", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_prepend_s, print->set->notable);
-    fl_print_format("%[' must only contain white space.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
-
-    f_file_stream_unlock(print->to);
-
-    return F_none;
-  }
-#endif // _fss_read_print_error_prepend_only_whitespace_
-
 #ifndef _di_fss_read_print_error_unsupported_eol_
   f_status_t fss_read_print_error_unsupported_eol(fl_print_t * const print) {
 
index 35ccac40433731abd87fd48401b9993984424f54..20666a0b980d24b0e66cbbc7d5ce5d6d40a5a051 100644 (file)
@@ -70,28 +70,6 @@ extern "C" {
 #endif // _di_fss_read_print_error_file_
 
 /**
- * Print an error message about the object and content parameters not being specified at least the same number of times when partial is not requested.
- *
- * @param print
- *   The output structure to print to.
- *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
- *   This does not alter print.custom.setting.state.status.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see fll_error_print()
- */
-#ifndef _di_fss_read_print_error_parameter_same_times_at_least_
-  extern f_status_t fss_read_print_error_parameter_same_times_at_least(fl_print_t * const print);
-#endif // _di_fss_read_print_error_parameter_same_times_at_least_
-
-/**
  * Print an error message about the parameter requires something that is explained by the message parameter.
  *
  * @param print
@@ -195,26 +173,6 @@ extern "C" {
 #endif // _di_fss_read_print_error_one_content_only_
 
 /**
- * Print error when prepend parameter has something other than white space.
- *
- * @param print
- *   The output structure to print to.
- *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
- *   This does not alter print.custom.setting.state.status.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if a parameter is NULL.
- */
-#ifndef _fss_read_print_error_prepend_only_whitespace_
-  extern f_status_t fss_read_print_error_prepend_only_whitespace(fl_print_t * const print);
-#endif // _fss_read_print_error_prepend_only_whitespace_
-
-/**
  * Print an error message about a parameter New Line character '\n' (U+000A) being unsupported.
  *
  * @param print
index 93512c76c714b82590de67d0361d7dd3b3113d13..f39c25f697730bf9fad5bb2da9ea09a8c1204b43 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 
     // For depth, most standards do not support nesting, so any depth greater than 0 can be predicted without processing the buffer.
     // For select, most standards do not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
-    if (!(main->setting.flag & fss_read_main_flag_depth_multiple_e) && main->setting.depths.array[0].depth || !(main->setting.flag & fss_read_main_flag_content_multiple_e) && ((main->setting.flag & fss_read_main_flag_select_e) && data->select)) {
+    if (!(main->setting.flag & fss_read_main_flag_depth_multiple_e) && main->setting.depths.array[0].depth || !(main->setting.flag & fss_read_main_flag_content_multiple_e) && ((main->setting.flag & fss_read_main_flag_select_e) && main->setting.select)) {
       if (main->setting.flag & fss_read_main_flag_total_e) {
         fss_read_print_number(&main->program.output, 0);
       }
@@ -86,7 +86,7 @@ extern "C" {
 #endif // _di_fss_read_process_normal_
 
 #ifndef _di_fss_read_process_normal_at_
-  void fss_read_process_normal_at(void * const main, const bool names[], const f_array_lengths_t delimits_object, f_array_lengths_t delimits_content) {
+  void fss_read_process_normal_at(void * const void_main, const bool names[], const f_array_lengths_t delimits_object, f_array_lengths_t delimits_content) {
 
     if (!void_main) return;
 
@@ -106,7 +106,7 @@ extern "C" {
     if (main->setting.flag & (fss_read_main_flag_line_e | fss_read_main_flag_line_single_e) == (fss_read_main_flag_line_e | fss_read_main_flag_line_single_e)) {
       if (main->setting.line) {
         if (main->setting.flag & fss_read_main_flag_total_e) {
-          fss_read_print_zero(main);
+          fss_read_print_number(&main->program.output, 0);
         }
 
         main->setting.state.status = F_none;
@@ -135,13 +135,13 @@ extern "C" {
 
           line = 0;
 
-          if (data->option & fss_basic_list_read_data_option_total_d) {
+          if (main->setting.flag & fss_read_main_flag_total_e) {
 
             // Total is always 1 in this case because "line" parameter forces a single line.
             fss_read_print_number(&main->program.output, 1);
           }
           else {
-            fss_read_process_at_line(main, data, i, delimits_object, delimits_content, &line);
+            fss_read_process_at_line(main, i, delimits_object, delimits_content, &line);
           }
 
           if (main->setting.state.status == F_success) {
@@ -155,7 +155,7 @@ extern "C" {
         }
         else if (main->setting.flag & fss_read_main_flag_total_e) {
           if (main->setting.flag & fss_read_main_flag_line_single_e) {
-            fss_read_print_number(main, main->setting.contents.array[i].used ? 1 : 0);
+            fss_read_print_number(&main->program.output, main->setting.contents.array[i].used ? 1 : 0);
           }
           else {
             total = 0;
@@ -201,7 +201,7 @@ extern "C" {
 #endif // _di_fss_read_process_normal_at_
 
 #ifndef _di_fss_read_process_normal_columns_
-  void fss_read_process_normal_columns(void * const main, const bool names[]) {
+  void fss_read_process_normal_columns(void * const void_main, const bool names[]) {
 
     if (!void_main) return;
 
@@ -234,14 +234,12 @@ extern "C" {
 #endif // _di_fss_read_process_normal_columns_
 
 #ifndef _di_fss_read_process_normal_line_
-  void fss_read_process_normal_line(void * const main, const bool names[]) {
+  void fss_read_process_normal_line(void * const void_main, const bool names[]) {
 
     if (!void_main) return;
 
     fss_read_main_t * const main = (fss_read_main_t *) void_main;
 
-    const f_array_lengths_t * const delimits = !(main->setting.flag & fss_read_main_flag_original_e) && fss_read_delimit_object_is(main, 0) ? &main->setting.delimits : &fss_read_except_none_c;
-
     f_array_length_t line = 0;
 
     for (f_array_length_t i = 0; i < main->setting.contents.used; ++i) {
@@ -269,7 +267,16 @@ extern "C" {
 
       if (line == main->setting.line) {
         if (main->callback.print_at) {
-          main->callback.print_at(main, i, *delimits, fss_read_except_none_c);
+          main->callback.print_at(
+            main,
+            i,
+            !(main->setting.flag & fss_read_main_flag_original_e) && fss_read_delimit_object_is(main, 0)
+              ? main->setting.delimits_object
+              : fss_read_except_none_c,
+            !(main->setting.flag & fss_read_main_flag_original_e) && fss_read_delimit_content_is(main, 0)
+              ? main->setting.delimits_content
+              : fss_read_except_none_c
+          );
         }
 
         break;
@@ -283,7 +290,7 @@ extern "C" {
 #endif // _di_fss_read_process_normal_line_
 
 #ifndef _di_fss_read_process_normal_name_
-  void fss_read_process_normal_name(void * const main, const bool names[]) {
+  void fss_read_process_normal_name(void * const void_main, bool names[]) {
 
     if (!void_main) return;
 
@@ -299,7 +306,7 @@ extern "C" {
 
           if (fss_read_signal_check(main)) return;
 
-          if (f_compare_dynamic_partial_except_trim_dynamic(main->setting.depths.array[0].value_name, main->setting.buffer, main->setting.objects.array[i], fss_read_except_none_c, main->setting.delimits) == F_equal_to) {
+          if (f_compare_dynamic_partial_except_trim_dynamic(main->setting.depths.array[0].value_name, main->setting.buffer, main->setting.objects.array[i], fss_read_except_none_c, main->setting.delimits_object) == F_equal_to) {
             names[i] = F_true;
           }
         } // for
@@ -309,7 +316,7 @@ extern "C" {
 
           if (fss_read_signal_check(main)) return;
 
-          if (f_compare_dynamic_partial_except_dynamic(main->setting.depths.array[0].value_name, main->setting.buffer, main->setting.objects.array[i], fss_read_except_none_c, main->setting.delimits) == F_equal_to) {
+          if (f_compare_dynamic_partial_except_dynamic(main->setting.depths.array[0].value_name, main->setting.buffer, main->setting.objects.array[i], fss_read_except_none_c, main->setting.delimits_object) == F_equal_to) {
             names[i] = F_true;
           }
         } // for
@@ -324,7 +331,7 @@ extern "C" {
 #endif // _di_fss_read_process_normal_name_
 
 #ifndef _di_fss_read_process_normal_total_
-  void fss_read_process_normal_total(void * const main, const bool names[]) {
+  void fss_read_process_normal_total(void * const void_main, const bool names[]) {
 
     if (!void_main) return;
 
index 177a1d791be3cfdb72c0713e76ecef0d095e7241..dfa3e2c8d24c3c461b658c7e7db2d2e1afbfac9a 100644 (file)
@@ -141,7 +141,7 @@ extern "C" {
  * @see fss_read_signal_check()
  */
 #ifndef _di_fss_read_process_normal_name_
-  extern void fss_read_process_normal_name(void * const main, const bool names[]);
+  extern void fss_read_process_normal_name(void * const main, bool names[]);
 #endif // _di_fss_read_process_normal_name_
 
 /**
index 89685f08466d8260264b9ac99aa23fdb6623a56e..fb2073d4469b45ae63905296529f6195bcead3e1 100644 (file)
@@ -30,13 +30,14 @@ extern "C" {
     f_array_length_t length = 0;
     f_string_range_t range = f_string_range_t_initialize;
 
+    // @todo much of this is copied from fss_write and needs to be updated or removed accordingly.
+
     const f_array_length_t used_objects = main->setting.objects.used;
-    const f_array_length_t used_contentss = main->setting.contentss.used;
-    const f_array_length_t used_ignoress = main->setting.ignoress.used;
+    const f_array_length_t used_contents = main->setting.contents.used;
 
+    // @fixme really? why am I setting a pointer to the used position, which may not even be allocated? Review this and perhaps first pre-allocate the space so the used is within the size.
     main->setting.object = &main->setting.objects.array[used_objects];
-    main->setting.contents = &main->setting.contentss.array[used_contentss];
-    main->setting.ignores = &main->setting.ignoress.array[used_ignoress];
+    main->setting.contents = &main->setting.contents.array[used_contents];
 
     // 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object, 0x8 = "payload" matched.
     uint8_t flag = 0;
@@ -70,19 +71,9 @@ extern "C" {
       return;
     }
 
-    // This is processed in a single set, so there is only ever one Ignores added.
-    main->setting.state.status = f_string_rangess_increase(main->setting.state.step_small, &main->setting.ignoress);
-
-    if (F_status_is_error(main->setting.state.status)) {
-      fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_rangess_increase));
-
-      return;
-    }
-
     // Reset all of the used data before starting the loop.
     main->setting.object->used = 0;
     main->setting.contents->used = 0;
-    main->setting.ignores->used = 0;
 
     for (;;) {
 
@@ -297,7 +288,6 @@ extern "C" {
         // Reset all of the used data for next set.
         main->setting.object->used = 0;
         main->setting.contents->used = 0;
-        main->setting.ignores->used = 0;
 
         continue;
       }
@@ -327,7 +317,6 @@ extern "C" {
         // Reset all of the used data for next set.
         main->setting.object->used = 0;
         main->setting.contents->used = 0;
-        main->setting.ignores->used = 0;
       }
     } // for
 
@@ -342,10 +331,8 @@ extern "C" {
     main->setting.buffer.used = 0;
     main->setting.object->used = 0;
     main->setting.contents->used = 0;
-    main->setting.ignores->used = 0;
     main->setting.objects.used = used_objects;
-    main->setting.contentss.used = used_contentss;
-    main->setting.ignoress.used = used_ignoress;
+    main->setting.contentss.used = used_contents;
 
     if (F_status_is_error_not(main->setting.state.status)) {
       if (flag & 0x1) {
@@ -476,7 +463,7 @@ extern "C" {
         const f_string_static_t *prepend = 0;
 
         if (main->setting.flag & fss_read_main_flag_prepend_e) {
-          const f_array_length_t index = main->program.parameters.array[fss_read_parameter_prepend_e].values.array[main->program.parameters.array[fss_read_parameter_prepend_e].values.used - 1];
+          const f_array_length_t index = main->program.parameters.array[fss_read_parameter_prepend_e].values.array[main->program.parameters.array[fss_read_parameter_prepend_e].location]];
 
           prepend = &main->program.parameters.arguments.array[index];
         }
@@ -500,14 +487,12 @@ extern "C" {
       }
 
       if ((main->setting.flag & fss_read_main_flag_partial_e) && !(main->setting.flag & fss_read_main_flag_object_e) || !(main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e))) {
-        if (main->setting.flag & fss_read_main_flag_content_end_e) {
-          main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &main->setting.buffer);
+        main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &main->setting.buffer);
 
-          if (F_status_is_error(main->setting.state.status)) {
-            fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append));
+        if (F_status_is_error(main->setting.state.status)) {
+          fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append));
 
-            return;
-          }
+          return;
         }
       }
     }
index 618b1c407c236305fbfe36716130761cfff53460..b68c29b33a73695c82346b7c69b2de502dec9957 100644 (file)
@@ -40,6 +40,7 @@
 
 // FLL-2 includes.
 #include <fll/level_2/error.h>
+#include <fll/level_2/fss/extended.h>
 #include <fll/level_2/fss/payload.h>
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
@@ -52,6 +53,7 @@
 #include <program/fss_read/main/common/string.h>
 #include <program/fss_read/main/common/type.h>
 #include <program/fss_read/main/common.h>
+#include <program/fss_read/main/print/data.h>
 #include <program/fss_read/main/print/error.h>
 #include <program/fss_read/main/print/message.h>
 #include <program/fss_read/main/process_normal.h>
index a629b5e73a5ab398a57f8728f243dcdb8a1e318c..c96756287c6688d8930a6f0732ae80756821b06a 100644 (file)
@@ -19,7 +19,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.setting.state.custom = (void *) &data;
   data.setting.standard = fss_read_payload_standard_s;
 
-  // @todo see if there needs to be this: data.callback.process_pipe = &fss_read_payload_process_pipe;
+  data.callback.process_pipe = &fss_read_payload_process_pipe;
   data.callback.process_help = &fss_read_payload_process_help;
   data.callback.process_last_line = &fss_read_process_last_line;
   //data.callback.process_load_depth = &fss_read_setting_load_depth;
index fb7a0c212e38c4e0437f6d8da637d5593f71f438..97dc17c0a43a24c7713856c3a492a8f5452829ac 100644 (file)
@@ -37,7 +37,7 @@ build_libraries-individual_thread -lf_thread
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library main/fss_read.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/static.c main/common/string.c main/common/type.c main/print/error.c main/print/message.c main/process_normal.c main/signal.c main/thread.c
+build_sources_library main/fss_read.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/static.c main/common/string.c main/common/type.c main/print/data.c main/print/error.c main/print/message.c main/process_normal.c main/signal.c main/thread.c
 build_sources_library basic/fss_read.c basic/common.c basic/print.c
 build_sources_library basic_list/fss_read.c basic_list/common.c basic_list/print.c
 build_sources_library embedded_list/fss_read.c embedded_list/common.c embedded_list/print.c
@@ -45,7 +45,7 @@ build_sources_library extended/fss_read.c extended/common.c extended/print.c
 build_sources_library extended_list/fss_read.c extended_list/common.c extended_list/print.c
 build_sources_library payload/fss_read.c payload/common.c payload/print.c
 
-build_sources_headers main/fss_read.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/static.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h main/process_normal.h main/signal.h main/thread.h
+build_sources_headers main/fss_read.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/static.h main/common/string.h main/common/type.h main/print/data.h main/print/error.h main/print/message.h main/process_normal.h main/signal.h main/thread.h
 build_sources_headers basic/fss_read.h basic/common.h basic/print.h basic/private-common.h
 build_sources_headers basic_list/fss_read.h basic_list/common.h basic_list/print.h
 build_sources_headers embedded_list/fss_read.h embedded_list/common.h embedded_list/print.h
index 26e2484a43babb244d194a2adc1cb9cc5e034451..fed315f8e6cfd6c719e7e8edbf1297563493ec86 100644 (file)
@@ -305,7 +305,7 @@ extern "C" {
     }
 
     if ((main->program.parameters.array[fss_write_parameter_prepend_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_prepend_e].values.used) {
-      const f_array_length_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].values.used - 1];
+      const f_array_length_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].location];
 
       main->setting.prepend.used = 0;
 
index 6b2b4c8444103bc57b809f9452ddfc8026df97ae..7e2e8c5efe526758fe02649ab7d213af207789da 100644 (file)
@@ -486,7 +486,7 @@ extern "C" {
         const f_string_static_t *prepend = 0;
 
         if (main->setting.flag & fss_write_main_flag_prepend_e) {
-          const f_array_length_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].values.used - 1];
+          const f_array_length_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].location];
 
           prepend = &main->program.parameters.arguments.array[index];
         }
index 29aa0886bd1a7ba56d9501955236ceff27ef2cd2..1beaa74614feb69360f553a5be65f25822de1152 100644 (file)
@@ -129,7 +129,7 @@ extern "C" {
         return;
       }
 
-      const f_array_length_t index = main->program.parameters.array[iki_read_parameter_at_e].values.array[main->program.parameters.array[iki_read_parameter_at_e].values.used - 1];
+      const f_array_length_t index = main->program.parameters.array[iki_read_parameter_at_e].values.array[main->program.parameters.array[iki_read_parameter_at_e].location];
 
       main->setting.at = 0;
 
@@ -162,7 +162,7 @@ extern "C" {
     }
 
     if (main->program.parameters.array[iki_read_parameter_line_e].result & f_console_result_value_e) {
-      const f_array_length_t index = main->program.parameters.array[iki_read_parameter_line_e].values.array[main->program.parameters.array[iki_read_parameter_line_e].values.used - 1];
+      const f_array_length_t index = main->program.parameters.array[iki_read_parameter_line_e].values.array[main->program.parameters.array[iki_read_parameter_line_e].location];
 
       main->setting.line = 0;