]> Kevux Git Server - fll/commitdiff
Progress: Continue mass converting to f_string_static_t.
authorKevin Day <thekevinday@gmail.com>
Fri, 4 Feb 2022 05:02:58 +0000 (23:02 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 4 Feb 2022 05:02:58 +0000 (23:02 -0600)
Additional cleanups and improvements performed as noticed.

144 files changed:
level_0/f_console/c/console-common.h
level_0/f_console/data/build/settings-tests
level_0/f_console/tests/c/test-console-parameter_prioritize_left.c
level_0/f_console/tests/c/test-console-parameter_prioritize_right.c
level_0/f_console/tests/c/test-console-parameter_process.c
level_0/f_console/tests/c/test-console-parameters_delete.c [new file with mode: 0644]
level_0/f_console/tests/c/test-console-parameters_delete.h [new file with mode: 0644]
level_0/f_console/tests/c/test-console-parameters_destroy.c [new file with mode: 0644]
level_0/f_console/tests/c/test-console-parameters_destroy.h [new file with mode: 0644]
level_0/f_console/tests/c/test-console.c
level_0/f_console/tests/c/test-console.h
level_0/f_control_group/c/control_group.h
level_0/f_string/c/private-string.c
level_0/f_string/c/private-string.h
level_0/f_string/c/string.c
level_0/f_string/c/string.h
level_0/f_string/c/string_dynamic.c
level_0/f_string/c/string_dynamic.h
level_0/f_string/c/string_map.c
level_0/f_string/c/string_map.h
level_0/f_string/c/string_quantity.c
level_0/f_string/c/string_quantity.h
level_0/f_string/c/string_range.c
level_0/f_string/c/string_triple.c
level_0/f_string/c/string_triple.h
level_0/f_utf/c/utf_dynamic.c
level_1/fl_environment/c/environment.c
level_2/fll_execute/c/execute.c
level_2/fll_execute/c/execute.h
level_2/fll_execute/c/private-execute.c
level_2/fll_execute/c/private-execute.h
level_3/byte_dump/c/common.h
level_3/controller/c/rule/private-rule_print.c
level_3/fake/c/common.h
level_3/fake/c/fake.c
level_3/fake/c/private-build-library.c
level_3/fake/c/private-build-load.c
level_3/fake/c/private-build-objects.c
level_3/fake/c/private-build-program.c
level_3/fake/c/private-build.c
level_3/fake/c/private-make-load_fakefile.c
level_3/fake/c/private-make-operate_process.c
level_3/fake/c/private-make-operate_process_type.c
level_3/fake/c/private-make-operate_validate.c
level_3/firewall/c/common.c [new file with mode: 0644]
level_3/firewall/c/common.h [new file with mode: 0644]
level_3/firewall/c/firewall.c
level_3/firewall/c/firewall.h
level_3/firewall/c/main.c
level_3/firewall/c/private-common.c
level_3/firewall/c/private-common.h
level_3/firewall/c/private-firewall.c
level_3/firewall/c/private-firewall.h
level_3/firewall/data/build/settings
level_3/fss_basic_list_read/c/common.c [new file with mode: 0644]
level_3/fss_basic_list_read/c/common.h [new file with mode: 0644]
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/fss_basic_list_read.h
level_3/fss_basic_list_read/data/build/settings
level_3/fss_basic_list_write/c/common.c [new file with mode: 0644]
level_3/fss_basic_list_write/c/common.h [new file with mode: 0644]
level_3/fss_basic_list_write/c/fss_basic_list_write.c
level_3/fss_basic_list_write/c/fss_basic_list_write.h
level_3/fss_basic_list_write/data/build/settings
level_3/fss_basic_read/c/common.c [new file with mode: 0644]
level_3/fss_basic_read/c/common.h [new file with mode: 0644]
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/fss_basic_read.h
level_3/fss_basic_read/data/build/settings
level_3/fss_basic_write/c/common.c [new file with mode: 0644]
level_3/fss_basic_write/c/common.h [new file with mode: 0644]
level_3/fss_basic_write/c/fss_basic_write.c
level_3/fss_basic_write/c/fss_basic_write.h
level_3/fss_basic_write/data/build/settings
level_3/fss_embedded_list_read/c/common.c [new file with mode: 0644]
level_3/fss_embedded_list_read/c/common.h [new file with mode: 0644]
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/fss_embedded_list_read.h
level_3/fss_embedded_list_read/data/build/settings
level_3/fss_embedded_list_write/c/common.c [new file with mode: 0644]
level_3/fss_embedded_list_write/c/common.h [new file with mode: 0644]
level_3/fss_embedded_list_write/c/fss_embedded_list_write.c
level_3/fss_embedded_list_write/c/fss_embedded_list_write.h
level_3/fss_embedded_list_write/data/build/settings
level_3/fss_extended_list_read/c/common.c [new file with mode: 0644]
level_3/fss_extended_list_read/c/common.h [new file with mode: 0644]
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/fss_extended_list_read.h
level_3/fss_extended_list_read/data/build/settings
level_3/fss_extended_list_write/c/common.c [new file with mode: 0644]
level_3/fss_extended_list_write/c/common.h [new file with mode: 0644]
level_3/fss_extended_list_write/c/fss_extended_list_write.c
level_3/fss_extended_list_write/c/fss_extended_list_write.h
level_3/fss_extended_list_write/data/build/settings
level_3/fss_extended_read/c/common.c [new file with mode: 0644]
level_3/fss_extended_read/c/common.h [new file with mode: 0644]
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/fss_extended_read.h
level_3/fss_extended_read/data/build/settings
level_3/fss_extended_write/c/common.c [new file with mode: 0644]
level_3/fss_extended_write/c/common.h [new file with mode: 0644]
level_3/fss_extended_write/c/fss_extended_write.c
level_3/fss_extended_write/c/fss_extended_write.h
level_3/fss_extended_write/data/build/settings
level_3/fss_identify/c/common.c [new file with mode: 0644]
level_3/fss_identify/c/common.h [new file with mode: 0644]
level_3/fss_identify/c/fss_identify.c
level_3/fss_identify/c/fss_identify.h
level_3/fss_identify/data/build/settings
level_3/fss_payload_read/c/common.c [new file with mode: 0644]
level_3/fss_payload_read/c/common.h [new file with mode: 0644]
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/fss_payload_read.h
level_3/fss_payload_read/data/build/settings
level_3/fss_payload_write/c/common.c [new file with mode: 0644]
level_3/fss_payload_write/c/common.h [new file with mode: 0644]
level_3/fss_payload_write/c/fss_payload_write.c
level_3/fss_payload_write/c/fss_payload_write.h
level_3/fss_payload_write/data/build/settings
level_3/fss_status_code/c/common.c [new file with mode: 0644]
level_3/fss_status_code/c/common.h [new file with mode: 0644]
level_3/fss_status_code/c/fss_status_code.c
level_3/fss_status_code/c/fss_status_code.h
level_3/fss_status_code/data/build/settings
level_3/iki_read/c/common.c [new file with mode: 0644]
level_3/iki_read/c/common.h [new file with mode: 0644]
level_3/iki_read/c/iki_read.c
level_3/iki_read/c/iki_read.h
level_3/iki_read/data/build/settings
level_3/iki_write/c/common.c [new file with mode: 0644]
level_3/iki_write/c/common.h [new file with mode: 0644]
level_3/iki_write/c/iki_write.c
level_3/iki_write/c/iki_write.h
level_3/iki_write/data/build/settings
level_3/status_code/c/common.c [new file with mode: 0644]
level_3/status_code/c/common.h [new file with mode: 0644]
level_3/status_code/c/status_code.c
level_3/status_code/c/status_code.h
level_3/status_code/data/build/settings
level_3/utf8/c/common.c [new file with mode: 0644]
level_3/utf8/c/common.h [new file with mode: 0644]
level_3/utf8/c/utf8.c
level_3/utf8/c/utf8.h
level_3/utf8/data/build/settings

index b756452c2b82c80a73f45cf0fe329dd98d220611..5a1f8bdc474e603543bde12542edc37cec5c94f2 100644 (file)
@@ -343,7 +343,7 @@ extern "C" {
 
   #define f_console_parameters_t_initialize {0, f_string_dynamics_t_initialize, 0 }
 
-  #define macro_f_console_parameters_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, used }
+  #define macro_f_console_parameters_t_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, used }
 #endif // _di_f_console_parameters_t_
 
 /**
index 495df1783ce6f0e94f8ed789fcde8fbdea9cd868..cf8fbb40dd4a2f94ede7106de210aef405f0a585 100644 (file)
@@ -19,7 +19,7 @@ build_libraries -lc -lcmocka
 build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_console
 build_libraries-level -lfll_0
 build_libraries-monolithic -lfll
-build_sources_program test-console-identify.c test-console-parameter_prioritize_left.c test-console-parameter_prioritize_right.c test-console-parameter_process.c test-console.c
+build_sources_program test-console-identify.c test-console-parameter_prioritize_left.c test-console-parameter_prioritize_right.c test-console-parameter_process.c test-console-parameters_delete.c test-console-parameters_destroy.c test-console.c
 build_script no
 build_shared yes
 build_static no
index b5d9af1769296a1bb6c195523b2a3285c661bf16..bc1d30f5e0b4deec2c025c9d9ac2997c7740993e 100644 (file)
@@ -18,19 +18,21 @@ void test__f_console_parameter_prioritize_left__fails(void **state) {
 
     f_console_parameter_t parameter = f_console_parameter_t_initialize;
     f_console_parameter_t parameters_array[1] = { parameter };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 1;
 
     const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
 
     assert_int_equal(F_status_set_fine(status), F_parameter);
   }
+
+  f_console_parameters_delete(&parameters);
 }
 
 #ifndef _di_level_0_parameter_checking_
   void test__f_console_parameter_prioritize_left__parameter_checking(void **state) {
 
-    const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+    f_console_parameters_t parameters = f_console_parameters_t_initialize;
     f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize;
 
     {
@@ -47,6 +49,8 @@ void test__f_console_parameter_prioritize_left__fails(void **state) {
 
       assert_int_equal(F_status_set_fine(status), F_parameter);
     }
+
+    f_console_parameters_delete(&parameters);
   }
 #endif // _di_level_0_parameter_checking_
 
@@ -72,7 +76,7 @@ void test__f_console_parameter_prioritize_left__works(void **state) {
 
     f_console_parameter_t parameter = f_console_parameter_t_initialize;
     f_console_parameter_t parameters_array[1] = { parameter };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 1;
 
     const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
@@ -96,7 +100,7 @@ void test__f_console_parameter_prioritize_left__works(void **state) {
     parameter_2.location_sub = 4;
 
     f_console_parameter_t parameters_array[2] = { parameter_1, parameter_2 };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 2;
 
     const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
@@ -104,6 +108,8 @@ void test__f_console_parameter_prioritize_left__works(void **state) {
     assert_int_equal(status, F_none);
     assert_int_equal(decision, 1);
   }
+
+  f_console_parameters_delete(&parameters);
 }
 
 #ifdef __cplusplus
index eb80b462c83d33b0e0169716224e7912affe6a7b..3e38a64ebc2f0cefc918ba30845824587b03ee66 100644 (file)
@@ -18,19 +18,21 @@ void test__f_console_parameter_prioritize_right__fails(void **state) {
 
     f_console_parameter_t parameter = f_console_parameter_t_initialize;
     f_console_parameter_t parameters_array[1] = { parameter };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 1;
 
     const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
 
     assert_int_equal(F_status_set_fine(status), F_parameter);
   }
+
+  f_console_parameters_delete(&parameters);
 }
 
 #ifndef _di_level_0_parameter_checking_
   void test__f_console_parameter_prioritize_right__parameter_checking(void **state) {
 
-    const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+    f_console_parameters_t parameters = f_console_parameters_t_initialize;
     f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize;
 
     {
@@ -47,6 +49,8 @@ void test__f_console_parameter_prioritize_right__fails(void **state) {
 
       assert_int_equal(F_status_set_fine(status), F_parameter);
     }
+
+    f_console_parameters_delete(&parameters);
   }
 #endif // _di_level_0_parameter_checking_
 
@@ -72,7 +76,7 @@ void test__f_console_parameter_prioritize_right__works(void **state) {
 
     f_console_parameter_t parameter = f_console_parameter_t_initialize;
     f_console_parameter_t parameters_array[1] = { parameter };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 1;
 
     const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
@@ -96,7 +100,7 @@ void test__f_console_parameter_prioritize_right__works(void **state) {
     parameter_2.location_sub = 4;
 
     f_console_parameter_t parameters_array[2] = { parameter_1, parameter_2 };
-    parameters.parameter = parameters_array;
+    parameters.array = parameters_array;
     parameters.used = 2;
 
     const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
@@ -104,6 +108,8 @@ void test__f_console_parameter_prioritize_right__works(void **state) {
     assert_int_equal(status, F_none);
     assert_int_equal(decision, 0);
   }
+
+  f_console_parameters_delete(&parameters);
 }
 
 #ifdef __cplusplus
index 30edde0e56964ebab07a85823a4d6bf188d17b5f..200c3177c619a856e8b178db58ba40073b8d8cbb 100644 (file)
@@ -30,7 +30,7 @@ void test__f_console_parameter_process__no_arguments(void **state) {
   f_array_lengths_t remaining = f_array_lengths_t_initialize;
 
   {
-    const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+    const f_status_t status = f_console_parameter_process(arguments, &parameters, &remaining);
 
     assert_int_equal(status, F_none);
 
@@ -125,7 +125,7 @@ void test__f_console_parameter_process__only_remaining(void **state) {
   f_array_lengths_t remaining = f_array_lengths_t_initialize;
 
   {
-    const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+    const f_status_t status = f_console_parameter_process(arguments, &parameters, &remaining);
 
     assert_int_equal(status, F_none);
 
@@ -193,10 +193,10 @@ void test__f_console_parameter_process__only_remaining(void **state) {
   void test__f_console_parameter_process__parameter_checking(void **state) {
 
     const f_console_arguments_t arguments = f_console_arguments_t_initialize;
-    const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+    f_console_parameters_t parameters = f_console_parameters_t_initialize;
 
     {
-      const f_status_t status = f_console_parameter_process(arguments, parameters, 0);
+      const f_status_t status = f_console_parameter_process(arguments, &parameters, 0);
 
       assert_int_equal(F_status_set_fine(status), F_parameter);
     }
@@ -245,7 +245,7 @@ void test__f_console_parameter_process__works(void **state) {
   f_array_lengths_t remaining = f_array_lengths_t_initialize;
 
   {
-    const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+    const f_status_t status = f_console_parameter_process(arguments, &parameters, &remaining);
 
     assert_int_equal(status, F_none);
 
diff --git a/level_0/f_console/tests/c/test-console-parameters_delete.c b/level_0/f_console/tests/c/test-console-parameters_delete.c
new file mode 100644 (file)
index 0000000..6eb1b48
--- /dev/null
@@ -0,0 +1,66 @@
+#include "test-console.h"
+#include "test-console-parameters_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_console_parameters_delete__frees_memory(void **state) {
+
+  const f_array_length_t size = 3;
+
+  f_console_parameters_t parameters = f_console_parameters_t_initialize;
+  f_console_parameter_t parameter = f_console_parameter_t_initialize;
+  f_console_parameter_t parameters_array[1] = { parameter };
+
+  parameters.array = parameters_array;
+  parameters.used = 1;
+
+  {
+    const f_status_t status = f_string_dynamics_resize(size, &parameters.arguments);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.arguments.size, 0);
+    assert_non_null(parameters.arguments.array);
+  }
+
+  {
+    const f_status_t status = f_type_array_lengths_resize(3, &parameters.array[0].locations);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.array[0].locations.size, 0);
+    assert_non_null(parameters.array[0].locations.array);
+  }
+
+  {
+    const f_status_t status = f_type_array_lengths_resize(size, &parameters.array[0].locations_sub);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.array[0].locations_sub.size, 0);
+    assert_non_null(parameters.array[0].locations_sub.array);
+  }
+
+  {
+    const f_status_t status = f_console_parameters_delete(&parameters);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(parameters.arguments.size, 0);
+    assert_int_equal(parameters.array[0].locations.size, 0);
+    assert_int_equal(parameters.array[0].locations_sub.size, 0);
+  }
+}
+
+#ifndef _di_level_0_parameter_checking_
+  void test__f_console_parameters_delete__parameter_checking(void **state) {
+
+    {
+      const f_status_t status = f_console_parameters_delete(0);
+
+      assert_int_equal(F_status_set_fine(status), F_parameter);
+    }
+  }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_console/tests/c/test-console-parameters_delete.h b/level_0/f_console/tests/c/test-console-parameters_delete.h
new file mode 100644 (file)
index 0000000..b15c282
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Console
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the console project.
+ */
+#ifndef _TEST__F_console__delete
+#define _TEST__F_console__delete
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_console_parameters_delete()
+ */
+extern void test__f_console_parameters_delete__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_console_parameters_delete()
+ */
+#ifndef _di_level_0_parameter_checking_
+  extern void test__f_console_parameters_delete__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_console__delete
diff --git a/level_0/f_console/tests/c/test-console-parameters_destroy.c b/level_0/f_console/tests/c/test-console-parameters_destroy.c
new file mode 100644 (file)
index 0000000..a4ac15c
--- /dev/null
@@ -0,0 +1,66 @@
+#include "test-console.h"
+#include "test-console-parameters_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_console_parameters_destroy__frees_memory(void **state) {
+
+  const f_array_length_t size = 3;
+
+  f_console_parameters_t parameters = f_console_parameters_t_initialize;
+  f_console_parameter_t parameter = f_console_parameter_t_initialize;
+  f_console_parameter_t parameters_array[1] = { parameter };
+
+  parameters.array = parameters_array;
+  parameters.used = 1;
+
+  {
+    const f_status_t status = f_string_dynamics_resize(size, &parameters.arguments);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.arguments.size, 0);
+    assert_non_null(parameters.arguments.array);
+  }
+
+  {
+    const f_status_t status = f_type_array_lengths_resize(size, &parameters.array[0].locations);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.array[0].locations.size, 0);
+    assert_non_null(parameters.array[0].locations.array);
+  }
+
+  {
+    const f_status_t status = f_type_array_lengths_resize(size, &parameters.array[0].locations_sub);
+
+    assert_int_equal(status, F_none);
+    assert_int_not_equal(parameters.array[0].locations_sub.size, 0);
+    assert_non_null(parameters.array[0].locations_sub.array);
+  }
+
+  {
+    const f_status_t status = f_console_parameters_destroy(&parameters);
+
+    assert_int_equal(status, F_none);
+    assert_int_equal(parameters.arguments.size, 0);
+    assert_int_equal(parameters.array[0].locations.size, 0);
+    assert_int_equal(parameters.array[0].locations_sub.size, 0);
+  }
+}
+
+#ifndef _di_level_0_parameter_checking_
+  void test__f_console_parameters_destroy__parameter_checking(void **state) {
+
+    {
+      const f_status_t status = f_console_parameters_destroy(0);
+
+      assert_int_equal(F_status_set_fine(status), F_parameter);
+    }
+  }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_0/f_console/tests/c/test-console-parameters_destroy.h b/level_0/f_console/tests/c/test-console-parameters_destroy.h
new file mode 100644 (file)
index 0000000..588e561
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * FLL - Level 0
+ *
+ * Project: Console
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the console project.
+ */
+#ifndef _TEST__F_console__destroy
+#define _TEST__F_console__destroy
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_console_parameters_destroy()
+ */
+extern void test__f_console_parameters_destroy__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_console_parameters_destroy()
+ */
+#ifndef _di_level_0_parameter_checking_
+  extern void test__f_console_parameters_destroy__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_console__destroy
index a554c693af6e3aba77bf2d488681cadfb6ce7206..b8267b6ac099c3f3660d892b6e3c7ae695572cd9 100644 (file)
@@ -34,11 +34,17 @@ int main(void) {
     cmocka_unit_test(test__f_console_parameter_process__only_remaining),
     cmocka_unit_test(test__f_console_parameter_process__works),
 
+    cmocka_unit_test(test__f_console_parameters_delete__frees_memory),
+
+    cmocka_unit_test(test__f_console_parameters_destroy__frees_memory),
+
     #ifndef _di_level_0_parameter_checking_
       cmocka_unit_test(test__f_console_identify__parameter_checking),
       cmocka_unit_test(test__f_console_parameter_prioritize_left__parameter_checking),
       cmocka_unit_test(test__f_console_parameter_prioritize_right__parameter_checking),
       cmocka_unit_test(test__f_console_parameter_process__parameter_checking),
+      cmocka_unit_test(test__f_console_parameters_delete__parameter_checking),
+      cmocka_unit_test(test__f_console_parameters_destroy__parameter_checking),
     #endif // _di_level_0_parameter_checking_
   };
 
index 53e95778b2e769c86799bb14897660aa2233f3f0..43f0c93544f44a1432ee314b002a4da48e26262c 100644 (file)
@@ -27,6 +27,8 @@
 #include "test-console-parameter_prioritize_left.h"
 #include "test-console-parameter_prioritize_right.h"
 #include "test-console-parameter_process.h"
+#include "test-console-parameters_delete.h"
+#include "test-console-parameters_destroy.h"
 
 #ifdef __cplusplus
 extern "C" {
index f958bd609c34d2a35401dc92b2669358e69b9e41..c409ad2761329b63d11e84586c100d741a268521 100644 (file)
@@ -24,7 +24,7 @@
 #include <fll/level_0/memory.h>
 #include <fll/level_0/string.h>
 
-// fll-1 control includes
+// FLL-1 control includes.
 #include <fll/level_0/control_group-common.h>
 
 #ifdef __cplusplus
index 5919c4e813eb4e8f8126e14bb83e3b63ae99c834..8d2f650139d7e042beed06cd48cab33ab5bc9694 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
-  f_status_t private_f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t private_f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
 
     if (destination->used + length > destination->size) {
       const f_status_t status = private_f_string_dynamic_increase_by(length, destination);
@@ -21,7 +21,7 @@ extern "C" {
 #endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
 
 #if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
-  f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
 
     if (destination->used + length > F_string_t_size_d) {
       return F_status_set_error(F_string_too_large);
@@ -73,7 +73,7 @@ extern "C" {
 #endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
 
 #if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-  f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t *dynamic) {
+  f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
 
     f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string);
 
@@ -90,7 +90,7 @@ extern "C" {
 #endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
 
 #if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-  f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t *dynamic) {
+  f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) {
 
     if (dynamic->used + amount > dynamic->size) {
       if (dynamic->used + amount > F_string_t_size_d) {
@@ -105,7 +105,7 @@ extern "C" {
 #endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
 
 #if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-  f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *dynamic) {
+  f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
 
     const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string);
 
@@ -122,7 +122,7 @@ extern "C" {
 #endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
 
 #if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
-  f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+  f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
 
     if (dynamics->used + length > F_array_length_t_size_d) {
       return F_status_set_error(F_array_too_large);
@@ -174,7 +174,7 @@ extern "C" {
 #endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_)
 
 #if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
-  f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+  f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
 
     if (dynamics->used + length > F_array_length_t_size_d) {
       return F_status_set_error(F_array_too_large);
@@ -331,7 +331,7 @@ extern "C" {
 #endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
 
 #if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
-  f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
 
     if (destination->used + length > F_string_t_size_d) {
       return F_status_set_error(F_string_too_large);
@@ -356,7 +356,7 @@ extern "C" {
 #endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
 
 #if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
-  f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
 
     if (destination->used + length > F_string_t_size_d) {
       return F_status_set_error(F_string_too_large);
index 73ddcffe1172e0f61ac3b92233607bb7e8d0f8aa..74511c48cbfb9dde49463fe21dcfd380f5bdf031 100644 (file)
@@ -84,7 +84,7 @@ extern "C" {
  * @see f_string_mash_nulless()
  */
 #if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
-  extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
 
 /**
@@ -94,7 +94,7 @@ extern "C" {
  *
  * @param length
  *   The new size to use.
- * @param string
+ * @param dynamic
  *   The string to adjust.
  *
  * @return
@@ -114,7 +114,7 @@ extern "C" {
  * @see f_string_triples_decimate_by()
  */
 #if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
-  extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
 
 /**
@@ -124,7 +124,7 @@ extern "C" {
  *
  * @param amount
  *   A positive number representing how much to increase the size by.
- * @param string
+ * @param dynamic
  *   The string to resize.
  *
  * @return
@@ -162,7 +162,7 @@ extern "C" {
  * @see f_string_triples_append()
  */
 #if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-  extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
 
 /**
@@ -172,7 +172,7 @@ extern "C" {
  *
  * @param length
  *   The new size to use.
- * @param string
+ * @param dynamic
  *   The string to resize.
  *
  * @return
@@ -210,7 +210,7 @@ extern "C" {
  * @see f_string_triples_append()
  */
 #if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
-  extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
 
 /**
@@ -220,7 +220,7 @@ extern "C" {
  *
  * @param length
  *   The new size to use.
- * @param strings
+ * @param dynamics
  *   The strings to adjust.
  *
  * @return
@@ -238,7 +238,7 @@ extern "C" {
  * @see f_string_map_multis_append()
  */
 #if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
-  extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *strings) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
 
 /**
@@ -272,7 +272,7 @@ extern "C" {
  *
  * @param length
  *   The new size to use.
- * @param strings
+ * @param dynamics
  *   The strings to resize.
  *
  * @return
@@ -288,7 +288,7 @@ extern "C" {
  * @see f_string_dynamics_increase_by()
  */
 #if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
-  extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *strings) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
 
 /**
@@ -428,7 +428,7 @@ extern "C" {
  * @see f_string_prepend()
  */
 #if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
-  extern f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
 
 /**
@@ -464,7 +464,7 @@ extern "C" {
  * @see f_string_prepend_nulless()
  */
 #if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
-  extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+  extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
 #endif // !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
 
 /**
index b707135a50ec28fbe2bc103d1b5cdb9a1eb4b4a3..7aaa7a1ce6bf344249149920bf8a1463d05ac233 100644 (file)
@@ -6,13 +6,13 @@ extern "C" {
 #endif
 
 #ifndef _di_f_string_append_
-  f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_append(source, length, destination);
@@ -20,13 +20,13 @@ extern "C" {
 #endif // _di_f_string_append_
 
 #ifndef _di_f_string_append_assure_
-  f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < length) {
@@ -63,13 +63,13 @@ extern "C" {
 #endif // _di_f_string_append_assure_
 
 #ifndef _di_f_string_append_assure_nulless_
-  f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < length) {
@@ -106,13 +106,13 @@ extern "C" {
 #endif // _di_f_string_append_assure_nulless_
 
 #ifndef _di_f_string_append_nulless_
-  f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_append_nulless(source, length, destination);
@@ -120,13 +120,13 @@ extern "C" {
 #endif // _di_f_string_append_nulless_
 
 #ifndef _di_f_string_mash_
-  f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue_length && destination->used) {
@@ -139,13 +139,13 @@ extern "C" {
 #endif // _di_f_string_mash_
 
 #ifndef _di_f_string_mash_nulless_
-  f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue_length && destination->used) {
@@ -158,13 +158,13 @@ extern "C" {
 #endif // _di_f_string_mash_nulless_
 
 #ifndef _di_f_string_mish_
-  f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue_length && destination->used) {
@@ -177,13 +177,13 @@ extern "C" {
 #endif // _di_f_string_mish_
 
 #ifndef _di_f_string_mish_nulless_
-  f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue_length && destination->used) {
@@ -196,13 +196,13 @@ extern "C" {
 #endif // _di_f_string_mish_nulless_
 
 #ifndef _di_f_string_prepend_
-  f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_prepend(source, length, destination);
@@ -210,13 +210,13 @@ extern "C" {
 #endif // _di_f_string_prepend_
 
 #ifndef _di_f_string_prepend_assure_
-  f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < length) {
@@ -253,13 +253,13 @@ extern "C" {
 #endif // _di_f_string_prepend_assure_
 
 #ifndef _di_f_string_prepend_assure_nulless_
-  f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < length) {
@@ -296,13 +296,13 @@ extern "C" {
 #endif // _di_f_string_prepend_assure_nulless_
 
 #ifndef _di_f_string_prepend_nulless_
-  f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+  f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!length) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_prepend_nulless(source, length, destination);
index c71ffc7a02abf6776c8b5a2e98762acc816c9798..5bd4d0ab77b9ce402ac5c4ae3777b047d825dcc4 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -53,7 +53,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_append_
-  extern f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_append_
 
 /**
@@ -70,7 +70,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -78,7 +78,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_append_assure_
-  extern f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_append_assure_
 
 /**
@@ -96,7 +96,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -104,7 +104,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_append_assure_nulless_
-  extern f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_append_assure_nulless_
 
 /**
@@ -121,7 +121,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -129,7 +129,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_append_nulless_
-  extern f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_append_nulless_
 
 /**
@@ -150,7 +150,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -158,7 +158,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_mash_
-  extern f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_mash_
 
 /**
@@ -181,7 +181,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -189,7 +189,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_mash_nulless_
-  extern f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_mash_nulless_
 
 /**
@@ -210,7 +210,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -218,7 +218,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_mish_
-  extern f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_mish_
 
 /**
@@ -241,7 +241,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -249,7 +249,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_mish_nulless_
-  extern f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_mish_nulless_
 
 /**
@@ -266,7 +266,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -274,7 +274,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_prepend_
-  extern f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_prepend_
 
 /**
@@ -293,7 +293,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -301,7 +301,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_prepend_assure_
-  extern f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_prepend_assure_
 
 /**
@@ -321,7 +321,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -329,7 +329,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_prepend_assure_nulless_
-  extern f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_prepend_assure_nulless_
 
 /**
@@ -349,7 +349,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -357,7 +357,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_prepend_nulless_
-  extern f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+  extern f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
 #endif // _di_f_string_prepend_nulless_
 
 /**
index ee6af60c426f9b500c3d76d23772cb7f0f7781b0..ab55d237920545e91b93e84faa2dac3781ebf29d 100644 (file)
@@ -158,13 +158,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_adjust_
 
 #ifndef _di_f_string_dynamic_append_
-  f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_append(source.string, source.used, destination);
@@ -172,13 +172,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_append_
 
 #ifndef _di_f_string_dynamic_append_assure_
-  f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < source.used) {
@@ -215,13 +215,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_append_assure_
 
 #ifndef _di_f_string_dynamic_append_assure_nulless_
-  f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < source.used) {
@@ -258,13 +258,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_append_assure_nulless_
 
 #ifndef _di_f_string_dynamic_append_nulless_
-  f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_append_nulless(source.string, source.used, destination);
@@ -337,13 +337,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_increase_by_
 
 #ifndef _di_f_string_dynamic_mash_
-  f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue.used && destination->used) {
@@ -356,13 +356,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_mash_
 
 #ifndef _di_f_string_dynamic_mash_nulless_
-  f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue.used && destination->used) {
@@ -375,13 +375,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_mash_nulless_
 
 #ifndef _di_f_string_dynamic_mish_
-  f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue.used && destination->used) {
@@ -394,13 +394,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_mish_
 
 #ifndef _di_f_string_dynamic_mish_nulless_
-  f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (glue.used && destination->used) {
@@ -413,14 +413,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_mish_nulless_
 
 #ifndef _di_f_string_dynamic_partial_append_
-  f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -432,14 +432,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_append_
 
 #ifndef _di_f_string_dynamic_partial_append_assure_
-  f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -482,14 +482,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_append_assure_
 
 #ifndef _di_f_string_dynamic_partial_append_assure_nulless_
-  f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -532,14 +532,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_append_assure_nulless_
 
 #ifndef _di_f_string_dynamic_partial_append_nulless_
-  f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -551,14 +551,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_append_nulless_
 
 #ifndef _di_f_string_dynamic_partial_mash_
-  f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -575,14 +575,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_mash_
 
 #ifndef _di_f_string_dynamic_partial_mash_nulless_
-  f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -599,14 +599,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_mash_nulless_
 
 #ifndef _di_f_string_dynamic_partial_mish_
-  f_status_t f_string_partial_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_partial_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -623,14 +623,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_mish_
 
 #ifndef _di_f_string_dynamic_partial_mish_nulless_
-  f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -647,14 +647,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_mish_nulless_
 
 #ifndef _di_f_string_dynamic_partial_prepend_
-  f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -666,14 +666,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_prepend_
 
 #ifndef _di_f_string_dynamic_partial_prepend_assure_
-  f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -716,14 +716,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_prepend_assure_
 
 #ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_
-  f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -766,14 +766,14 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_prepend_assure_nulless
 
 #ifndef _di_f_string_dynamic_partial_prepend_nulless_
-  f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (source.used <= range.stop) return F_status_set_error(F_parameter);
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (range.start > range.stop) {
@@ -785,13 +785,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_partial_prepend_nulless
 
 #ifndef _di_f_string_dynamic_prepend_
-  f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     return private_f_string_prepend(source.string, source.used, destination);
@@ -799,13 +799,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_prepend_
 
 #ifndef _di_f_string_dynamic_prepend_assure_
-  f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < source.used) {
@@ -842,13 +842,13 @@ extern "C" {
 #endif // _di_f_string_dynamic_prepend_assure_
 
 #ifndef _di_f_string_dynamic_prepend_assure_nulless_
-  f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!source.used) {
-      return F_data_not_eos;
+      return F_data_not;
     }
 
     if (destination->used < source.used) {
@@ -885,12 +885,12 @@ extern "C" {
 #endif // _di_f_string_dynamic_prepend_assure_nulless_
 
 #ifndef _di_f_string_dynamic_prepend_nulless_
-  f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (!source.used) return F_data_not_eos;
+    if (!source.used) return F_data_not;
 
     return private_f_string_prepend_nulless(source.string, source.used, destination);
   }
@@ -912,7 +912,7 @@ extern "C" {
       if (!range) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (!buffer.used) return F_data_not_eos;
+    if (!buffer.used) return F_data_not;
     if (range->start > range->stop) return F_data_not_stop;
 
     while (buffer.string[range->start] != f_string_eol_s.string[0]) {
@@ -933,7 +933,7 @@ extern "C" {
       if (!range) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (!buffer.used) return F_data_not_eos;
+    if (!buffer.used) return F_data_not;
     if (range->start > range->stop) return F_data_not_stop;
 
     while (buffer.string[range->start] != seek_to_this) {
@@ -956,7 +956,7 @@ extern "C" {
       if (!range) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (!buffer.used) return F_data_not_eos;
+    if (!buffer.used) return F_data_not;
     if (range->start > range->stop) return F_data_not_stop;
 
     while (buffer.string[range->start] != seek_to_this) {
@@ -972,13 +972,12 @@ extern "C" {
 #endif // _di_f_string_dynamic_seek_to_
 
 #ifndef _di_f_string_dynamic_terminate_
-  f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_terminate(f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
-      if (destination->used > destination->size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
-    if (!destination->used && destination->size && !destination->string[destination->used - 1]) {
+    if (destination->used && !destination->string[destination->used - 1]) {
       return F_none;
     }
 
@@ -1001,10 +1000,9 @@ extern "C" {
 #endif // _di_f_string_dynamic_terminate_
 
 #ifndef _di_f_string_dynamic_terminate_after_
-  f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination) {
+  f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
-      if (destination->used > destination->size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (destination->used) {
@@ -1032,7 +1030,7 @@ extern "C" {
 #endif // _di_f_string_dynamic_terminate_after_
 
 #ifndef _di_f_string_dynamics_adjust_
-  f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!dynamics) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -1056,7 +1054,7 @@ extern "C" {
 #endif // _di_f_string_dynamics_append_
 
 #ifndef _di_f_string_dynamics_decimate_by_
-  f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!dynamics) return F_status_set_error(F_parameter);
@@ -1071,7 +1069,7 @@ extern "C" {
 #endif // _di_f_string_dynamics_decimate_by_
 
 #ifndef _di_f_string_dynamics_decrease_by_
-  f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!dynamics) return F_status_set_error(F_parameter);
@@ -1086,7 +1084,7 @@ extern "C" {
 #endif // _di_f_string_dynamics_decrease_by_
 
 #ifndef _di_f_string_dynamics_increase_
-  f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!dynamics) return F_status_set_error(F_parameter);
@@ -1111,7 +1109,7 @@ extern "C" {
 #endif // _di_f_string_dynamics_increase_
 
 #ifndef _di_f_string_dynamics_increase_by_
-  f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!dynamics) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -1129,7 +1127,7 @@ extern "C" {
 #endif // _di_f_string_dynamics_increase_by_
 
 #ifndef _di_f_string_dynamics_resize_
-  f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+  f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
     #ifndef _di_level_0_parameter_checking_
       if (!dynamics) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index 1f9c4ab3a8491e8a3b8a3e62deb55d9a8264f666..48c61757dd4b3c708b6c89ee3968dabcee93b3ee 100644 (file)
@@ -627,7 +627,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -635,7 +635,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_append_
-  extern f_status_t f_string_dynamic_append(const f_string_dynamic_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_append(const f_string_dynamic_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_append_
 
 /**
@@ -648,7 +648,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -656,7 +656,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_append_assure_
-  extern f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_append_assure_
 
 /**
@@ -671,7 +671,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -679,7 +679,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_append_assure_nulless_
-  extern f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_append_assure_nulless_
 
 /**
@@ -694,7 +694,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -702,7 +702,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_append_nulless_
-  extern f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_append_nulless_
 
 /**
@@ -794,7 +794,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -802,7 +802,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_mash_
-  extern f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_mash_
 
 /**
@@ -821,7 +821,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -829,7 +829,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_mash_nulless_
-  extern f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_mash_nulless_
 
 /**
@@ -846,7 +846,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -854,7 +854,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_mish_
-  extern f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_mish_
 
 /**
@@ -873,7 +873,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_string_too_large (with error bit) if the combined string is too large.
@@ -881,7 +881,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_mish_nulless_
-  extern f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_mish_nulless_
 
 /**
@@ -896,7 +896,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -905,7 +905,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_append_
-  extern f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_append_
 
 /**
@@ -922,7 +922,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -931,7 +931,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_append_assure_
-  extern f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_append_assure_
 
 /**
@@ -950,7 +950,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -959,7 +959,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_append_assure_nulless_
-  extern f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_append_assure_nulless_
 
 /**
@@ -976,7 +976,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -985,7 +985,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_append_nulless_
-  extern f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_append_nulless_
 
 /**
@@ -1004,7 +1004,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1013,7 +1013,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_mash_
-  extern f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_mash_
 
 /**
@@ -1034,7 +1034,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1043,7 +1043,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_mash_nulless_
-  extern f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_mash_nulless_
 
 /**
@@ -1062,7 +1062,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1071,7 +1071,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_mish_
-  extern f_status_t f_string_dynamic_partial_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_mish_
 
 /**
@@ -1092,7 +1092,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1101,7 +1101,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_mish_nulless_
-  extern f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_mish_nulless_
 
 /**
@@ -1118,7 +1118,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1127,7 +1127,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_prepend_
-  extern f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_prepend_
 
 /**
@@ -1146,7 +1146,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1155,7 +1155,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_prepend_assure_
-  extern f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_prepend_assure_
 
 /**
@@ -1174,7 +1174,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1183,7 +1183,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_
-  extern f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_prepend_assure_nulless_
 
 /**
@@ -1200,7 +1200,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1209,7 +1209,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_partial_prepend_nulless_
-  extern f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_partial_prepend_nulless_
 
 /**
@@ -1224,7 +1224,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1233,7 +1233,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_prepend_
-  extern f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_prepend_
 
 /**
@@ -1250,7 +1250,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1259,7 +1259,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_prepend_assure_
-  extern f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_prepend_assure_
 
 /**
@@ -1276,7 +1276,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1285,7 +1285,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_prepend_assure_nulless_
-  extern f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_prepend_assure_nulless_
 
 /**
@@ -1300,7 +1300,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
- *   F_data_not_eos if source length is 0.
+ *   F_data_not if source length is 0.
  *   F_data_not_stop if range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1309,7 +1309,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_prepend_nulless_
-  extern f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_prepend_nulless_
 
 /**
@@ -1344,7 +1344,7 @@ extern "C" {
  *   F_none on success.
  *   F_none_eos on success, but stopped at end of string.
  *   F_none_stop on success, but stopped at end of range.
- *   F_data_not_eos on success, but there was no string data to seek.
+ *   F_data_not on success, but there was no string data to seek.
  *   F_data_not_stop on success, but the range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1370,7 +1370,7 @@ extern "C" {
  *   F_none on success.
  *   F_none_eos on success, but stopped at end of string.
  *   F_none_stop on success, but stopped at end of range.
- *   F_data_not_eos on success, but there was no string data to seek.
+ *   F_data_not on success, but there was no string data to seek.
  *   F_data_not_stop on success, but the range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1396,7 +1396,7 @@ extern "C" {
  *   F_none on success.
  *   F_none_eos on success, but stopped at end of string.
  *   F_none_stop on success, but stopped at end of range.
- *   F_data_not_eos on success, but there was no string data to seek.
+ *   F_data_not on success, but there was no string data to seek.
  *   F_data_not_stop on success, but the range.start > range.stop.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
@@ -1427,7 +1427,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_terminate_
-  extern f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_terminate(f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_terminate_
 
 /**
@@ -1452,7 +1452,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamic_terminate_after_
-  extern f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination);
+  extern f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t * const destination);
 #endif // _di_f_string_dynamic_terminate_after_
 
 /**
@@ -1471,7 +1471,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_adjust().
  */
 #ifndef _di_f_string_dynamics_adjust_
-  extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_adjust_
 
 /**
@@ -1516,7 +1516,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamics_decimate_by_
-  extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_decimate_by_
 
 /**
@@ -1540,7 +1540,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamics_decrease_by_
-  extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_decrease_by_
 
 /**
@@ -1565,7 +1565,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamics_increase_
-  extern f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_increase_
 
 /**
@@ -1590,7 +1590,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamics_increase_by_
-  extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_increase_by_
 
 /**
@@ -1609,7 +1609,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_dynamics_resize_
-  extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics);
+  extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics);
 #endif // _di_f_string_dynamics_resize_
 
 #ifdef __cplusplus
index b9541de7fd97fe18a5006da8ef74da73daf73178..ce80853d47df9485312bae236714f1237edc4b96 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #ifndef _di_f_string_map_multis_adjust_
-  f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!map_multis) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -16,7 +16,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_adjust_
 
 #ifndef _di_f_string_map_multis_append_
-  f_status_t f_string_map_multis_append(const f_string_map_multis_t source, f_string_map_multis_t *destination) {
+  f_status_t f_string_map_multis_append(const f_string_map_multis_t source, f_string_map_multis_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -49,7 +49,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_append_
 
 #ifndef _di_f_string_map_multis_decimate_by_
-  f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!map_multis) return F_status_set_error(F_parameter);
@@ -64,7 +64,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_decimate_by_
 
 #ifndef _di_f_string_map_multis_decrease_by_
-  f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!map_multis) return F_status_set_error(F_parameter);
@@ -79,7 +79,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_decrease_by_
 
 #ifndef _di_f_string_map_multis_increase_
-  f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!map_multis) return F_status_set_error(F_parameter);
@@ -104,7 +104,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_increase_
 
 #ifndef _di_f_string_map_multis_increase_by_
-  f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!map_multis) return F_status_set_error(F_parameter);
@@ -123,7 +123,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_increase_by_
 
 #ifndef _di_f_string_map_multis_resize_
-  f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t *map_multis) {
+  f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis) {
     #ifndef _di_level_0_parameter_checking_
       if (!map_multis) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -133,7 +133,7 @@ extern "C" {
 #endif // _di_f_string_map_multis_resize_
 
 #ifndef _di_f_string_maps_adjust_
-  f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps) {
+  f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!maps) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -143,7 +143,7 @@ extern "C" {
 #endif // _di_f_string_maps_adjust_
 
 #ifndef _di_f_string_maps_append_
-  f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t *destination) {
+  f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -178,7 +178,7 @@ extern "C" {
 #endif // _di_f_string_maps_append_
 
 #ifndef _di_f_string_maps_decimate_by_
-  f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps) {
+  f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!maps) return F_status_set_error(F_parameter);
@@ -193,7 +193,7 @@ extern "C" {
 #endif // _di_f_string_maps_decimate_by_
 
 #ifndef _di_f_string_maps_decrease_by_
-  f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps) {
+  f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!maps) return F_status_set_error(F_parameter);
@@ -208,7 +208,7 @@ extern "C" {
 #endif // _di_f_string_maps_decrease_by_
 
 #ifndef _di_f_string_maps_increase_
-  f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t *maps) {
+  f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!maps) return F_status_set_error(F_parameter);
@@ -233,7 +233,7 @@ extern "C" {
 #endif // _di_f_string_maps_increase_
 
 #ifndef _di_f_string_maps_increase_by_
-  f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps) {
+  f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!maps) return F_status_set_error(F_parameter);
@@ -252,7 +252,7 @@ extern "C" {
 #endif // _di_f_string_maps_increase_by_
 
 #ifndef _di_f_string_maps_resize_
-  f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t *maps) {
+  f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps) {
     #ifndef _di_level_0_parameter_checking_
       if (!maps) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index 08ee70342455d1cc723a2c27dd1152852c0d892a..e3bbd469f8696823c269176df2a0b6bd4091cfd2 100644 (file)
@@ -148,7 +148,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_adjust_
-  extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_adjust_
 
 /**
@@ -192,7 +192,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_decimate_by_
-  extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_decimate_by_
 
 /**
@@ -215,7 +215,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_decrease_by_
-  extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_decrease_by_
 
 /**
@@ -240,7 +240,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_increase_
-  extern f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_increase_
 
 /**
@@ -265,7 +265,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_increase_by_
-  extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_increase_by_
 
 /**
@@ -284,7 +284,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_map_multis_resize_
-  extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t *map_multis);
+  extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis);
 #endif // _di_f_string_map_multis_resize_
 
 /**
@@ -303,7 +303,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_adjust_
-  extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_adjust_
 
 /**
@@ -324,7 +324,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_append_
-  extern f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t *destination);
+  extern f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t * const destination);
 #endif // _di_f_string_maps_append_
 
 /**
@@ -347,7 +347,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_decimate_by_
-  extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_decimate_by_
 
 /**
@@ -370,7 +370,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_decrease_by_
-  extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_decrease_by_
 
 /**
@@ -395,7 +395,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_increase_
-  extern f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_increase_
 
 /**
@@ -420,7 +420,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_increase_by_
-  extern f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_increase_by_
 
 /**
@@ -439,7 +439,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_maps_resize_
-  extern f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t *maps);
+  extern f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps);
 #endif // _di_f_string_maps_resize_
 
 #ifdef __cplusplus
index c39d998a2417fbf8b13957a24ce444528bb0110a..00d33813dd0b211a939dd165680ddb4e967a4938 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #ifndef _di_f_string_quantitys_adjust_
-  f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!quantitys) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -43,7 +43,7 @@ extern "C" {
 #endif // _di_f_string_quantitys_append_
 
 #ifndef _di_f_string_quantitys_decimate_by_
-  f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantitys) return F_status_set_error(F_parameter);
@@ -58,7 +58,7 @@ extern "C" {
 #endif // _di_f_string_quantitys_decimate_by_
 
 #ifndef _di_f_string_quantitys_decrease_by_
-  f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantitys) return F_status_set_error(F_parameter);
@@ -73,7 +73,7 @@ extern "C" {
 #endif // _di_f_string_quantitys_decrease_by_
 
 #ifndef _di_f_string_quantitys_increase_
-  f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!quantitys) return F_status_set_error(F_parameter);
@@ -98,7 +98,7 @@ extern "C" {
 #endif // _di_f_string_quantitys_increase_
 
 #ifndef _di_f_string_quantitys_increase_by_
-  f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantitys) return F_status_set_error(F_parameter);
@@ -117,7 +117,7 @@ extern "C" {
 #endif // _di_f_string_quantitys_increase_by_
 
 #ifndef _di_f_string_quantitys_resize_
-  f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t *quantitys) {
+  f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
     #ifndef _di_level_0_parameter_checking_
       if (!quantitys) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -137,7 +137,7 @@ extern "C" {
 #endif // _di_f_string_quantityss_adjust_
 
 #ifndef _di_f_string_quantityss_decimate_by_
-  f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+  f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantityss) return F_status_set_error(F_parameter);
@@ -152,7 +152,7 @@ extern "C" {
 #endif // _di_f_string_quantityss_decimate_by_
 
 #ifndef _di_f_string_quantityss_decrease_by_
-  f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+  f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantityss) return F_status_set_error(F_parameter);
@@ -167,7 +167,7 @@ extern "C" {
 #endif // _di_f_string_quantityss_decrease_by_
 
 #ifndef _di_f_string_quantityss_increase_
-  f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t *quantityss) {
+  f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t * const quantityss) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!quantityss) return F_status_set_error(F_parameter);
@@ -192,7 +192,7 @@ extern "C" {
 #endif // _di_f_string_quantityss_increase_
 
 #ifndef _di_f_string_quantityss_increase_by_
-  f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+  f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!quantityss) return F_status_set_error(F_parameter);
@@ -211,7 +211,7 @@ extern "C" {
 #endif // _di_f_string_quantityss_increase_by_
 
 #ifndef _di_f_string_quantityss_resize_
-  f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t *quantityss) {
+  f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
     #ifndef _di_level_0_parameter_checking_
       if (!quantityss) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index 0516e1f1259c059f3e2dd32f5cf4840dd5aa6387..19bce66d3ea84b17f3ed8a3035fa63303ef74e83 100644 (file)
@@ -115,7 +115,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_adjust_
-  extern f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_adjust_
 
 /**
@@ -135,7 +135,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_append_
-  extern f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t *destination);
+  extern f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t * const destination);
 #endif // _di_f_string_quantitys_append_
 
 /**
@@ -158,7 +158,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_decimate_by_
-  extern f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_decimate_by_
 
 /**
@@ -181,7 +181,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_decrease_by_
-  extern f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_decrease_by_
 
 /**
@@ -205,7 +205,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_increase_
-  extern f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_increase_
 
 /**
@@ -229,7 +229,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_increase_by_
-  extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_increase_by_
 
 /**
@@ -248,7 +248,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantitys_resize_
-  extern f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t *quantitys);
+  extern f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys);
 #endif // _di_f_string_quantitys_resize_
 
 /**
@@ -267,7 +267,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_adjust_
-  extern f_status_t f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_adjust_
 
 /**
@@ -290,7 +290,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_decimate_by_
-  extern f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_decimate_by_
 
 /**
@@ -313,7 +313,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_decrease_by_
-  extern f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_decrease_by_
 
 /**
@@ -338,7 +338,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_increase_
-  extern f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_increase_
 
 /**
@@ -363,7 +363,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_increase_by_
-  extern f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_increase_by_
 
 /**
@@ -382,7 +382,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_quantityss_resize_
-  extern f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t *quantityss);
+  extern f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss);
 #endif // _di_f_string_quantityss_resize_
 
 #ifdef __cplusplus
index 11d94f7d05c1449f023ecb634c2855a31519ebfb..7aaa09e2dc1156a4babb109fb4740de5da75ab29 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #ifndef _di_f_string_ranges_adjust_
-  f_status_t f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!ranges) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -16,7 +16,7 @@ extern "C" {
 #endif // _di_f_string_ranges_adjust_
 
 #ifndef _di_f_string_ranges_append_
-  f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t *destination) {
+  f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -43,7 +43,7 @@ extern "C" {
 #endif // _di_f_string_ranges_append_
 
 #ifndef _di_f_string_ranges_decimate_by_
-  f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!ranges) return F_status_set_error(F_parameter);
@@ -58,7 +58,7 @@ extern "C" {
 #endif // _di_f_string_ranges_decimate_by_
 
 #ifndef _di_f_string_ranges_decrease_by_
-  f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!ranges) return F_status_set_error(F_parameter);
@@ -73,7 +73,7 @@ extern "C" {
 #endif // _di_f_string_ranges_decrease_by_
 
 #ifndef _di_f_string_ranges_increase_
-  f_status_t f_string_ranges_increase(const uint16_t step, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_increase(const uint16_t step, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!ranges) return F_status_set_error(F_parameter);
@@ -98,7 +98,7 @@ extern "C" {
 #endif // _di_f_string_ranges_increase_
 
 #ifndef _di_f_string_ranges_increase_by_
-  f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!ranges) return F_status_set_error(F_parameter);
@@ -117,7 +117,7 @@ extern "C" {
 #endif // _di_f_string_ranges_increase_by_
 
 #ifndef _di_f_string_ranges_resize_
-  f_status_t f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t *ranges) {
+  f_status_t f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) {
     #ifndef _di_level_0_parameter_checking_
       if (!ranges) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -127,7 +127,7 @@ extern "C" {
 #endif // _di_f_string_ranges_resize_
 
 #ifndef _di_f_string_rangess_adjust_
-  f_status_t f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!rangess) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -137,7 +137,7 @@ extern "C" {
 #endif // _di_f_string_rangess_adjust_
 
 #ifndef _di_f_string_rangess_decimate_by_
-  f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!rangess) return F_status_set_error(F_parameter);
@@ -152,7 +152,7 @@ extern "C" {
 #endif // _di_f_string_rangess_decimate_by_
 
 #ifndef _di_f_string_rangess_decrease_by_
-  f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!rangess) return F_status_set_error(F_parameter);
@@ -167,7 +167,7 @@ extern "C" {
 #endif // _di_f_string_rangess_decrease_by_
 
 #ifndef _di_f_string_rangess_increase_
-  f_status_t f_string_rangess_increase(const uint16_t step, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_increase(const uint16_t step, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!rangess) return F_status_set_error(F_parameter);
@@ -192,7 +192,7 @@ extern "C" {
 #endif // _di_f_string_rangess_increase_
 
 #ifndef _di_f_string_rangess_increase_by_
-  f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!rangess) return F_status_set_error(F_parameter);
@@ -211,7 +211,7 @@ extern "C" {
 #endif // _di_f_string_rangess_increase_by_
 
 #ifndef _di_f_string_rangess_resize_
-  f_status_t f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t *rangess) {
+  f_status_t f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) {
     #ifndef _di_level_0_parameter_checking_
       if (!rangess) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index cc540dacf6a009029018528c1b77bfe188b3fc6d..cbde60c427608e911438794ac2b5cb19bb7410f3 100644 (file)
@@ -6,7 +6,7 @@ extern "C" {
 #endif
 
 #ifndef _di_f_string_triples_adjust_
-  f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t *triples) {
+  f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!triples) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -16,7 +16,7 @@ extern "C" {
 #endif // _di_f_string_triples_adjust_
 
 #ifndef _di_f_string_triples_append_
-  f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t *destination) {
+  f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
@@ -59,7 +59,7 @@ extern "C" {
 #endif // _di_f_string_triples_append_
 
 #ifndef _di_f_string_triples_decimate_by_
-  f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples) {
+  f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!triples) return F_status_set_error(F_parameter);
@@ -74,7 +74,7 @@ extern "C" {
 #endif // _di_f_string_triples_decimate_by_
 
 #ifndef _di_f_string_triples_decrease_by_
-  f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples) {
+  f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!triples) return F_status_set_error(F_parameter);
@@ -89,7 +89,7 @@ extern "C" {
 #endif // _di_f_string_triples_decrease_by_
 
 #ifndef _di_f_string_triples_increase_
-  f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t *triples) {
+  f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!step) return F_status_set_error(F_parameter);
       if (!triples) return F_status_set_error(F_parameter);
@@ -114,7 +114,7 @@ extern "C" {
 #endif // _di_f_string_triples_increase_
 
 #ifndef _di_f_string_triples_increase_by_
-  f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples) {
+  f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!amount) return F_status_set_error(F_parameter);
       if (!triples) return F_status_set_error(F_parameter);
@@ -133,7 +133,7 @@ extern "C" {
 #endif // _di_f_string_triples_increase_by_
 
 #ifndef _di_f_string_triples_resize_
-  f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t *triples) {
+  f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples) {
     #ifndef _di_level_0_parameter_checking_
       if (!triples) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
index 24f63cda8070ec8118c950913fbb6e28c0daf9d8..27a0d71b9663c76b5e1a309728687c18eba815f7 100644 (file)
@@ -100,7 +100,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  */
 #ifndef _di_f_string_triples_adjust_
-  extern f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_adjust_
 
 /**
@@ -121,7 +121,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_append_
-  extern f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t *destination);
+  extern f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination);
 #endif // _di_f_string_triples_append_
 
 /**
@@ -144,7 +144,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_decimate_by_
-  extern f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_decimate_by_
 
 /**
@@ -167,7 +167,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_decrease_by_
-  extern f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_decrease_by_
 
 /**
@@ -192,7 +192,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_increase_
-  extern f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_increase_
 
 /**
@@ -217,7 +217,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_increase_by_
-  extern f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_increase_by_
 
 /**
@@ -236,7 +236,7 @@ extern "C" {
  *   Errors (with error bit) from: f_memory_resize().
  */
 #ifndef _di_f_string_triples_resize_
-  extern f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t *triples);
+  extern f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples);
 #endif // _di_f_string_triples_resize_
 
 #ifdef __cplusplus
index c38016a6774fd246b55081408cff30add99f13dd..c2880189fdf53c2a12a1b72dd50f97d68252068c 100644 (file)
@@ -829,7 +829,6 @@ extern "C" {
   f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
-      if (destination->used > destination->size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (!destination->used && destination->size && !destination->string[destination->used - 1]) {
@@ -858,7 +857,6 @@ extern "C" {
   f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination) {
     #ifndef _di_level_0_parameter_checking_
       if (!destination) return F_status_set_error(F_parameter);
-      if (destination->used > destination->size) return F_status_set_error(F_parameter);
     #endif // _di_level_0_parameter_checking_
 
     if (destination->used) {
index fccd562cbed9deefc6c5a2139f58578404644286..10d960854ec371356ae1401e0f61859f637ee6fd 100644 (file)
@@ -123,16 +123,19 @@ extern "C" {
         paths->array[paths->used].used = 0;
 
         if (total) {
-          char buffer[total];
+          char buffer[total + 1];
 
-          for (j = 0, k = 0; j < total; ++j) {
+          for (j = first, k = 0; j < i; ++j) {
 
-            if (!path.string[first + j]) continue;
+            if (!path.string[j]) continue;
 
-            buffer[k++] = path.string[first + j];
+            buffer[k++] = path.string[j];
           } // for
 
-          buffer[k++] = f_path_separator_s.string[0];
+          // Guarantee a trailing directory separator.
+          if (buffer[k - 1] != f_path_separator_s.string[0]) {
+            buffer[k++] = f_path_separator_s.string[0];
+          }
 
           status = f_string_dynamic_increase_by(k, &paths->array[paths->used]);
           if (F_status_is_error(status)) return status;
@@ -207,7 +210,10 @@ extern "C" {
             buffer[k++] = path.string[r + j + 1];
           } // for
 
-          buffer[k++] = f_path_separator_s.string[0];
+          // Guarantee a trailing directory separator.
+          if (buffer[k - 1] != f_path_separator_s.string[0]) {
+            buffer[k++] = f_path_separator_s.string[0];
+          }
 
           status = f_string_dynamic_increase_by(k, &paths->array[paths->used]);
           if (F_status_is_error(status)) return status;
index 77b573cdf4b9c1321f7b176cdb6ce5017e72e2d8..efb7cee7d54890c8df11fb5e5179713f36318aed 100644 (file)
@@ -27,7 +27,10 @@ extern "C" {
       if (!arguments) return F_status_set_error(F_parameter);
     #endif // _di_level_2_parameter_checking_
 
-    const f_status_t status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments);
+    f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments);
+    if (F_status_is_error(status)) return status;
+
+    status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments);
     if (F_status_is_error(status)) return status;
 
     return F_none;
@@ -40,12 +43,11 @@ extern "C" {
       if (!arguments) return F_status_set_error(F_parameter);
     #endif // _di_level_2_parameter_checking_
 
-    f_status_t status = F_none;
+    f_status_t status = f_string_dynamics_increase_by(size, arguments);
 
-    for (f_array_length_t i = 0; i < size; ++i) {
+    for (f_array_length_t i = 0; F_status_is_error_not(status) && i < size; ++i) {
 
       status = private_fll_execute_arguments_add_parameter(prefix[i], name[i], value[i], arguments);
-      if (F_status_is_error(status)) return status;
     } // for
 
     return status;
index 058593e85f030498d9a5824e97f744f0ceceda21..fa0f1bdd1d9e6173ae6a6dd4e63f95734fe6f02f 100644 (file)
@@ -92,7 +92,7 @@ extern "C" {
  *
  * The arguments are only appended if the length of name and value are not 0.
  *
- * This guarantees that an end of string exists at the end of each argument.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
  * This does not check for NULL characters anywhere else in the string.
  *
  * @param prefix
@@ -109,12 +109,12 @@ extern "C" {
  *
  *   Errors (with error bit) from: f_string_append().
  *   Errors (with error bit) from: f_string_dynamic_resize().
- *   Errors (with error bit) from: f_string_dynamic_terminate().
+ *   Errors (with error bit) from: f_string_dynamic_terminate_after().
  *   Errors (with error bit) from: f_string_dynamics_increase().
  *
  * @see f_string_append()
  * @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
  * @see f_string_dynamics_increase()
  */
 #ifndef _di_fll_execute_arguments_add_parameter_
@@ -130,11 +130,9 @@ extern "C" {
  *
  * The arguments are only appended if the length of name and value are not 0.
  *
- * This guarantees that an end of string exists at the end of each argument.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
  * This does not check for NULL characters anywhere else in the string.
  *
- * @todo functions like this should be changed to accept arrays of f_string_static, reducing the number of parameters passed to it.
- *
  * @param prefix
  *   An array of the strings prepend to the name.
  * @param name
@@ -151,12 +149,12 @@ extern "C" {
  *
  *   Errors (with error bit) from: f_string_append().
  *   Errors (with error bit) from: f_string_dynamic_resize().
- *   Errors (with error bit) from: f_string_dynamic_terminate().
+ *   Errors (with error bit) from: f_string_dynamic_terminate_after().
  *   Errors (with error bit) from: f_string_dynamics_increase().
  *
  * @see f_string_append()
  * @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
  * @see f_string_dynamics_increase()
  */
 #ifndef _di_fll_execute_arguments_add_parameter_set_
@@ -166,7 +164,7 @@ extern "C" {
 /**
  * Add a set of arguments to the execution arguments array.
  *
- * This guarantees that an end of string exists at the end of the copied string.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
  * This does not check for NULL characters anywhere else in the string.
  *
  * @param source
@@ -181,12 +179,12 @@ extern "C" {
  *
  *   Errors (with error bit) from: f_string_append().
  *   Errors (with error bit) from: f_string_dynamic_resize().
- *   Errors (with error bit) from: f_string_dynamic_terminate().
+ *   Errors (with error bit) from: f_string_dynamic_terminate_after().
  *   Errors (with error bit) from: f_string_dynamics_increase().
  *
  * @see f_string_append()
  * @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
  * @see f_string_dynamics_increase()
  */
 #ifndef _di_fll_execute_arguments_add_set_
index fb195aa590b3b6f3571bf2cace5c2829d24970cf..16b8bc9c37cdf7de60456c436c22123c80e25ba3 100644 (file)
@@ -28,20 +28,15 @@ extern "C" {
 #if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_)
   f_status_t private_fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) {
 
-    f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments);
-    if (F_status_is_error(status)) return status;
-
     arguments->array[arguments->used].used = 0;
 
-    status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]);
+    f_status_t status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]);
     if (F_status_is_error(status)) return status;
 
     status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]);
+    if (F_status_is_error(status)) return status;
 
-    if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_terminate(&arguments->array[arguments->used]);
-    }
-
+    status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
     if (F_status_is_error(status)) return status;
 
     ++arguments->used;
@@ -55,11 +50,9 @@ extern "C" {
     if (F_status_is_error(status)) return status;
 
     status = f_string_dynamic_append(value, &arguments->array[arguments->used]);
+    if (F_status_is_error(status)) return status;
 
-    if (F_status_is_error_not(status)) {
-      status = f_string_dynamic_terminate(&arguments->array[arguments->used]);
-    }
-
+    status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
     if (F_status_is_error(status)) return status;
 
     ++arguments->used;
index 59f66995c681f124530233f83df0f96bf40bc3d6..2e25848054b4915e81f1371b52f1e3cd86e39053 100644 (file)
@@ -61,12 +61,12 @@ extern "C" {
  *
  *   Errors (with error bit) from: f_string_append().
  *   Errors (with error bit) from: f_string_dynamic_resize().
- *   Errors (with error bit) from: f_string_dynamic_terminate().
+ *   Errors (with error bit) from: f_string_dynamic_terminate_after().
  *   Errors (with error bit) from: f_string_dynamics_increase().
  *
  * @see f_string_append()
  * @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
  * @see f_string_dynamics_increase()
  * @see fll_execute_arguments_add_parameter()
  * @see fll_execute_arguments_add_parameter_set()
index ca3bea4d7aef25915726749cc31c8639cfac93e6..522f7253ce4790e3ce8302323f6a6806eb4fdc84 100644 (file)
@@ -122,7 +122,7 @@ extern "C" {
   #define byte_dump_signal_check_d 10000
 
   #define BYTE_DUMP_character_wall_s        "|"
-  #define BYTE_DUMP_character_placeholder_s "␣" // other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
+  #define BYTE_DUMP_character_placeholder_s "␣" // Other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
   #define BYTE_DUMP_character_incomplete_s  "�"
   #define BYTE_DUMP_character_unused_s      "�"
 
index ca70efca8f989697203da8949631907c2bb54f80..18ee146930c6c4c936204e77a87515018e6fbacc 100644 (file)
@@ -85,7 +85,7 @@ extern "C" {
 
       controller_lock_print(print->to, (controller_thread_t *) process->main_thread);
 
-      fl_print_format("%r%[%SThe %s '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_script_s : controller_program_s, print->context);
+      fl_print_format("%r%[%QThe %r '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_script_s : controller_program_s, print->context);
       fl_print_format("%[%Q%]", print->to.stream, print->notable, name, print->notable);
 
       if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) {
@@ -110,7 +110,7 @@ extern "C" {
         const uint8_t code = WIFEXITED(process->result) ? WEXITSTATUS(process->result) : 0;
 
         if (code == F_execute_access) {
-          fl_print_format("%[' access denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
+          fl_print_format("%[' cannot be executed, access is denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
         }
         else if (code == F_execute_bad) {
           fl_print_format("%[' cannot execute, unsupported format.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
index 97cfd260dfb6eb1c4eecfd2ac02c034b8a87e333..5c1e06d963c9636c32225edfca95c456644ad8ea 100644 (file)
@@ -28,18 +28,18 @@ extern "C" {
   #ifndef FAKE_program_version_nano_prefix_s
     #define FAKE_program_version_nano_prefix_s
     #define FAKE_program_version_nano_prefix_s_length 0
-  #endif
+  #endif // FAKE_program_version_major_s_length F_string_ascii_0_s_length
 
   #ifndef FAKE_program_version_nano_s
     #define FAKE_program_version_nano_s
     #define FAKE_program_version_nano_s_length 0
-  #endif
+  #endif // FAKE_program_version_nano_s
 
   #define FAKE_program_version_s FAKE_program_version_major_s F_string_ascii_period_s FAKE_program_version_minor_s F_string_ascii_period_s FAKE_program_version_micro_s FAKE_program_version_nano_prefix_s FAKE_program_version_nano_s
 
   #define FAKE_program_version_s_length FAKE_program_version_major_s_length + F_string_ascii_period_s_length + FAKE_program_version_minor_s_length + F_string_ascii_period_s_length + FAKE_program_version_micro_s_length + FAKE_program_version_nano_prefix_s_length + FAKE_program_version_nano_s_length
 
-  const f_string_static_t fake_program_version_s;
+  extern const f_string_static_t fake_program_version_s;
 #endif // _di_fake_program_version_
 
 #ifndef _di_fake_program_name_
@@ -49,8 +49,8 @@ extern "C" {
   #define FAKE_program_name_s_length      4
   #define FAKE_program_name_long_s_length 16
 
-  const f_string_static_t fake_program_name_s;
-  const f_string_static_t fake_program_name_long_s;
+  extern const f_string_static_t fake_program_name_s;
+  extern const f_string_static_t fake_program_name_long_s;
 #endif // _di_fake_program_name_
 
 #ifndef _di_fake_program_help_parameters_
index 812bbe14343cf96e996e81b70118d606d122f3a7..57064a21e8f99332d4e54dd83861e6c8e4fab108 100644 (file)
@@ -164,7 +164,6 @@ extern "C" {
       }
     }
 
-    f_string_static_t * const argv = main->parameters.arguments.array;
     status = F_none;
 
     f_array_length_t operations_length = main->parameters.array[fake_parameter_operation_build_e].locations.used;
@@ -305,9 +304,7 @@ extern "C" {
           }
 
           if (F_status_is_error_not(status)) {
-            f_string_static_t stub = f_string_static_t_initialize;
-
-            status = fake_build_operate(stub, main);
+            status = fake_build_operate(f_string_empty_s, main);
           }
         }
         else if (main->operation == fake_operation_clean_e) {
index 7d785a8e8d6fbc4a2625373b61cfef2127f96841..f2c65b30e7a2b6d69361dd1fceed2bb1e4b78734 100644 (file)
@@ -66,10 +66,10 @@ extern "C" {
 
           char source_string[source.used + 1];
           source.string = source_string;
+          source_string[source.used] = 0;
 
           memcpy(source_string, path_sources->string, path_sources->used);
           memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
-          source_string[source.used] = 0;
 
           *status = fll_execute_arguments_add(source, &arguments);
           if (F_status_is_error(*status)) break;
@@ -93,11 +93,29 @@ extern "C" {
     f_string_static_t parameter_file_name_micro = f_string_static_t_initialize;
     f_string_static_t parameter_file_name_nano = f_string_static_t_initialize;
 
+    f_array_length_t strings_length = 1;
+
     parameter_file_name.used = fake_build_parameter_library_name_prefix_s.used + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_s.used;
-    parameter_file_name_major.used = data_build.setting.version_major.used ? parameter_file_name.used + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used : 0;
-    parameter_file_name_minor.used = data_build.setting.version_minor.used ? parameter_file_name_major.used + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used : 0;
-    parameter_file_name_micro.used = data_build.setting.version_micro.used ? parameter_file_name_micro.used + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used : 0;
-    parameter_file_name_nano.used = data_build.setting.version_nano.used ? parameter_file_name_nano.used + data_build.setting.version_nano_prefix.used + data_build.setting.version_nano.used : 0;
+
+    if (data_build.setting.version_major.used) {
+      parameter_file_name_major.used = parameter_file_name.used + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used;
+      strings_length = 2;
+
+      if (data_build.setting.version_minor.used) {
+        parameter_file_name_minor.used = parameter_file_name_major.used + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used;
+        strings_length = 3;
+
+        if (data_build.setting.version_micro.used) {
+          parameter_file_name_micro.used = parameter_file_name_minor.used + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used;
+          strings_length = 4;
+
+          if (data_build.setting.version_nano.used) {
+            parameter_file_name_nano.used =  parameter_file_name_micro.used + data_build.setting.version_nano_prefix.used + data_build.setting.version_nano.used;
+            strings_length = 5;
+          }
+        }
+      }
+    }
 
     char parameter_file_name_string[parameter_file_name.used + 1];
     char parameter_file_name_major_string[parameter_file_name_major.used + 1];
@@ -105,169 +123,120 @@ extern "C" {
     char parameter_file_name_micro_string[parameter_file_name_micro.used + 1];
     char parameter_file_name_nano_string[parameter_file_name_nano.used + 1];
 
+    parameter_file_name.string = parameter_file_name_string;
+    parameter_file_name_major.string = parameter_file_name_major_string;
+    parameter_file_name_minor.string = parameter_file_name_minor_string;
+    parameter_file_name_micro.string = parameter_file_name_micro_string;
+    parameter_file_name_nano.string = parameter_file_name_nano_string;
+
     parameter_file_name_string[parameter_file_name.used] = 0;
     parameter_file_name_major_string[parameter_file_name_major.used] = 0;
     parameter_file_name_minor_string[parameter_file_name_minor.used] = 0;
     parameter_file_name_micro_string[parameter_file_name_micro.used] = 0;
     parameter_file_name_nano_string[parameter_file_name_nano.used] = 0;
 
-    memcpy(parameter_file_name_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
-    if (parameter_file_name_major.used) {
-      memcpy(parameter_file_name_major_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
-      if (parameter_file_name_minor.used) {
-        memcpy(parameter_file_name_minor_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
-        if (parameter_file_name_micro.used) {
-          memcpy(parameter_file_name_micro_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-          }
-        }
-      }
-    }
-
-    f_array_length_t count = fake_build_parameter_library_name_prefix_s.used;
-
-    memcpy(parameter_file_name_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+    f_string_t strings[5] = {
+      parameter_file_name_string,
+      parameter_file_name_major_string,
+      parameter_file_name_minor_string,
+      parameter_file_name_micro_string,
+      parameter_file_name_nano_string,
+    };
 
-    if (parameter_file_name_major.used) {
-      memcpy(parameter_file_name_major_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+    {
+      f_array_length_t offset = 0;
 
-      if (parameter_file_name_minor.used) {
-        memcpy(parameter_file_name_minor_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+      uint8_t i = 0;
 
-        if (parameter_file_name_micro.used) {
-          memcpy(parameter_file_name_micro_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+      for (; i < strings_length; ++i) {
+        memcpy(strings[i], fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
+      } // for
 
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
-          }
-        }
-      }
-    }
+      offset = fake_build_parameter_library_name_prefix_s.used;
 
-    count += data_build.setting.project_name.used;
+      for (i = 0; i < strings_length; ++i) {
+        memcpy(strings[i] + offset, data_build.setting.project_name.string, data_build.setting.project_name.used);
+      } // for
 
-    memcpy(parameter_file_name_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+      offset += data_build.setting.project_name.used;
 
-    if (parameter_file_name_major.used) {
-      memcpy(parameter_file_name_major_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+      for (i = 0; i < strings_length; ++i) {
+        memcpy(strings[i] + offset, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+      } // for
 
-      if (parameter_file_name_minor.used) {
-        memcpy(parameter_file_name_minor_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+      offset += fake_build_parameter_library_name_suffix_shared_s.used;
 
-        if (parameter_file_name_micro.used) {
-          memcpy(parameter_file_name_micro_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+      if (parameter_file_name_major.used) {
+        if (data_build.setting.version_major_prefix.used) {
+          for (i = 1; i < strings_length; ++i) {
+            memcpy(strings[i] + offset, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
+          } // for
 
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
-          }
+          offset += data_build.setting.version_major_prefix.used;
         }
-      }
-    }
 
-    if (parameter_file_name_major.used) {
-      count += fake_build_parameter_library_name_suffix_shared_s.used;
+        for (i = 1; i < strings_length; ++i) {
+          memcpy(strings[i] + offset, data_build.setting.version_major.string, data_build.setting.version_major.used);
+        } // for
 
-      if (data_build.setting.version_major_prefix.used) {
-        memcpy(parameter_file_name_major_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
+        offset += data_build.setting.version_major.used;
 
         if (parameter_file_name_minor.used) {
-          memcpy(parameter_file_name_minor_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
-
-          if (parameter_file_name_micro.used) {
-            memcpy(parameter_file_name_micro_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
-
-            if (parameter_file_name_nano.used) {
-              memcpy(parameter_file_name_nano_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
-            }
-          }
-        }
+          if (data_build.setting.version_minor_prefix.used) {
+            for (i = 2; i < strings_length; ++i) {
+              memcpy(strings[i] + offset, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+            } // for
 
-        count += data_build.setting.version_major_prefix.used;
-      }
-
-      memcpy(parameter_file_name_major_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
-      if (parameter_file_name_minor.used) {
-        memcpy(parameter_file_name_minor_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
-        if (parameter_file_name_micro.used) {
-          memcpy(parameter_file_name_micro_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
+            offset += data_build.setting.version_minor_prefix.used;
           }
-        }
-      }
 
-      if (parameter_file_name_minor.used) {
-        count += data_build.setting.version_major.used;
+          for (i = 2; i < strings_length; ++i) {
+            memcpy(strings[i] + offset, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
+          } // for
 
-        if (data_build.setting.version_minor_prefix.used) {
-          memcpy(parameter_file_name_minor_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+          offset += data_build.setting.version_minor.used;
 
           if (parameter_file_name_micro.used) {
-            memcpy(parameter_file_name_micro_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+            if (data_build.setting.version_micro_prefix.used) {
+              for (i = 3; i < strings_length; ++i) {
+                memcpy(strings[i] + offset, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
+              } // for
 
-            if (parameter_file_name_nano.used) {
-              memcpy(parameter_file_name_nano_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+              offset += data_build.setting.version_micro_prefix.used;
             }
-          }
 
-          count += data_build.setting.version_minor_prefix.used;
-        }
-
-        memcpy(parameter_file_name_minor_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
-
-        if (parameter_file_name_micro.used) {
-          memcpy(parameter_file_name_micro_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
+            for (i = 3; i < strings_length; ++i) {
+              memcpy(strings[i] + offset, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+            } // for
 
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
-          }
-        }
-
-        if (parameter_file_name_micro.used) {
-          count += data_build.setting.version_minor.used;
-
-          if (data_build.setting.version_micro_prefix.used) {
-            memcpy(parameter_file_name_micro_string + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
+            offset += data_build.setting.version_micro.used;
 
             if (parameter_file_name_nano.used) {
-              memcpy(parameter_file_name_nano_string + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
-            }
+              if (data_build.setting.version_nano_prefix.used) {
+                for (i = 4; i < strings_length; ++i) {
+                  memcpy(strings[i] + offset, data_build.setting.version_nano_prefix.string, data_build.setting.version_nano_prefix.used);
+                } // for
 
-            count += data_build.setting.version_micro_prefix.used;
-          }
+                offset += data_build.setting.version_nano_prefix.used;
+              }
 
-          memcpy(parameter_file_name_micro_string + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+              for (i = 4; i < strings_length; ++i) {
+                memcpy(strings[i] + offset, data_build.setting.version_nano.string, data_build.setting.version_nano.used);
+              } // for
 
-          if (parameter_file_name_nano.used) {
-            memcpy(parameter_file_name_nano_string + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
-
-            count += data_build.setting.version_micro.used;
-
-            if (data_build.setting.version_nano_prefix.used) {
-              memcpy(parameter_file_name_nano_string + count, data_build.setting.version_nano_prefix.string, data_build.setting.version_nano_prefix.used);
-              count += data_build.setting.version_nano_prefix.used;
+              offset += data_build.setting.version_nano.used;
             }
-
-            memcpy(parameter_file_name_nano_string + count, data_build.setting.version_nano.string, data_build.setting.version_nano.used);
           }
         }
       }
     }
 
     {
-      f_string_static_t parameter_linker = f_string_static_t_initialize;
       f_string_static_t parameter_file_path = f_string_static_t_initialize;
+      f_string_static_t parameter_linker = f_string_static_t_initialize;
 
-      parameter_linker.used = fake_build_parameter_library_shared_prefix_s.used;
       parameter_file_path.used = main->path_build_libraries_shared.used;
+      parameter_linker.used = fake_build_parameter_library_shared_prefix_s.used;
 
       if (data_build.setting.version_file == fake_build_version_type_major_e) {
         parameter_file_path.used += parameter_file_name_major.used;
@@ -295,14 +264,17 @@ extern "C" {
         parameter_linker.used += parameter_file_name_nano.used;
       }
 
-      char parameter_linker_string[parameter_linker.used + 1];
       char parameter_file_path_string[parameter_file_path.used + 1];
+      char parameter_linker_string[parameter_linker.used + 1];
 
-      parameter_linker.string = parameter_linker_string;
       parameter_file_path.string = parameter_file_path_string;
+      parameter_linker.string = parameter_linker_string;
+
+      parameter_file_path_string[parameter_file_path.used] = 0;
+      parameter_linker_string[parameter_linker.used] = 0;
 
-      memcpy(parameter_linker_string, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used);
       memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+      memcpy(parameter_linker_string, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used);
 
       if (data_build.setting.version_file == fake_build_version_type_major_e) {
         memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major_string, parameter_file_name_major.used);
@@ -330,9 +302,6 @@ extern "C" {
         memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_nano_string, parameter_file_name_nano.used);
       }
 
-      parameter_linker_string[parameter_linker.used] = 0;
-      parameter_file_path_string[parameter_file_path.used] = 0;
-
       const f_string_static_t values[] = {
         fake_build_parameter_library_shared_s,
         parameter_linker,
@@ -374,12 +343,11 @@ extern "C" {
 
       char parameter_file_path_string[parameter_file_path.used + 1];
       parameter_file_path.string = parameter_file_path_string;
-
-      memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
-      memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name.string, parameter_file_name.used);
-
       parameter_file_path_string[parameter_file_path.used] = 0;
 
+      memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+      memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name.string, parameter_file_name.used);
+
       *status = f_file_link(parameter_file_name_major, parameter_file_path);
 
       if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
@@ -400,74 +368,74 @@ extern "C" {
 
     if (data_build.setting.version_file != fake_build_version_type_major_e && parameter_file_name_major.used) {
       f_string_static_t parameter_file_path = f_string_static_t_initialize;
-      parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
-
-      char parameter_file_path_string[parameter_file_path.used + 1];
 
-      memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
-      memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name_major.string, parameter_file_name_major.used);
+      {
+        parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
 
-      parameter_file_path_string[parameter_file_path.used] = 0;
-      parameter_file_path.string = parameter_file_path_string;
+        char parameter_file_path_string[parameter_file_path.used + 1];
+        parameter_file_path.string = parameter_file_path_string;
+        parameter_file_path_string[parameter_file_path.used] = 0;
 
-      *status = f_file_link(parameter_file_name_minor, parameter_file_path);
+        memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+        memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major.string, parameter_file_name_major.used);
 
-      if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
-        fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
-      }
-      else if (F_status_is_error(*status)) {
-        if (F_status_set_fine(*status) == F_file_found) {
-          fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+        *status = f_file_link(parameter_file_name_minor, parameter_file_path);
 
-          return 0;
+        if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
+          fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
         }
+        else if (F_status_is_error(*status)) {
+          if (F_status_set_fine(*status) == F_file_found) {
+            fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
 
-        fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+            return 0;
+          }
 
-        return 0;
+          fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+
+          return 0;
+        }
       }
 
       if (data_build.setting.version_file != fake_build_version_type_minor_e && parameter_file_name_minor.used) {
-        f_string_static_t parameter_file_path = f_string_static_t_initialize;
-        parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
+        {
+          parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
 
-        char parameter_file_path_string[parameter_file_path.used + 1];
-        parameter_file_path.string = parameter_file_path_string;
+          char parameter_file_path_string[parameter_file_path.used + 1];
+          parameter_file_path.string = parameter_file_path_string;
+          parameter_file_path_string[parameter_file_path.used] = 0;
 
-        memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
-        memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name_minor.string, parameter_file_name_minor.used);
+          memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+          memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_minor.string, parameter_file_name_minor.used);
 
-        parameter_file_path_string[parameter_file_path.used] = 0;
+          *status = f_file_link(parameter_file_name_micro, parameter_file_path);
 
-        *status = f_file_link(parameter_file_name_micro, parameter_file_path);
+          if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
+            fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
+          }
+          else if (F_status_is_error(*status)) {
+            if (F_status_set_fine(*status) == F_file_found) {
+              fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
 
-        if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
-          fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
-        }
-        else if (F_status_is_error(*status)) {
-          if (F_status_set_fine(*status) == F_file_found) {
-            fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+              return 0;
+            }
+
+            fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
 
             return 0;
           }
-
-          fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
-
-          return 0;
         }
 
         if (data_build.setting.version_file != fake_build_version_type_micro_e && parameter_file_name_micro.used) {
-          f_string_static_t parameter_file_path = f_string_static_t_initialize;
           parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_micro.used;
 
           char parameter_file_path_string[parameter_file_path.used + 1];
           parameter_file_path.string = parameter_file_path_string;
+          parameter_file_path_string[parameter_file_path.used] = 0;
 
           memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
           memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_micro.string, parameter_file_name_micro.used);
 
-          parameter_file_path_string[parameter_file_path.used] = 0;
-
           *status = f_file_link(parameter_file_name_nano, parameter_file_path);
 
           if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
@@ -525,6 +493,7 @@ extern "C" {
 
       char destination_string[destination.used + 1];
       destination.string = destination_string;
+      destination_string[destination.used] = 0;
 
       destination.used = 0;
 
@@ -540,8 +509,6 @@ extern "C" {
       memcpy(destination_string + destination.used, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used);
       destination.used += fake_build_parameter_library_name_suffix_static_s.used;
 
-      destination_string[destination.used] = 0;
-
       *status = fll_execute_arguments_add(destination, &arguments);
     }
 
@@ -609,6 +576,7 @@ extern "C" {
 
           char source_string[source.used + 1];
           source.string = source_string;
+          source_string[source.used] = 0;
 
           if (source_path.used) {
             memcpy(source_string, source_path.string, source_path.used);
@@ -621,8 +589,6 @@ extern "C" {
             memcpy(source_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used);
           }
 
-          source_string[source.used] = 0;
-
           *status = fll_execute_arguments_add(source, &arguments);
 
           if (F_status_is_error(*status)) {
index 511611ccd524bc5a5087fe687b701983e56924fd..202a532c971b3f1b53d4ddae2fa35e417f5647d9 100644 (file)
@@ -86,6 +86,7 @@ extern "C" {
 
     char path_file_string[path_file.used + 1];
     path_file.string = path_file_string;
+    path_file_string[path_file.used] = 0;
 
     {
       f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
@@ -97,8 +98,6 @@ extern "C" {
         memcpy(path_file_string, main->path_data_build.string, main->path_data_build.used);
         memcpy(path_file_string + main->path_data_build.used, setting_file.string, setting_file.used);
 
-        path_file_string[main->path_data_build.used + setting_file.used] = 0;
-
         *status = fake_file_buffer(main, path_file, &buffer);
       }
       else {
@@ -507,14 +506,21 @@ extern "C" {
             break;
           }
 
-          memcpy(settings_mode_names[j].string, settings_name[j].string, settings_value[j]->used);
-          settings_mode_names[j].used = settings_value[j]->used;
+          *status = f_string_dynamic_append(settings_name[j], &settings_mode_names[j]);
 
-          memcpy(settings_mode_names[j].string, f_string_ascii_minus_s.string, f_string_ascii_minus_s.used);
-          settings_mode_names[j].used += f_string_ascii_minus_s.used;
+          if (F_status_is_error_not(*status)) {
+            *status = f_string_dynamic_append(f_string_ascii_minus_s, &settings_mode_names[j]);
+          }
 
-          memcpy(settings_mode_names[j].string + settings_mode_names[j].used, modes->array[i].string, modes->array[i].used);
-          settings_mode_names[j].used += modes->array[i].used;
+          if (F_status_is_error_not(*status)) {
+            *status = f_string_dynamic_append(modes->array[i], &settings_mode_names[j]);
+          }
+
+          if (F_status_is_error(*status)) {
+            function = "f_string_dynamic_increase_by";
+
+            break;
+          }
         } // for
 
         if (*status == F_none) {
@@ -532,10 +538,11 @@ extern "C" {
         if (F_status_is_error(*status)) break;
       } // for
 
-      // "build_libraries" is appended after all modes to help assist with static linker file issues (@todo there should likely be more options to have a postfix linker parameter that can be added here instead, such as "build_libraries_last").
+      // The string "build_libraries" is appended after all modes to help assist with static linker file issues (@todo there should likely be more options to have a postfix linker parameter that can be added here instead, such as "build_libraries_last").
       if (total_build_libraries) {
-        f_string_dynamic_t temporary[total_build_libraries];
+        f_string_static_t temporary[total_build_libraries];
 
+        // Move the original "build_libraries" into a temporary location.
         for (i = 0; i < total_build_libraries; ++i) {
 
           temporary[i].string = setting->build_libraries.array[i].string;
@@ -543,6 +550,7 @@ extern "C" {
           temporary[i].size = setting->build_libraries.array[i].size;
         } // for
 
+        // Move all of the other build library settings to the front of the array.
         for (i = 0, j = total_build_libraries; j < setting->build_libraries.used; ++i, ++j) {
 
           setting->build_libraries.array[i].string = setting->build_libraries.array[j].string;
@@ -550,6 +558,7 @@ extern "C" {
           setting->build_libraries.array[i].size = setting->build_libraries.array[j].size;
         } // for
 
+        // Move back the original "build_libraries" back, but at the end of the array.
         for (i = setting->build_libraries.used - total_build_libraries, j = 0; j < total_build_libraries; ++i, ++j) {
 
           setting->build_libraries.array[i].string = temporary[j].string;
index b0b439ce2c6815a09d0e493b88d55339fa548ee8..a6adfddadb74f6f35f06a64177bff47872f6882c 100644 (file)
@@ -59,10 +59,11 @@ extern "C" {
         source.used = path_sources->used + sources[i]->array[j].used;
 
         char source_string[source.used + 1];
+        source.string = source_string;
+        source_string[source.used] = 0;
 
         memcpy(source_string, path_sources->string, path_sources->used);
         memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
-        source_string[source.used] = 0;
 
         *status = fake_build_get_file_name_without_extension(main, sources[i]->array[j], &file_name);
 
@@ -162,6 +163,7 @@ extern "C" {
 
         char destination_string[destination.used + 1];
         destination.string = destination_string;
+        destination_string[destination.used] = 0;
 
         if (destination_path.used) {
           memcpy(destination_string, destination_path.string, destination_path.used);
@@ -174,8 +176,6 @@ extern "C" {
           memcpy(destination_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used);
         }
 
-        destination_string[destination.used] = 0;
-
         const f_string_static_t values[] = {
           source,
           fake_build_parameter_object_compile_s,
index 8c4b41af2302d150e83cd7b854f34fa741ab916b..00d9ecdd1acedae4130b721d99324307c3cf92c7 100644 (file)
@@ -65,12 +65,11 @@ extern "C" {
 
           char source_string[source.used + 1];
           source.string = source_string;
+          source_string[source.used] = 0;
 
           memcpy(source_string, path_sources->string, path_sources->used);
           memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
 
-          source_string[source.used] = 0;
-
           *status = fll_execute_arguments_add(source, &arguments);
           if (F_status_is_error(*status)) break;
         } // for
@@ -85,12 +84,11 @@ extern "C" {
 
       char parameter_file_name_path_string[parameter_file_name_path.used + 1];
       parameter_file_name_path.string = parameter_file_name_path_string;
+      parameter_file_name_path_string[parameter_file_name_path.used] = 0;
 
       memcpy(parameter_file_name_path_string, main->path_build_programs_shared.string, main->path_build_programs_shared.used);
       memcpy(parameter_file_name_path_string + main->path_build_programs_shared.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
 
-      parameter_file_name_path_string[parameter_file_name_path.used] = 0;
-
       const f_string_static_t values[] = {
         fake_build_parameter_library_output_s,
         parameter_file_name_path,
@@ -105,19 +103,18 @@ extern "C" {
       } // for
     }
 
-    // if project-specific library sources exist, then the -lproject_name needs to be added to the arguments.
+    // If project-specific library sources exist, then the -lproject_name needs to be added to the arguments.
     if (F_status_is_error_not(*status) && data_build.setting.build_sources_library.used) {
       f_string_static_t link_project_library = f_string_static_t_initialize;
       link_project_library.used = fake_build_parameter_library_link_file_s.used + data_build.setting.project_name.used;
 
       char link_project_library_string[link_project_library.used + 1];
       link_project_library.string = link_project_library_string;
+      link_project_library_string[link_project_library.used] = 0;
 
       memcpy(link_project_library_string, fake_build_parameter_library_link_file_s.string, fake_build_parameter_library_link_file_s.used);
       memcpy(link_project_library_string + fake_build_parameter_library_link_file_s.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
 
-      link_project_library_string[link_project_library.used] = 0;
-
       *status = fll_execute_arguments_add(link_project_library, &arguments);
     }
 
@@ -189,12 +186,11 @@ extern "C" {
 
           char source_string[source.used + 1];
           source.string = source_string;
+          source_string[source.used] = 0;
 
           memcpy(source_string, path_sources->string, path_sources->used);
           memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
 
-          source_string[source.used] = 0;
-
           *status = fll_execute_arguments_add(source, &arguments);
           if (F_status_is_error(*status)) break;
         } // for
@@ -209,6 +205,7 @@ extern "C" {
 
       char source_library_string[source_library.used + 1];
       source_library.string = source_library_string;
+      source_library_string[source_library.used] = 0;
       source_library.used = 0;
 
       // Only include the library if there are sources that would result in it being built.
@@ -226,18 +223,16 @@ extern "C" {
         source_library.used += fake_build_parameter_library_name_suffix_static_s.used;
       }
 
-      source_library_string[source_library.used] = 0;
-
       f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
       parameter_file_name_path.used = main->path_build_programs_static.used + data_build.setting.project_name.used;
 
       char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+      parameter_file_name_path.string = parameter_file_name_path_string;
+      parameter_file_name_path_string[parameter_file_name_path.used] = 0;
 
       memcpy(parameter_file_name_path_string, main->path_build_programs_static.string, main->path_build_programs_static.used);
       memcpy(parameter_file_name_path_string + main->path_build_programs_static.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
 
-      parameter_file_name_path_string[parameter_file_name_path.used] = 0;
-
       const f_string_static_t values[] = {
         source_library,
         fake_build_parameter_library_static_s,
index 3052e52c6c7c8236d9f3706c375e7748a9d0c13a..b578399c7fa0a22526f0e4183fbbc47e07641436 100644 (file)
@@ -62,19 +62,19 @@ extern "C" {
       if (F_status_is_error(*status)) break;
     } // for
 
-    if (main->path_work.used) {
+    if (main->path_work.used && F_status_is_error_not(*status)) {
       f_string_static_t buffer = f_string_static_t_initialize;
 
       if (F_status_is_error_not(*status)) {
         buffer.used = fake_build_parameter_library_include_s.used + main->path_work_includes.used;
 
         char buffer_string[buffer.used + 1];
+        buffer.string = buffer_string;
+        buffer_string[buffer.used] = 0;
 
         memcpy(buffer_string, fake_build_parameter_library_include_s.string, fake_build_parameter_library_include_s.used);
         memcpy(buffer_string + fake_build_parameter_library_include_s.used, main->path_work_includes.string, main->path_work_includes.used);
 
-        buffer_string[buffer.used] = 0;
-
         *status = fll_execute_arguments_add(buffer, arguments);
       }
 
@@ -82,12 +82,12 @@ extern "C" {
         buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_shared.used;
 
         char buffer_string[buffer.used + 1];
+        buffer.string = buffer_string;
+        buffer_string[buffer.used] = 0;
 
         memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used);
         memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_shared.string, main->path_work_libraries_shared.used);
 
-        buffer_string[buffer.used] = 0;
-
         *status = fll_execute_arguments_add(buffer, arguments);
       }
 
@@ -95,12 +95,12 @@ extern "C" {
         buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_static.used;
 
         char buffer_string[buffer.used + 1];
+        buffer.string = buffer_string;
+        buffer_string[buffer.used] = 0;
 
         memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used);
         memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_static.string, main->path_work_libraries_static.used);
 
-        buffer_string[buffer.used] = 0;
-
         *status = fll_execute_arguments_add(buffer, arguments);
       }
     }
@@ -537,6 +537,7 @@ extern "C" {
       argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_dark_s.used;
 
       char argument_string[argument.used + 1];
+      argument.string = argument_string;
       argument_string[argument.used] = 0;
 
       memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used);
@@ -560,6 +561,7 @@ extern "C" {
       argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_quiet_s.used;
 
       char argument_string[argument.used + 1];
+      argument.string = argument_string;
       argument_string[argument.used] = 0;
 
       memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used);
index 2443a333f108053c08431313542907bf3acd0622..d329a2436eb921e71e7e6afa0730bff76bc60f6d 100644 (file)
@@ -291,9 +291,7 @@ extern "C" {
       }
 
       if (F_status_is_error_not(*status) && data_make->setting_make.load_build) {
-        f_string_static_t stub = f_string_static_t_initialize;
-
-        fake_build_load_setting(data_make->main, stub, &data_make->setting_build, status);
+        fake_build_load_setting(data_make->main, f_string_empty_s, &data_make->setting_build, status);
 
         if (F_status_is_error(*status) && *status != F_status_set_error(F_interrupt)) {
           fll_error_print(data_make->main->error, F_status_set_fine(*status), "fake_build_load_setting", F_true);
index e42db4f431fea814abafcbd79b2c4fd360605b77..b2e234f567ec148ff0d98b0fe9935a3179c14ec4 100644 (file)
@@ -99,9 +99,7 @@ extern "C" {
     }
 
     if (state_process->operation == fake_make_operation_type_build_e) {
-      f_string_static_t stub = f_string_static_t_initialize;
-
-      *status = fake_build_operate(arguments.used ? arguments.array[0] : stub, data_make->main);
+      *status = fake_build_operate(arguments.used ? arguments.array[0] : f_string_empty_s, data_make->main);
 
       if (F_status_set_fine(*status) == F_interrupt) {
         return 0;
index d6867cb421c6a5571613217b76297314782b8dcd..54657e12f860c03859d9909127e760c3572b6d58 100644 (file)
@@ -67,6 +67,7 @@ extern "C" {
 
       char destination_string[destination.used + 1];
       destination.string = destination_string;
+      destination_string[destination.used] = 0;
 
       memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
 
@@ -75,8 +76,6 @@ extern "C" {
         destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
       }
 
-      destination_string[destination.used] = 0;
-
       status_file = f_directory_is(arguments.array[i]);
 
       if (status_file == F_true) {
@@ -1059,6 +1058,7 @@ extern "C" {
 
       char destination_string[destination.used + 1];
       destination.string = destination_string;
+      destination_string[destination.used] = 0;
 
       memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
 
@@ -1067,8 +1067,6 @@ extern "C" {
         destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
       }
 
-      destination_string[destination.used] = 0;
-
       status_file = fll_file_move(arguments.array[i], destination, recurse);
 
       if (F_status_is_error(status_file)) {
index 467c62c98cabe5d69ff7ae4cdab6e4e56d902795..e48a6966770d8186428a7be81ce065e7cf07eb4b 100644 (file)
@@ -84,12 +84,11 @@ extern "C" {
 
           char path_file_string[path_file.used + 1];
           path_file.string = path_file_string;
+          path_file_string[path_file.used] = 0;
 
           memcpy(path_file_string, data_make->main->path_data_build.string, data_make->main->path_data_build.used);
           memcpy(path_file_string + data_make->main->path_data_build.used, arguments.array[0].string, arguments.array[0].used);
 
-          path_file_string[path_file.used] = 0;
-
           f_status_t status_file = f_file_is(path_file, F_file_type_regular_d, F_false);
 
           if (status_file == F_file_found_not) {
diff --git a/level_3/firewall/c/common.c b/level_3/firewall/c/common.c
new file mode 100644 (file)
index 0000000..7d03c1d
--- /dev/null
@@ -0,0 +1,123 @@
+#include "firewall.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_firewall_program_help_parameters_
+  const f_string_static_t firewall_program_help_parameters_s = macro_f_string_static_t_initialize(FIREWALL_program_help_parameters_s, 0, FIREWALL_program_help_parameters_s_length);
+#endif // _di_firewall_program_help_parameters_
+
+#ifndef _di_firewall_paths_
+  const f_string_static_t firewall_file_first_s = macro_f_string_static_t_initialize(FIREWALL_file_first_s, 0, FIREWALL_file_first_s_length);
+  const f_string_static_t firewall_file_last_s = macro_f_string_static_t_initialize(FIREWALL_file_last_s, 0, FIREWALL_file_last_s_length);
+  const f_string_static_t firewall_file_other_s = macro_f_string_static_t_initialize(FIREWALL_file_other_s, 0, FIREWALL_file_other_s_length);
+  const f_string_static_t firewall_file_suffix_s = macro_f_string_static_t_initialize(FIREWALL_file_suffix_s, 0, FIREWALL_file_suffix_s_length);
+
+  const f_string_static_t firewall_network_path_s = macro_f_string_static_t_initialize(FIREWALL_network_path_s, 0, FIREWALL_network_path_s_length);
+  const f_string_static_t firewall_network_devices_s = macro_f_string_static_t_initialize(FIREWALL_network_devices_s, 0, FIREWALL_network_devices_s_length);
+#endif // _di_firewall_paths_
+
+#ifndef _di_firewall_defines_
+  const f_string_static_t firewall_action_s = macro_f_string_static_t_initialize(FIREWALL_action_s, 0, FIREWALL_action_s_length);
+  const f_string_static_t firewall_action_append_s = macro_f_string_static_t_initialize(FIREWALL_action_append_s, 0, FIREWALL_action_append_s_length);
+  const f_string_static_t firewall_action_insert_s = macro_f_string_static_t_initialize(FIREWALL_action_insert_s, 0, FIREWALL_action_insert_s_length);
+  const f_string_static_t firewall_action_policy_s = macro_f_string_static_t_initialize(FIREWALL_action_policy_s, 0, FIREWALL_action_policy_s_length);
+  const f_string_static_t firewall_action_none_s = macro_f_string_static_t_initialize(FIREWALL_action_none_s, 0, FIREWALL_action_none_s_length);
+
+  const f_string_static_t firewall_action_append_command_s = macro_f_string_static_t_initialize(FIREWALL_action_append_command_s, 0, FIREWALL_action_append_command_s_length);
+  const f_string_static_t firewall_action_insert_command_s = macro_f_string_static_t_initialize(FIREWALL_action_insert_command_s, 0, FIREWALL_action_insert_command_s_length);
+  const f_string_static_t firewall_action_policy_command_s = macro_f_string_static_t_initialize(FIREWALL_action_policy_command_s, 0, FIREWALL_action_policy_command_s_length);
+
+  const f_string_static_t firewall_chain_s = macro_f_string_static_t_initialize(FIREWALL_chain_s, 0, FIREWALL_chain_s_length);
+  const f_string_static_t firewall_chain_forward_s = macro_f_string_static_t_initialize(FIREWALL_chain_forward_s, 0, FIREWALL_chain_forward_s_length);
+  const f_string_static_t firewall_chain_drop_s = macro_f_string_static_t_initialize(FIREWALL_chain_drop_s, 0, FIREWALL_chain_drop_s_length);
+  const f_string_static_t firewall_chain_input_s = macro_f_string_static_t_initialize(FIREWALL_chain_input_s, 0, FIREWALL_chain_input_s_length);
+  const f_string_static_t firewall_chain_none_s = macro_f_string_static_t_initialize(FIREWALL_chain_none_s, 0, FIREWALL_chain_none_s_length);
+  const f_string_static_t firewall_chain_output_s = macro_f_string_static_t_initialize(FIREWALL_chain_output_s, 0, FIREWALL_chain_output_s_length);
+  const f_string_static_t firewall_chain_postrouting_s = macro_f_string_static_t_initialize(FIREWALL_chain_postrouting_s, 0, FIREWALL_chain_postrouting_s_length);
+  const f_string_static_t firewall_chain_prerouting_s = macro_f_string_static_t_initialize(FIREWALL_chain_prerouting_s, 0, FIREWALL_chain_prerouting_s_length);
+
+  const f_string_static_t firewall_chain_create_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_create_command_s, 0, FIREWALL_chain_create_command_s_length);
+  const f_string_static_t firewall_chain_delete_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_delete_command_s, 0, FIREWALL_chain_delete_command_s_length);
+  const f_string_static_t firewall_chain_flush_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_flush_command_s, 0, FIREWALL_chain_flush_command_s_length);
+
+  const f_string_static_t firewall_command_start_s = macro_f_string_static_t_initialize(FIREWALL_command_start_s, 0, FIREWALL_command_start_s_length);
+  const f_string_static_t firewall_command_stop_s = macro_f_string_static_t_initialize(FIREWALL_command_stop_s, 0, FIREWALL_command_stop_s_length);
+  const f_string_static_t firewall_command_restart_s = macro_f_string_static_t_initialize(FIREWALL_command_restart_s, 0, FIREWALL_command_restart_s_length);
+  const f_string_static_t firewall_command_lock_s = macro_f_string_static_t_initialize(FIREWALL_command_lock_s, 0, FIREWALL_command_lock_s_length);
+  const f_string_static_t firewall_command_show_s = macro_f_string_static_t_initialize(FIREWALL_command_show_s, 0, FIREWALL_command_show_s_length);
+
+  const f_string_static_t firewall_device_s = macro_f_string_static_t_initialize(FIREWALL_device_s, 0, FIREWALL_device_s_length);
+  const f_string_static_t firewall_device_all_s = macro_f_string_static_t_initialize(FIREWALL_device_all_s, 0, FIREWALL_device_all_s_length);
+  const f_string_static_t firewall_device_this_s = macro_f_string_static_t_initialize(FIREWALL_device_this_s, 0, FIREWALL_device_this_s_length);
+  const f_string_static_t firewall_device_loop_s = macro_f_string_static_t_initialize(FIREWALL_device_loop_s, 0, FIREWALL_device_loop_s_length);
+
+  const f_string_static_t firewall_device_input_command_s = macro_f_string_static_t_initialize(FIREWALL_device_input_command_s, 0, FIREWALL_device_input_command_s_length);
+  const f_string_static_t firewall_device_output_command_s = macro_f_string_static_t_initialize(FIREWALL_device_output_command_s, 0, FIREWALL_device_output_command_s_length);
+
+  const f_string_static_t firewall_direction_s = macro_f_string_static_t_initialize(FIREWALL_direction_s, 0, FIREWALL_direction_s_length);
+  const f_string_static_t firewall_direction_input_s = macro_f_string_static_t_initialize(FIREWALL_direction_input_s, 0, FIREWALL_direction_input_s_length);
+  const f_string_static_t firewall_direction_output_s = macro_f_string_static_t_initialize(FIREWALL_direction_output_s, 0, FIREWALL_direction_output_s_length);
+  const f_string_static_t firewall_direction_none_s = macro_f_string_static_t_initialize(FIREWALL_direction_none_s, 0, FIREWALL_direction_none_s_length);
+
+  const f_string_static_t firewall_group_stop_s = macro_f_string_static_t_initialize(FIREWALL_group_stop_s, 0, FIREWALL_group_stop_s_length);
+  const f_string_static_t firewall_group_lock_s = macro_f_string_static_t_initialize(FIREWALL_group_lock_s, 0, FIREWALL_group_lock_s_length);
+  const f_string_static_t firewall_group_main_s = macro_f_string_static_t_initialize(FIREWALL_group_main_s, 0, FIREWALL_group_main_s_length);
+
+  const f_string_static_t firewall_ip_list = macro_f_string_static_t_initialize(FIREWALL_ip_list, 0, FIREWALL_ip_list_length);
+  const f_string_static_t firewall_ip_list_source_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_source_s, 0, FIREWALL_ip_list_source_s_length);
+  const f_string_static_t firewall_ip_list_source_action_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_source_action_s, 0, FIREWALL_ip_list_source_action_s_length);
+  const f_string_static_t firewall_ip_list_destination_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_destination_s, 0, FIREWALL_ip_list_destination_s_length);
+  const f_string_static_t firewall_ip_list_destination_action_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_destination_action_s, 0, FIREWALL_ip_list_destination_action_s_length);
+
+  const f_string_static_t firewall_protocol_s = macro_f_string_static_t_initialize(FIREWALL_protocol_s, 0, FIREWALL_protocol_s_length);
+  const f_string_static_t firewall_protocol_command_s = macro_f_string_static_t_initialize(FIREWALL_protocol_command_s, 0, FIREWALL_protocol_command_s_length);
+  const f_string_static_t firewall_protocol_none_s = macro_f_string_static_t_initialize(FIREWALL_protocol_none_s, 0, FIREWALL_protocol_none_s_length);
+
+  const f_string_static_t firewall_rule_s = macro_f_string_static_t_initialize(FIREWALL_rule_s, 0, FIREWALL_rule_s_length);
+
+  const f_string_static_t firewall_show_mangle_s = macro_f_string_static_t_initialize(FIREWALL_show_mangle_s, 0, FIREWALL_show_mangle_s_length);
+  const f_string_static_t firewall_show_nat_s = macro_f_string_static_t_initialize(FIREWALL_show_nat_s, 0, FIREWALL_show_nat_s_length);
+  const f_string_static_t firewall_show_ports_s = macro_f_string_static_t_initialize(FIREWALL_show_ports_s, 0, FIREWALL_show_ports_s_length);
+
+  const f_string_static_t firewall_show_parameter_exact_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_exact_s, 0, FIREWALL_show_parameter_exact_s_length);
+  const f_string_static_t firewall_show_parameter_verbose_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_verbose_s, 0, FIREWALL_show_parameter_verbose_s_length);
+  const f_string_static_t firewall_show_parameter_table_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_table_s, 0, FIREWALL_show_parameter_table_s_length);
+  const f_string_static_t firewall_show_parameter_numeric_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_numeric_s, 0, FIREWALL_show_parameter_numeric_s_length);
+  const f_string_static_t firewall_show_parameter_list_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_list_s, 0, FIREWALL_show_parameter_list_s_length);
+
+  const f_string_static_t firewall_tool_s = macro_f_string_static_t_initialize(FIREWALL_tool_s, 0, FIREWALL_tool_s_length);
+  const f_string_static_t firewall_tool_iptables_s = macro_f_string_static_t_initialize(FIREWALL_tool_iptables_s, 0, FIREWALL_tool_iptables_s_length);
+  const f_string_static_t firewall_tool_ip6tables_s = macro_f_string_static_t_initialize(FIREWALL_tool_ip6tables_s, 0, FIREWALL_tool_ip6tables_s_length);
+  const f_string_static_t firewall_tool_ip46tables_s = macro_f_string_static_t_initialize(FIREWALL_tool_ip46tables_s, 0, FIREWALL_tool_ip46tables_s_length);
+  const f_string_static_t firewall_tool_ipset_s = macro_f_string_static_t_initialize(FIREWALL_tool_ipset_s, 0, FIREWALL_tool_ipset_s_length);
+#endif // _di_firewall_defines_
+
+#ifndef _di_firewall_main_delete_
+  f_status_t firewall_main_delete(firewall_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_string_dynamics_resize(0, &main->chains);
+    f_type_array_lengths_resize(0, &main->remaining);
+    f_string_dynamics_resize(0, &main->devices);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_firewall_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/firewall/c/common.h b/level_3/firewall/c/common.h
new file mode 100644 (file)
index 0000000..35ab6e7
--- /dev/null
@@ -0,0 +1,441 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Firewall
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _firewall_common_h
+#define _firewall_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  #define FIREWALL_program_version_major_s F_string_ascii_0_s
+  #define FIREWALL_program_version_minor_s F_string_ascii_5_s
+  #define FIREWALL_program_version_micro_s F_string_ascii_8_s
+
+  #define FIREWALL_program_version_major_s_length F_string_ascii_0_s_length
+  #define FIREWALL_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FIREWALL_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
+    #define FIREWALL_program_version_nano_prefix_s
+    #define FIREWALL_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
+
+  #if !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
+    #define FIREWALL_program_version_nano_s
+    #define FIREWALL_program_version_nano_s_length 0
+  #endif // !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
+
+  #define FIREWALL_program_version_s FIREWALL_program_version_major_s F_string_ascii_period_s FIREWALL_program_version_minor_s F_string_ascii_period_s FIREWALL_program_version_micro_s FIREWALL_program_version_nano_prefix_s FIREWALL_program_version_nano_s
+
+  #define FIREWALL_program_version_s_length FIREWALL_program_version_major_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_minor_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_micro_s_length + FIREWALL_program_version_nano_prefix_s_length + FIREWALL_program_version_nano_s_length
+
+  extern const f_string_static_t firewall_program_version_s;
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  #define FIREWALL_program_name_s      "firewall"
+  #define FIREWALL_program_name_long_s "Kevux Firewall Manager"
+
+  #define FIREWALL_program_name_s_length      8
+  #define FIREWALL_program_name_long_s_length 22
+
+  extern const f_string_static_t firewall_program_name_s;
+  extern const f_string_static_t firewall_program_name_long_s;
+#endif // _di_firewall_program_name_
+
+#ifndef _di_firewall_program_help_parameters_
+  #define FIREWALL_program_help_parameters_s "command"
+  #define FIREWALL_program_help_parameters_s_length 7
+
+  extern const f_string_static_t firewall_program_help_parameters_s;
+#endif // _di_firewall_program_help_parameters_
+
+#ifndef _di_firewall_paths_
+  #define FIREWALL_file_first_s  "firewall-first"
+  #define FIREWALL_file_last_s   "firewall-last"
+  #define FIREWALL_file_other_s  "firewall-other"
+  #define FIREWALL_file_suffix_s "-firewall"
+
+  #define FIREWALL_network_path_s    "/etc/network/"
+  #define FIREWALL_network_devices_s "/sys/class/net/"
+
+  #define FIREWALL_file_first_s_length   14
+  #define FIREWALL_file_last_s_length    13
+  #define FIREWALL_file_other_s_length   14
+  #define FIREWALL_file_suffix_s_length  9
+
+  #define FIREWALL_network_path_s_length    13
+  #define FIREWALL_network_devices_s_length 15
+
+  extern const f_string_static_t firewall_file_first_s;
+  extern const f_string_static_t firewall_file_last_s;
+  extern const f_string_static_t firewall_file_other_s;
+  extern const f_string_static_t firewall_file_suffix_s;
+
+  extern const f_string_static_t firewall_network_path_s;
+  extern const f_string_static_t firewall_network_devices_s;
+#endif // _di_firewall_paths_
+
+#ifndef _di_firewall_default_allocation_step_
+  #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
+#endif // _di_firewall_default_allocation_step_
+
+#ifndef _di_firewall_defines_
+  #define firewall_signal_check_d 10000
+
+  #define FIREWALL_action_s        "action"
+  #define FIREWALL_action_append_s "append"
+  #define FIREWALL_action_insert_s "insert"
+  #define FIREWALL_action_policy_s "policy"
+  #define FIREWALL_action_none_s   "none"
+
+  #define FIREWALL_action_append_command_s "-A"
+  #define FIREWALL_action_insert_command_s "-I"
+  #define FIREWALL_action_policy_command_s "-P"
+
+  #define FIREWALL_chain_s             "chain"
+  #define FIREWALL_chain_forward_s     "FORWARD"
+  #define FIREWALL_chain_drop_s        "DROP"
+  #define FIREWALL_chain_input_s       "INPUT"
+  #define FIREWALL_chain_none_s        "none"
+  #define FIREWALL_chain_output_s      "OUTPUT"
+  #define FIREWALL_chain_postrouting_s "POSTROUTING"
+  #define FIREWALL_chain_prerouting_s  "PREROUTING"
+
+  #define FIREWALL_chain_create_command_s "-N"
+  #define FIREWALL_chain_delete_command_s "-X"
+  #define FIREWALL_chain_flush_command_s  "-F"
+
+  #define FIREWALL_command_start_s   "start"
+  #define FIREWALL_command_stop_s    "stop"
+  #define FIREWALL_command_restart_s "restart"
+  #define FIREWALL_command_lock_s    "lock"
+  #define FIREWALL_command_show_s    "show"
+
+  #define FIREWALL_device_s      "device"
+  #define FIREWALL_device_all_s  "all"
+  #define FIREWALL_device_this_s "this"
+  #define FIREWALL_device_loop_s "lo"
+
+  #define FIREWALL_device_input_command_s  "-i"
+  #define FIREWALL_device_output_command_s "-o"
+
+  #define FIREWALL_direction_s        "direction"
+  #define FIREWALL_direction_input_s  "input"
+  #define FIREWALL_direction_output_s "output"
+  #define FIREWALL_direction_none_s   "none"
+
+  #define FIREWALL_group_stop_s "stop"
+  #define FIREWALL_group_lock_s "lock"
+  #define FIREWALL_group_main_s "main"
+
+  #define FIREWALL_ip_list                      "ip_list"
+  #define FIREWALL_ip_list_source_s             "source"
+  #define FIREWALL_ip_list_source_action_s      "-s"
+  #define FIREWALL_ip_list_destination_s        "destination"
+  #define FIREWALL_ip_list_destination_action_s "-d"
+
+  #define FIREWALL_protocol_s         "protocol"
+  #define FIREWALL_protocol_command_s "-p"
+  #define FIREWALL_protocol_none_s    "none"
+
+  #define FIREWALL_rule_s "rule"
+
+  #define FIREWALL_show_mangle_s "mangle"
+  #define FIREWALL_show_nat_s    "nat"
+  #define FIREWALL_show_ports_s  "ports"
+
+  #define FIREWALL_show_parameter_exact_s   "-x"
+  #define FIREWALL_show_parameter_verbose_s "-v"
+  #define FIREWALL_show_parameter_table_s   "-t"
+  #define FIREWALL_show_parameter_numeric_s "--numeric"
+  #define FIREWALL_show_parameter_list_s    "--list"
+
+  #define FIREWALL_tool_s            "tool"
+  #define FIREWALL_tool_iptables_s   "iptables"
+  #define FIREWALL_tool_ip6tables_s  "ip6tables"
+  #define FIREWALL_tool_ip46tables_s "ip46tables"
+  #define FIREWALL_tool_ipset_s      "ipset"
+
+  #define FIREWALL_action_length_s        6
+  #define FIREWALL_action_append_s_length 6
+  #define FIREWALL_action_insert_s_length 6
+  #define FIREWALL_action_policy_s_length 6
+  #define FIREWALL_action_none_s_length   4
+
+  #define FIREWALL_action_append_command_s_length 2
+  #define FIREWALL_action_insert_command_s_length 2
+  #define FIREWALL_action_policy_command_s_length 2
+
+  #define FIREWALL_chain_s_length             5
+  #define FIREWALL_chain_forward_s_length     7
+  #define FIREWALL_chain_drop_s_length        4
+  #define FIREWALL_chain_input_s_length       5
+  #define FIREWALL_chain_none_s_length        4
+  #define FIREWALL_chain_output_s_length      6
+  #define FIREWALL_chain_postrouting_s_length 12
+  #define FIREWALL_chain_prerouting_s_length  11
+
+  #define FIREWALL_chain_create_command_s_length 2
+  #define FIREWALL_chain_delete_command_s_length 2
+  #define FIREWALL_chain_flush_command_s_length  2
+
+  #define FIREWALL_command_start_s_length   5
+  #define FIREWALL_command_stop_s_length    4
+  #define FIREWALL_command_restart_s_length 7
+  #define FIREWALL_command_lock_s_length    4
+  #define FIREWALL_command_show_s_length    4
+
+  #define FIREWALL_device_s_length      6
+  #define FIREWALL_device_all_s_length  3
+  #define FIREWALL_device_this_s_length 4
+  #define FIREWALL_device_loop_s_length 2
+
+  #define FIREWALL_device_input_command_length_s  2
+  #define FIREWALL_device_output_command_length_s 2
+
+  #define FIREWALL_direction_s_length        9
+  #define FIREWALL_direction_input_s_length  5
+  #define FIREWALL_direction_output_s_length 6
+  #define FIREWALL_direction_none_s_length   4
+
+  #define FIREWALL_group_stop_s_length  4
+  #define FIREWALL_group_lock_s_length  4
+  #define FIREWALL_group_main_s_length  4
+
+  #define FIREWALL_ip_list_length_s                    7
+  #define FIREWALL_ip_list_source_s_length             6
+  #define FIREWALL_ip_list_source_action_s_length      2
+  #define FIREWALL_ip_list_destination_s_length        11
+  #define FIREWALL_ip_list_destination_action_s_length 2
+
+  #define FIREWALL_protocol_s_length         8
+  #define FIREWALL_protocol_command_s_length 2
+  #define FIREWALL_protocol_none_s_length    4
+
+  #define FIREWALL_rule_s_length 4
+
+  #define FIREWALL_show_mangle_s_length 6
+  #define FIREWALL_show_nat_s_length    3
+  #define FIREWALL_show_ports_s_length  5
+
+  #define FIREWALL_show_parameter_exact_s_length   2
+  #define FIREWALL_show_parameter_verbose_s_length 2
+  #define FIREWALL_show_parameter_table_s_length   2
+  #define FIREWALL_show_parameter_numeric_s_length 9
+  #define FIREWALL_show_parameter_list_s_length    6
+
+  #define FIREWALL_tool_s_length            4
+  #define FIREWALL_tool_iptables_s_length   8
+  #define FIREWALL_tool_ip6tables_s_length  9
+  #define FIREWALL_tool_ip46tables_s_length 10
+  #define FIREWALL_tool_ipset_s_length      5
+
+  extern const f_string_static_t firewall_action_s;
+  extern const f_string_static_t firewall_action_append_s;
+  extern const f_string_static_t firewall_action_insert_s;
+  extern const f_string_static_t firewall_action_policy_s;
+  extern const f_string_static_t firewall_action_none_s;
+
+  extern const f_string_static_t firewall_action_append_command_s;
+  extern const f_string_static_t firewall_action_insert_command_s;
+  extern const f_string_static_t firewall_action_policy_command_s;
+
+  extern const f_string_static_t firewall_chain_s;
+  extern const f_string_static_t firewall_chain_forward_s;
+  extern const f_string_static_t firewall_chain_drop_s;
+  extern const f_string_static_t firewall_chain_input_s;
+  extern const f_string_static_t firewall_chain_none_s;
+  extern const f_string_static_t firewall_chain_output_s;
+  extern const f_string_static_t firewall_chain_postrouting_s;
+  extern const f_string_static_t firewall_chain_prerouting_s;
+
+  extern const f_string_static_t firewall_chain_create_command_s;
+  extern const f_string_static_t firewall_chain_delete_command_s;
+  extern const f_string_static_t firewall_chain_flush_command_s;
+
+  extern const f_string_static_t firewall_command_start_s;
+  extern const f_string_static_t firewall_command_stop_s;
+  extern const f_string_static_t firewall_command_restart_s;
+  extern const f_string_static_t firewall_command_lock_s;
+  extern const f_string_static_t firewall_command_show_s;
+
+  extern const f_string_static_t firewall_device_s;
+  extern const f_string_static_t firewall_device_all_s;
+  extern const f_string_static_t firewall_device_this_s;
+  extern const f_string_static_t firewall_device_loop_s;
+
+  extern const f_string_static_t firewall_device_input_command_s;
+  extern const f_string_static_t firewall_device_output_command_s;
+
+  extern const f_string_static_t firewall_direction_s;
+  extern const f_string_static_t firewall_direction_input_s;
+  extern const f_string_static_t firewall_direction_output_s;
+  extern const f_string_static_t firewall_direction_none_s;
+
+  extern const f_string_static_t firewall_group_stop_s;
+  extern const f_string_static_t firewall_group_lock_s;
+  extern const f_string_static_t firewall_group_main_s;
+
+  extern const f_string_static_t firewall_ip_list;
+  extern const f_string_static_t firewall_ip_list_source_s;
+  extern const f_string_static_t firewall_ip_list_source_action_s;
+  extern const f_string_static_t firewall_ip_list_destination_s;
+  extern const f_string_static_t firewall_ip_list_destination_action_s;
+
+  extern const f_string_static_t firewall_protocol_s;
+  extern const f_string_static_t firewall_protocol_command_s;
+  extern const f_string_static_t firewall_protocol_none_s;
+
+  extern const f_string_static_t firewall_rule_s;
+
+  extern const f_string_static_t firewall_show_mangle_s;
+  extern const f_string_static_t firewall_show_nat_s;
+  extern const f_string_static_t firewall_show_ports_s;
+
+  extern const f_string_static_t firewall_show_parameter_exact_s;
+  extern const f_string_static_t firewall_show_parameter_verbose_s;
+  extern const f_string_static_t firewall_show_parameter_table_s;
+  extern const f_string_static_t firewall_show_parameter_numeric_s;
+  extern const f_string_static_t firewall_show_parameter_list_s;
+
+  extern const f_string_static_t firewall_tool_s;
+  extern const f_string_static_t firewall_tool_iptables_s;
+  extern const f_string_static_t firewall_tool_ip6tables_s;
+  extern const f_string_static_t firewall_tool_ip46tables_s;
+  extern const f_string_static_t firewall_tool_ipset_s;
+
+  enum {
+    firewall_program_none_e = 1,
+    firewall_program_iptables_e,
+    firewall_program_ip6tables_e,
+    firewall_program_ip46tables_e,
+    firewall_program_ipset_e,
+  };
+
+  enum {
+    firewall_parameter_help_e,
+    firewall_parameter_light_e,
+    firewall_parameter_dark_e,
+    firewall_parameter_no_color_e,
+    firewall_parameter_verbosity_quiet_e,
+    firewall_parameter_verbosity_normal_e,
+    firewall_parameter_verbosity_verbose_e,
+    firewall_parameter_verbosity_debug_e,
+    firewall_parameter_version_e,
+
+    firewall_parameter_command_start_e,
+    firewall_parameter_command_stop_e,
+    firewall_parameter_command_restart_e,
+    firewall_parameter_command_lock_e,
+    firewall_parameter_command_show_e,
+
+    firewall_direction_input_id_e,
+    firewall_direction_output_id_e,
+    firewall_direction_none_id_e,
+
+    firewall_chain_forward_id_e,
+    firewall_chain_custom_id_e,
+    firewall_chain_input_id_e,
+    firewall_chain_none_id_e,
+    firewall_chain_output_id_e,
+    firewall_chain_postrouting_id_e,
+    firewall_chain_prerouting_id_e,
+
+    firewall_action_append_id_e,
+    firewall_action_insert_id_e,
+    firewall_action_policy_id_e,
+    firewall_action_none_id_e,
+  };
+
+  #define firewall_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(0, 0, firewall_command_start_s.string, F_false, f_console_type_other_e), \
+      macro_f_console_parameter_t_initialize(0, 0, firewall_command_stop_s.string, F_false, f_console_type_other_e), \
+      macro_f_console_parameter_t_initialize(0, 0, firewall_command_restart_s.string, F_false, f_console_type_other_e), \
+      macro_f_console_parameter_t_initialize(0, 0, firewall_command_lock_s.string, F_false, f_console_type_other_e), \
+      macro_f_console_parameter_t_initialize(0, 0, firewall_command_show_s.string, F_false, f_console_type_other_e), \
+    }
+
+  #define firewall_total_parameters_d 14
+#endif // _di_firewall_defines_
+
+#ifndef _di_firewall_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+    int child;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_dynamics_t chains;
+    f_string_dynamics_t devices;
+
+    f_color_context_t context;
+  } firewall_main_t;
+
+  #define firewall_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      0, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_dynamics_t_initialize, \
+      f_string_dynamics_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_firewall_main_t_
+
+/**
+ * De-allocate data.
+ *
+ * Be sure to call this after executing firewall_main().
+ *
+ * @param data
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see firewall_main()
+ */
+#ifndef _di_firewall_main_delete_
+  extern f_status_t firewall_main_delete(firewall_main_t * const data);
+#endif // _di_firewall_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _firewall_common_h
index 0a077b7979f3ee037e0db0db7dec1b5f9362f6d5..3176330b9fb67267222a2de974eb8f6fec1bc798 100644 (file)
@@ -26,7 +26,7 @@ extern "C" {
 
     flockfile(file.stream);
 
-    fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_version_s);
+    fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_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.");
@@ -45,7 +45,7 @@ extern "C" {
     fl_print_format("%r  %[%s%]     Prevent all communication.", file.stream, f_string_eol_s, context.set.standout, firewall_command_lock_s, context.set.standout);
     fl_print_format("%r  %[%s%]     Show active firewall settings.", file.stream, f_string_eol_s, context.set.standout, firewall_command_show_s, context.set.standout);
 
-    fll_program_print_help_usage(file, context, firewall_program_name_s, "command");
+    fll_program_print_help_usage(file, context, firewall_program_name_s, firewall_program_help_parameters_s);
 
     funlockfile(file.stream);
 
@@ -58,6 +58,8 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    main->child = 0;
+
     f_console_parameter_t parameters[] = firewall_console_parameter_t_initialize;
     main->parameters.array = parameters;
     main->parameters.used = firewall_total_parameters_d;
@@ -144,7 +146,7 @@ extern "C" {
     }
 
     if (main->parameters.array[firewall_parameter_version_e].result == f_console_result_found_e) {
-      fll_program_print_version(main->output.to, firewall_version_s);
+      fll_program_print_version(main->output.to, firewall_program_version_s);
 
       firewall_main_delete(main);
 
@@ -215,12 +217,11 @@ extern "C" {
 
       if (command == firewall_parameter_command_show_e) {
 
-        // Warning: these are hardcoded print commands (I am not certain how I am going to implement external 'show' rules as the default-firewall setting file is the wrong place to put this)
+        // Warning: these are hardcoded print commands.
         bool show_nat = F_true;
         bool show_mangle = F_true;
         bool show_ports = F_true;
 
-        f_string_dynamics_t parameters = f_string_dynamics_t_initialize;
         int return_code = 0;
 
         if (main->remaining.used > 0) {
@@ -228,72 +229,64 @@ extern "C" {
           show_mangle = F_false;
           show_ports = F_false;
 
-          f_array_length_t counter = 0;
+          f_array_length_t index = 0;
+
+          for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
 
-          for (; counter < main->remaining.used; ++counter) {
+            index = main->remaining.array[i];
 
-            if (strncmp("nat", arguments->argv[main->remaining.array[counter]], 4) != 0) {
-              if (strncmp("mangle",  arguments->argv[main->remaining.array[counter]], 7) != 0) {
-                if (strncmp("ports",  arguments->argv[main->remaining.array[counter]], 6) != 0) {
+            if (fl_string_dynamic_compare(firewall_show_nat_s, argv[index]) == F_equal_to) {
+              show_nat = F_true;
+            }
+            else {
+              if (fl_string_dynamic_compare(firewall_show_mangle_s, argv[index]) == F_equal_to) {
+                show_mangle = F_true;
+              }
+              else {
+                if (fl_string_dynamic_compare(firewall_show_ports_s, argv[index]) == F_equal_to) {
+                  show_ports = F_true;
+                }
+                else {
                   flockfile(main->warning.to.stream);
 
                   fl_print_format("%r%[%Q'%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
-                  fl_print_format("%[%S%]", main->warning.to.stream, main->warning.notable, arguments->argv[main->remaining.array[counter]], main->warning.notable);
+                  fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, argv[index], main->warning.notable);
                   fl_print_format("%[' is not a valid show option.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
 
                   funlockfile(main->warning.to.stream);
                   fflush(main->warning.to.stream);
                 }
-                else {
-                  show_ports = F_true;
-                }
               }
-              else {
-                show_mangle = F_true;
-              }
-            }
-            else {
-              show_nat = F_true;
             }
           } // for
         }
 
-        macro_f_string_dynamics_t_resize(status, parameters, 7);
+        f_string_statics_t parameters = f_string_statics_t_initialize;
+        parameters.used = 6;
 
-        if (F_status_is_error(status)) {
-          firewall_print_error_on_allocation_failure(main->error);
+        f_string_static_t parameters_array[parameters.used];
+        parameters.array = parameters_array;
 
-          firewall_delete_local_data(&local);
-          firewall_main_delete(main);
-
-          return status;
-        }
+        parameters_array[0] = firewall_show_parameter_exact_s;
+        parameters_array[1] = firewall_show_parameter_verbose_s;
+        parameters_array[2] = firewall_show_parameter_table_s;
+        parameters_array[3] = firewall_show_nat_s;
+        parameters_array[4] = firewall_show_parameter_numeric_s;
+        parameters_array[5] = firewall_show_parameter_list_s;
 
         if (show_nat) {
           fll_print_format("%[===========================%] %[NAT%] %[============================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
           fflush(main->output.to.stream);
 
-          parameters.used = 6;
-
-          parameters.array[0].string = (f_string_t) "-x";
-          parameters.array[1].string = (f_string_t) "-v";
-          parameters.array[2].string = (f_string_t) "-t";
-          parameters.array[3].string = (f_string_t) "nat";
-          parameters.array[4].string = (f_string_t) "--numeric";
-          parameters.array[5].string = (f_string_t) "--list";
-
-          parameters.array[0].used = 2;
-          parameters.array[1].used = 2;
-          parameters.array[2].used = 2;
-          parameters.array[3].used = 3;
-          parameters.array[4].used = 9;
-          parameters.array[5].used = 6;
-
           status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
 
-          // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
           if (status == F_child) {
-            exit(return_code);
+            main->child = return_code;
+
+            firewall_delete_local_data(&local);
+            firewall_main_delete(main);
+
+            return status;
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -304,27 +297,17 @@ extern "C" {
           fll_print_format("%[==========================%] %[MANGLE%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
           fflush(main->output.to.stream);
 
-          parameters.used = 6;
-
-          parameters.array[0].string = (f_string_t) "-x";
-          parameters.array[1].string = (f_string_t) "-v";
-          parameters.array[2].string = (f_string_t) "-t";
-          parameters.array[3].string = (f_string_t) "mangle";
-          parameters.array[4].string = (f_string_t) "--numeric";
-          parameters.array[5].string = (f_string_t) "--list";
-
-          parameters.array[0].used = 2;
-          parameters.array[1].used = 2;
-          parameters.array[2].used = 2;
-          parameters.array[3].used = 6;
-          parameters.array[4].used = 9;
-          parameters.array[5].used = 6;
+          parameters_array[3] = firewall_show_mangle_s;
 
           status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
 
-          // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
           if (status == F_child) {
-            exit(return_code);
+            main->child = return_code;
+
+            firewall_delete_local_data(&local);
+            firewall_main_delete(main);
+
+            return status;
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -335,23 +318,21 @@ extern "C" {
           fll_print_format("%[==========================%] %[FILTER%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
           fflush(main->output.to.stream);
 
+          parameters_array[0] = firewall_show_parameter_exact_s;
+          parameters_array[1] = firewall_show_parameter_verbose_s;
+          parameters_array[2] = firewall_show_parameter_numeric_s;
+          parameters_array[3] = firewall_show_parameter_list_s;
           parameters.used = 4;
 
-          parameters.array[0].string = (f_string_t) "-x";
-          parameters.array[1].string = (f_string_t) "-v";
-          parameters.array[2].string = (f_string_t) "--numeric";
-          parameters.array[3].string = (f_string_t) "--list";
-
-          parameters.array[0].used = 2;
-          parameters.array[1].used = 2;
-          parameters.array[2].used = 9;
-          parameters.array[3].used = 6;
-
           status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
 
-          // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
           if (status == F_child) {
-            exit(return_code);
+            main->child = return_code;
+
+            firewall_delete_local_data(&local);
+            firewall_main_delete(main);
+
+            return status;
           }
 
           fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
@@ -371,30 +352,14 @@ extern "C" {
           status = F_status_set_error(status);
         }
 
-        parameters.array[0].string = 0;
-        parameters.array[1].string = 0;
-        parameters.array[2].string = 0;
-        parameters.array[3].string = 0;
-        parameters.array[4].string = 0;
-        parameters.array[5].string = 0;
-        parameters.array[6].string = 0;
-        parameters.array[0].used = 0;
-        parameters.array[1].used = 0;
-        parameters.array[2].used = 0;
-        parameters.array[3].used = 0;
-        parameters.array[4].used = 0;
-        parameters.array[5].used = 0;
-        parameters.array[6].used = 0;
-
-        f_string_dynamics_resize(0, & parameters);
         firewall_delete_local_data(&local);
         firewall_main_delete(main);
 
         return status;
       }
 
-      // load all network devices
-      status = f_directory_list((f_string_t) network_devices_s, 0, alphasort, &main->devices);
+      // Load all network devices.
+      status = f_directory_list(firewall_network_devices_s, 0, alphasort, &main->devices);
 
       if (F_status_is_error(status)) {
         status = F_status_set_fine(status);
@@ -407,7 +372,7 @@ extern "C" {
             fll_print_format("%r%[%QCould not find any network devices.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
           }
           else if (status == F_failure) {
-            fll_print_format("%r%[%QFailed to read the device directory '%s'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_devices_s, main->error.context, f_string_eol_s);
+            fll_print_format("%r%[%QFailed to read the device directory '%r'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, firewall_network_devices_s, main->error.context, f_string_eol_s);
           }
         }
 
@@ -417,19 +382,19 @@ extern "C" {
         return F_status_set_error(status);
       }
 
-      // remove "lo" (loopback) from the device listing
+      // Remove "lo" (loopback) from the device listing.
       {
         f_array_length_t i = 0;
 
         for (; i < main->devices.used; ++i) {
 
-          if (fl_string_compare((f_string_t) firewall_device_loop_s, main->devices.array[i].string, firewall_device_loop_s_length + 1, main->devices.array[i].used) == F_equal_to) {
-            f_string_dynamic_t swap_string = main->devices.array[i];
+          if (fl_string_dynamic_compare(firewall_device_loop_s, main->devices.array[i]) == F_equal_to) {
+            f_string_static_t swap_string = main->devices.array[i];
 
             --main->devices.used;
 
             for (; i < main->devices.used; ++i) {
-              main->devices.array[i] = main->devices.array[i+1];
+              main->devices.array[i] = main->devices.array[i + 1];
             } // for
 
             main->devices.array[main->devices.used] = swap_string;
@@ -438,42 +403,46 @@ extern "C" {
       }
 
       if (command == firewall_parameter_command_stop_e || command == firewall_parameter_command_restart_e || command == firewall_parameter_command_lock_e) {
-        status = firewall_buffer_rules(main, network_path_s firewall_file_other_s, F_false, &local);
+        f_string_static_t path_file_other = f_string_static_t_initialize;
+        path_file_other.used = firewall_network_path_s.used + firewall_file_other_s.used;
 
-        if (F_status_is_error(status)) {
+        char path_file_other_string[path_file_other.used + 1];
+        path_file_other.string = path_file_other_string;
+        path_file_other[path_file_other.used] = 0;
+
+        memcpy(path_file_other_string, firewall_network_path_s.string, firewall_network_path_s.used);
+        memcpy(path_file_other_string + firewall_network_path_s.used, firewall_file_other_s.string, firewall_file_other_s.used);
+
+        status = firewall_buffer_rules(main, path_file_other, F_false, &local);
+
+        if (F_status_is_error(status) || status == F_child) {
           firewall_delete_local_data(&local);
           firewall_main_delete(main);
 
           return status;
         }
 
-        {
-          f_array_length_t i = 0;
-          f_array_length_t length = 0;
-
-          for (; i < local.chain_objects.used; ++i) {
-            length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1;
+        for (f_array_length_t i = 0; i < local.chain_objects.used; ++i) {
 
-            if (!reserved.has_stop && fl_string_compare((f_string_t) firewall_group_stop_s, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_s_length, length) == F_equal_to) {
-              reserved.stop_at = i;
-              reserved.has_stop = F_true;
-            }
-            else if (!reserved.has_lock && fl_string_compare((f_string_t) firewall_group_lock_s, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_s_length, length) == F_equal_to) {
-              reserved.lock_at = i;
-              reserved.has_lock = F_true;
-            }
-          } // for
-        }
+          if (!reserved.has_stop && fl_string_dynamic_partial_compare_string(firewall_group_stop_s.string, local.buffer, firewall_group_stop_s.used, local.chain_objects.array[i]) == F_equal_to) {
+            reserved.stop_at = i;
+            reserved.has_stop = F_true;
+          }
+          else if (!reserved.has_lock && fl_string_dynamic_partial_compare_string(firewall_group_lock_s.string, local.buffer, firewall_group_lock_s.used, local.chain_objects.array[i]) == F_equal_to) {
+            reserved.lock_at = i;
+            reserved.has_lock = F_true;
+          }
+        } // for
 
         if (command == firewall_parameter_command_lock_e) {
           if (reserved.has_lock) {
             status = firewall_delete_chains(main);
 
-            if (F_status_is_error_not(status)) {
+            if (F_status_is_error_not(status) && status != F_child) {
               status = firewall_default_lock(main);
             }
 
-            if (F_status_is_error(status)) {
+            if (F_status_is_error(status) || status == F_child) {
               firewall_delete_local_data(&local);
               firewall_main_delete(main);
 
@@ -495,27 +464,26 @@ extern "C" {
 
             return status;
           }
-          else {
-            if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_print_format("%r%[%QFailed to perform lock request because the lock instructions are missing from: %s.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
-            }
 
-            firewall_delete_local_data(&local);
-            firewall_main_delete(main);
-
-            return F_status_set_error(F_data);
+          if (main->error.verbosity != f_console_verbosity_quiet_e) {
+            fll_print_format("%r%[%QFailed to perform lock request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
           }
+
+          firewall_delete_local_data(&local);
+          firewall_main_delete(main);
+
+          return F_status_set_error(F_data);
         }
 
         if (command == firewall_parameter_command_stop_e || command == firewall_parameter_command_restart_e) {
           if (reserved.has_stop) {
             status = firewall_delete_chains(main);
 
-            if (F_status_is_error_not(status)) {
+            if (F_status_is_error_not(status) && status != F_child) {
               status = firewall_default_lock(main);
             }
 
-            if (F_status_is_error(status)) {
+            if (F_status_is_error(status) || status == F_child) {
               firewall_delete_local_data(&local);
               firewall_main_delete(main);
 
@@ -533,7 +501,7 @@ extern "C" {
 
             status = firewall_process_rules(main, &input, &local);
 
-            if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+            if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
               firewall_delete_local_data(&local);
               firewall_main_delete(main);
 
@@ -542,7 +510,7 @@ extern "C" {
           }
           else {
             if (main->error.verbosity != f_console_verbosity_quiet_e) {
-              fll_print_format("%r%[%QFailed to perform stop request because the lock instructions are missing from: %s.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, network_path_s firewall_file_other_s, main->error.context, f_string_eol_s);
+              fll_print_format("%r%[%QFailed to perform stop request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
             }
 
             firewall_delete_local_data(&local);
@@ -556,9 +524,19 @@ extern "C" {
       }
 
       if (command == firewall_parameter_command_start_e || command == firewall_parameter_command_restart_e) {
-        status = firewall_buffer_rules(main, network_path_s firewall_file_first_s, F_false, &local);
+        f_string_static_t path_file_first = f_string_static_t_initialize;
+        path_file_first.used = firewall_network_path_s.used + firewall_file_first_s.used;
 
-        if (F_status_is_error(status)) {
+        char path_file_first_string[path_file_first.used + 1];
+        path_file_first.string = path_file_first_string;
+        path_file_first[path_file_first.used] = 0;
+
+        memcpy(path_file_first_string, firewall_network_path_s.string, firewall_network_path_s.used);
+        memcpy(path_file_first_string + firewall_network_path_s.used, firewall_file_first_s.string, firewall_file_first_s.used);
+
+        status = firewall_buffer_rules(main, path_file_first, F_false, &local);
+
+        if (F_status_is_error(status) || status == F_child) {
           firewall_delete_local_data(&local);
           firewall_main_delete(main);
 
@@ -568,11 +546,11 @@ extern "C" {
         if (command == firewall_parameter_command_start_e) {
           status = firewall_delete_chains(main);
 
-          if (F_status_is_error_not(status)) {
+          if (F_status_is_error_not(status) && status != F_child) {
             status = firewall_default_lock(main);
           }
 
-          if (F_status_is_error(status)) {
+          if (F_status_is_error(status) || status == F_child) {
             firewall_delete_local_data(&local);
             firewall_main_delete(main);
 
@@ -582,7 +560,7 @@ extern "C" {
 
         status = firewall_create_custom_chains(main, &reserved, &local);
 
-        if (F_status_is_error(status)) {
+        if (F_status_is_error(status) || status == F_child) {
           firewall_delete_local_data(&local);
           firewall_main_delete(main);
 
@@ -605,7 +583,7 @@ extern "C" {
 
           status = firewall_process_rules(main, &input, &local);
 
-          if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+          if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
             firewall_delete_local_data(&local);
             firewall_main_delete(main);
 
@@ -617,13 +595,32 @@ extern "C" {
 
         firewall_delete_local_data(&local);
 
-        for (i = 0; i < main->devices.used; ++i) {
-          local.device = i;
+        {
+          f_string_dynamic_t file_path = f_string_dynamic_t_initialize;
+          f_array_length_t j = 0;
+
+          for (i = 0; i < main->devices.used; ++i) {
+
+            file_path.used = 0;
+            local.device = i;
+
+            status = f_string_dynamic_increase_by(firewall_network_path_s.used + main->devices.array[i].used + firewall_file_suffix_s_length + 1, &file_path);
+
+            if (F_status_is_error_not(status)) {
+              status = f_string_dynamic_append(firewall_network_path_s, &file_path);
+            }
+
+            if (F_status_is_error_not(status)) {
+              status = f_string_dynamic_append(main->devices.array[i], &file_path);
+            }
 
-          {
-            f_string_dynamic_t file_path = f_string_dynamic_t_initialize;
+            if (F_status_is_error_not(status)) {
+              status = f_string_dynamic_append(firewall_file_suffix_s, &file_path);
+            }
 
-            macro_f_string_dynamic_t_resize(status, file_path, network_path_s_length + main->devices.array[i].used + firewall_file_suffix_s_length + 1);
+            if (F_status_is_error_not(status)) {
+              status = f_string_dynamic_terminate_after(&file_path);
+            }
 
             if (F_status_is_error(status)) {
               firewall_print_error_on_allocation_failure(main->error);
@@ -634,72 +631,76 @@ extern "C" {
               return status;
             }
 
-            memcpy((void *)file_path.string, network_path_s, network_path_s_length);
-            memcpy((void *)(file_path.string + network_path_s_length), main->devices.array[i].string, main->devices.array[i].used);
-            memcpy((void *)(file_path.string + network_path_s_length + main->devices.array[i].used), firewall_file_suffix_s, firewall_file_suffix_s_length);
-
-            file_path.used = network_path_s_length + main->devices.array[i].used + firewall_file_suffix_s_length;
-            file_path.string[file_path.used] = 0;
+            status = firewall_buffer_rules(main, file_path, F_true, &local);
 
-            status = firewall_buffer_rules(main, file_path.string, F_true, &local);
-
-            f_string_dynamic_resize(0, &file_path);
-          }
+            if (status == F_child) {
+              firewall_delete_local_data(&local);
 
-          if (F_status_is_error(status)) {
-            status = F_status_set_fine(status);
+              f_string_dynamic_resize(0, &file_path);
 
-            firewall_delete_local_data(&local);
+              firewall_main_delete(main);
 
-            if (status == F_file_found_not || status == F_file_open || status == F_file_descriptor || status == F_fss_found_object_content_not) {
-              status = F_status_set_error(status);
-              continue;
+              return status;
             }
 
-            firewall_main_delete(main);
-
-            return F_status_set_error(status);
-          }
-
-          status = firewall_create_custom_chains(main, &reserved, &local);
-
-          if (F_status_is_error(status)) {
-            firewall_delete_local_data(&local);
-            firewall_main_delete(main);
+            if (F_status_is_error(status)) {
+              status = F_status_set_fine(status);
 
-            return status;
-          }
+              firewall_delete_local_data(&local);
 
-          f_array_length_t j = 0;
+              if (status == F_file_found_not || status == F_file_open || status == F_file_descriptor || status == F_fss_found_object_content_not) {
+                status = F_status_set_error(status);
 
-          local.is_global = F_false;
-          local.is_stop = F_false;
-          local.is_lock = F_false;
+                continue;
+              }
 
-          for (; j < local.chain_contents.used; ++j) {
+              f_string_dynamic_resize(0, &file_path);
 
-            input.start = local.chain_contents.array[j].array[0].start;
-            input.stop = local.chain_contents.array[j].array[0].stop;
+              firewall_main_delete(main);
 
-            local.is_main = reserved.has_main && j == reserved.main_at ? F_true : F_false;
-            local.chain = j;
+              return F_status_set_error(status);
+            }
 
-            status = firewall_process_rules(main, &input, &local);
+            status = firewall_create_custom_chains(main, &reserved, &local);
 
-            if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+            if (F_status_is_error(status) || status == F_child) {
               firewall_delete_local_data(&local);
               firewall_main_delete(main);
 
               return status;
             }
+
+            local.is_global = F_false;
+            local.is_stop = F_false;
+            local.is_lock = F_false;
+
+            for (j = 0; j < local.chain_contents.used; ++j) {
+
+              input.start = local.chain_contents.array[j].array[0].start;
+              input.stop = local.chain_contents.array[j].array[0].stop;
+
+              local.is_main = reserved.has_main && j == reserved.main_at ? F_true : F_false;
+              local.chain = j;
+
+              status = firewall_process_rules(main, &input, &local);
+
+              if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
+                firewall_delete_local_data(&local);
+                firewall_main_delete(main);
+
+                return status;
+              }
+            } // for
+
+            firewall_delete_local_data(&local);
           } // for
 
-          firewall_delete_local_data(&local);
-        } // for
+          f_string_dynamic_resize(0, &file_path);
+        }
 
         status = firewall_buffer_rules(main, network_path_s firewall_file_last_s, F_false, &local);
 
-        if (F_status_is_error(status)) {
+        if (F_status_is_error(status) || status == F_child) {
           firewall_delete_local_data(&local);
           firewall_main_delete(main);
 
@@ -708,7 +709,7 @@ extern "C" {
 
         status = firewall_create_custom_chains(main, &reserved, &local);
 
-        if (F_status_is_error(status)) {
+        if (F_status_is_error(status) || status == F_child) {
           f_status_t status2 = F_none;
 
           macro_firewall_delete_fss_buffers(status2, local.buffer, local.chain_objects, local.chain_contents)
@@ -733,7 +734,7 @@ extern "C" {
 
           status = firewall_process_rules(main, &input, &local);
 
-          if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+          if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
             firewall_delete_local_data(&local);
             firewall_main_delete(main);
 
@@ -744,12 +745,11 @@ extern "C" {
         } // while
       }
 
-      // cleanup
       firewall_delete_local_data(&local);
     }
     else {
       if (main->error.verbosity != f_console_verbosity_quiet_e) {
-        fll_print_format("%r%[%QYou did not pass a command.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QNo command given.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
       }
 
       status = F_status_set_error(F_parameter);
@@ -769,21 +769,6 @@ extern "C" {
   }
 #endif // _di_firewall_main_
 
-#ifndef _di_firewall_main_delete_
-  f_status_t firewall_main_delete(firewall_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_string_dynamics_resize(0, &main->chains);
-    f_type_array_lengths_resize(0, &main->remaining);
-    f_string_dynamics_resize(0, &main->devices);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_firewall_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ef58c8c58f3bcf58a1e6ee80c2fbe82b00fe85df..ea5279c3c71c4f6cde3e7d1dae04b82d5cab4247 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// Firewall includes.
+#include <program/firewall/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_firewall_program_version_
-  #define FIREWALL_program_version_major_s F_string_ascii_0_s
-  #define FIREWALL_program_version_minor_s F_string_ascii_5_s
-  #define FIREWALL_program_version_micro_s F_string_ascii_8_s
-
-  #define FIREWALL_program_version_major_s_length F_string_ascii_0_s_length
-  #define FIREWALL_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FIREWALL_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
-    #define FIREWALL_program_version_nano_prefix_s
-    #define FIREWALL_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FIREWALL_program_version_nano_prefix_s) && defined(FIREWALL_program_version_nano_prefix_s_length))
-
-  #if !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
-    #define FIREWALL_program_version_nano_s
-    #define FIREWALL_program_version_nano_s_length 0
-  #endif // !(defined(FIREWALL_program_version_nano_s) && defined(FIREWALL_program_version_nano_s_length))
-
-  #define FIREWALL_version_s FIREWALL_program_version_major_s F_string_ascii_period_s FIREWALL_program_version_minor_s F_string_ascii_period_s FIREWALL_program_version_micro_s FIREWALL_program_version_nano_prefix_s FIREWALL_program_version_nano_s
-
-  #define FIREWALL_version_s_length FIREWALL_program_version_major_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_minor_s_length + F_string_ascii_period_s_length + FIREWALL_program_version_micro_s_length + FIREWALL_program_version_nano_prefix_s_length + FIREWALL_program_version_nano_s_length
-
-  extern const f_string_static_t firewall_program_version_s;
-#endif // _di_firewall_program_version_
-
-#ifndef _di_firewall_program_name_
-  #define FIREWALL_program_name_s      "firewall"
-  #define FIREWALL_program_name_long_s "Kevux Firewall Manager"
-
-  #define FIREWALL_program_name_s_length      8
-  #define FIREWALL_program_name_long_s_length 22
-
-  extern const f_string_static_t firewall_program_name_s;
-  extern const f_string_static_t firewall_program_name_long_s;
-#endif // _di_firewall_program_name_
-
-#ifndef _di_firewall_paths_
-  #define network_path_s          "/etc/network/" // TODO: this should be moved to a network project library, possibly the Paths project in fot the network project
-  #define network_devices_s       "/sys/class/net/" // TODO: this should also be moved to a network project library
-  #define firewall_file_first_s   "firewall-first"
-  #define firewall_file_last_s    "firewall-last"
-  #define firewall_file_other_s   "firewall-other"
-  #define firewall_file_suffix_s  "-firewall"
-
-  #define network_path_s_length          13
-  #define network_devices_s_length       15
-  #define firewall_file_first_s_length   14
-  #define firewall_file_last_s_length    13
-  #define firewall_file_other_s_length   14
-  #define firewall_file_suffix_s_length  9
-#endif // _di_firewall_paths_
-
-#ifndef _di_firewall_default_allocation_step_
-  #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
-#endif // _di_firewall_default_allocation_step_
-
-#ifndef _di_firewall_defines_
-  #define firewall_signal_check_d 10000
-
-  #define firewall_tool_s            "tool"
-  #define firewall_tool_iptables_s   "iptables"
-  #define firewall_tool_ip6tables_s  "ip6tables"
-  #define firewall_tool_ip46tables_s "ip46tables"
-  #define firewall_tool_ipset_s      "ipset"
-
-  #define firewall_tool_s_length            4
-  #define firewall_tool_iptables_s_length   8
-  #define firewall_tool_ip6tables_s_length  9
-  #define firewall_tool_ip46tables_s_length 10
-  #define firewall_tool_ipset_s_length      5
-
-  #define firewall_group_stop_s "stop"
-  #define firewall_group_lock_s "lock"
-  #define firewall_group_main_s "main"
-
-  #define firewall_group_stop_s_length  4
-  #define firewall_group_lock_s_length  4
-  #define firewall_group_main_s_length  4
-
-  #define firewall_command_start_s   "start"
-  #define firewall_command_stop_s    "stop"
-  #define firewall_command_restart_s "restart"
-  #define firewall_command_lock_s    "lock"
-  #define firewall_command_show_s    "show"
-
-  #define firewall_command_start_s_length   5
-  #define firewall_command_stop_s_length    4
-  #define firewall_command_restart_s_length 7
-  #define firewall_command_lock_s_length    4
-  #define firewall_command_show_s_length    4
-
-  #define firewall_ip_list                    "ip_list"
-  #define firewall_ip_list_source_s             "source"
-  #define firewall_ip_list_source_action_s      "-s"
-  #define firewall_ip_list_destination_s        "destination"
-  #define firewall_ip_list_destination_action_s "-d"
-
-  #define firewall_ip_list_length_s                    7
-  #define firewall_ip_list_source_s_length             6
-  #define firewall_ip_list_source_action_s_length      2
-  #define firewall_ip_list_destination_s_length        11
-  #define firewall_ip_list_destination_action_s_length 2
-
-  #define firewall_rule_s        "rule"
-  #define firewall_rule_s_length 4
-
-  #define firewall_chain_s             "chain"
-  #define firewall_chain_forward_s     "FORWARD"
-  #define firewall_chain_input_s       "INPUT"
-  #define firewall_chain_none_s        "none"
-  #define firewall_chain_output_s      "OUTPUT"
-  #define firewall_chain_postrouting_s "POSTROUTING"
-  #define firewall_chain_prerouting_s  "PREROUTING"
-
-  #define firewall_chain_s_length             5
-  #define firewall_chain_forward_s_length     7
-  #define firewall_chain_input_s_length       5
-  #define firewall_chain_none_s_length        4
-  #define firewall_chain_output_s_length      6
-  #define firewall_chain_postrouting_s_length 12
-  #define firewall_chain_prerouting_s_length  11
-
-  #define firewall_direction_s        "direction"
-  #define firewall_direction_input_s  "input"
-  #define firewall_direction_output_s "output"
-  #define firewall_direction_none_s   "none"
-
-  #define firewall_direction_s_length        9
-  #define firewall_direction_input_s_length  5
-  #define firewall_direction_output_s_length 6
-  #define firewall_direction_none_s_length   4
-
-  #define firewall_action_s        "action"
-  #define firewall_action_append_s "append"
-  #define firewall_action_insert_s "insert"
-  #define firewall_action_policy_s "policy"
-  #define firewall_action_none_s   "none"
-
-  #define firewall_action_length_s        6
-  #define firewall_action_append_s_length 6
-  #define firewall_action_insert_s_length 6
-  #define firewall_action_policy_s_length 6
-  #define firewall_action_none_s_length   4
-
-  #define firewall_action_append_command_s "-A"
-  #define firewall_action_insert_command_s "-I"
-  #define firewall_action_policy_command_s "-P"
-
-  #define firewall_action_append_command_s_length 2
-  #define firewall_action_insert_command_s_length 2
-  #define firewall_action_policy_command_s_length 2
-
-  #define firewall_device_s      "device"
-  #define firewall_device_all_s  "all"
-  #define firewall_device_this_s "this"
-  #define firewall_device_loop_s "lo"
-
-  #define firewall_device_s_length      6
-  #define firewall_device_all_s_length  3
-  #define firewall_device_this_s_length 4
-  #define firewall_device_loop_s_length 2
-
-  #define firewall_device_input_command_s  "-i"
-  #define firewall_device_output_command_s "-o"
-
-  #define firewall_device_input_command_length_s  2
-  #define firewall_device_output_command_length_s 2
-
-  #define firewall_protocol_s      "protocol"
-  #define firewall_protocol_none_s "none"
-
-  #define firewall_protocol_s_length      8
-  #define firewall_protocol_none_s_length 4
-
-  #define firewall_protocol_command_s        "-p"
-  #define firewall_protocol_command_s_length 2
-
-  #define firewall_chain_create_command_s "-N"
-  #define firewall_chain_delete_command_s "-X"
-
-  #define firewall_chain_create_command_s_length 2
-  #define firewall_chain_delete_command_s_length 2
-
-  enum {
-    firewall_program_none_e = 1,
-    firewall_program_iptables_e,
-    firewall_program_ip6tables_e,
-    firewall_program_ip46tables_e,
-    firewall_program_ipset_e,
-  };
-
-  enum {
-    firewall_parameter_help_e,
-    firewall_parameter_light_e,
-    firewall_parameter_dark_e,
-    firewall_parameter_no_color_e,
-    firewall_parameter_verbosity_quiet_e,
-    firewall_parameter_verbosity_normal_e,
-    firewall_parameter_verbosity_verbose_e,
-    firewall_parameter_verbosity_debug_e,
-    firewall_parameter_version_e,
-
-    firewall_parameter_command_start_e,
-    firewall_parameter_command_stop_e,
-    firewall_parameter_command_restart_e,
-    firewall_parameter_command_lock_e,
-    firewall_parameter_command_show_e,
-
-    firewall_direction_input_id_e,
-    firewall_direction_output_id_e,
-    firewall_direction_none_id_e,
-
-    firewall_chain_forward_id_e,
-    firewall_chain_custom_id_e,
-    firewall_chain_input_id_e,
-    firewall_chain_none_id_e,
-    firewall_chain_output_id_e,
-    firewall_chain_postrouting_id_e,
-    firewall_chain_prerouting_id_e,
-
-    firewall_action_append_id_e,
-    firewall_action_insert_id_e,
-    firewall_action_policy_id_e,
-    firewall_action_none_id_e,
-  };
-
-  #define firewall_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(0, 0, firewall_command_start_s, F_false, f_console_type_other_e), \
-      macro_f_console_parameter_t_initialize(0, 0, firewall_command_stop_s, F_false, f_console_type_other_e), \
-      macro_f_console_parameter_t_initialize(0, 0, firewall_command_restart_s, F_false, f_console_type_other_e), \
-      macro_f_console_parameter_t_initialize(0, 0, firewall_command_lock_s, F_false, f_console_type_other_e), \
-      macro_f_console_parameter_t_initialize(0, 0, firewall_command_show_s, F_false, f_console_type_other_e), \
-    }
-
-  #define firewall_total_parameters_d 14
-#endif // _di_firewall_defines_
-
-#ifndef _di_firewall_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_dynamics_t chains;
-    f_string_dynamics_t devices;
-
-    f_color_context_t context;
-  } firewall_main_t;
-
-  #define firewall_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_dynamics_t_initialize, \
-      f_string_dynamics_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_firewall_main_t_
-
 /**
  * Print help.
  *
@@ -380,25 +101,6 @@ extern "C" {
   extern f_status_t firewall_main(firewall_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_firewall_main_
 
-/**
- * De-allocate data.
- *
- * Be sure to call this after executing firewall_main().
- *
- * @param data
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see firewall_main()
- */
-#ifndef _di_firewall_main_delete_
-  extern f_status_t firewall_main_delete(firewall_main_t * const data);
-#endif // _di_firewall_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 464a12819bfa72d76ab239b4eeef333ae4bce30e..66f7f8d7a8a18785b651c4aa7dd70986cb6f955a 100644 (file)
@@ -15,6 +15,10 @@ int main(const int argc, const f_string_t *argv) {
 
   fll_program_standard_setdown(&data.signal);
 
+  if (status == F_child) {
+    exit(data.child);
+  }
+
   if (F_status_is_error(status)) return 1;
 
   return 0;
index efd7280a5c3ada308e4c2e8a99d0cd4f50dc938e..33830652518d0a2002906fe0c74c4f3e23197439 100644 (file)
@@ -5,13 +5,13 @@
 extern "C" {
 #endif
 
-void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) {
+void firewall_print_debug_tool(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) {
 
   if (output.verbosity != f_console_verbosity_debug_e) return;
 
   flockfile(output.to.stream);
 
-  fl_print_format("%[%s", output.to.stream, output.context, tool);
+  fl_print_format("%[%r", output.to.stream, output.context, tool);
 
   for (f_array_length_t i = 0; i < arguments.used; ++i) {
     fl_print_format(" %Q", output.to.stream, arguments.array[i]);
@@ -26,31 +26,31 @@ void firewall_print_error_on_allocation_failure(const fl_print_t output) {
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
-  fll_print_format("%r%[%sUnable to allocate memory.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, output.context, f_string_eol_s);
+  fll_print_format("%r%[%QUnable to allocate memory.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, output.context, f_string_eol_s);
 }
 
 void firewall_print_error_on_invalid_parameter(const fl_print_t output, const f_string_t function) {
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
-  fll_print_format("%r%[%sInvalid parameter when calling %S().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, output.context, f_string_eol_s);
+  fll_print_format("%r%[%QInvalid parameter when calling %s().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, output.context, f_string_eol_s);
 }
 
-void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) {
+void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_static_t filename) {
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
-  fll_print_format("%r%[%sInvalid parameter when calling %S() for the file '%S'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, filename, output.context, f_string_eol_s);
+  fll_print_format("%r%[%QInvalid parameter when calling %s() for the file '%Q'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, filename, output.context, f_string_eol_s);
 }
 
-void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) {
+void firewall_print_error_on_operation(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) {
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
   flockfile(output.to.stream);
 
-  fl_print_format("%r%[%sFailed to perform requested %s operation:%]", output.to.stream, f_string_eol_s, output.context, output.prefix, tool, output.context);
-  fl_print_format("%r  %[%s", output.to.stream, f_string_eol_s, output.context, tool);
+  fl_print_format("%r%[%QFailed to perform requested %r operation:%]", output.to.stream, f_string_eol_s, output.context, output.prefix, tool, output.context);
+  fl_print_format("%r  %[%r", output.to.stream, f_string_eol_s, output.context, tool);
 
   for (f_array_length_t i = 0; i < arguments.used; ++i) {
     fl_print_format(" %Q", output.to.stream, arguments.array[i]);
@@ -65,14 +65,14 @@ void firewall_print_error_on_unhandled(const fl_print_t output, const f_string_t
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
-  fll_print_format("%r%[%sAn unhandled error (%ui) has occurred while calling %S().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, output.context, f_string_eol_s);
+  fll_print_format("%r%[%QAn unhandled error (%ui) has occurred while calling %s().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, output.context, f_string_eol_s);
 }
 
-void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) {
+void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_static_t filename) {
 
   if (output.verbosity == f_console_verbosity_quiet_e) return;
 
-  fll_print_format("%r%[%sAn unhandled error (%ui) has occurred while calling %S() for the file '%S'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, filename, output.context, f_string_eol_s);
+  fll_print_format("%r%[%QAn unhandled error (%ui) has occurred while calling %s() for the file '%Q'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, filename, output.context, f_string_eol_s);
 }
 
 #ifndef _di_firewall_print_signal_received_
index 677f75744f70e1cc71614d38562e4cb1e21b55c9..2503bf893f6d7f4f7ff64bd65e610a88551734c7 100644 (file)
@@ -108,7 +108,7 @@ typedef struct {
  * @param arguments
  *   The arguments passed to the tool.
  */
-extern void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) F_attribute_visibility_internal_d;
+extern void firewall_print_debug_tool(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) F_attribute_visibility_internal_d;
 
 /**
  * Print an memory allocation error.
@@ -138,7 +138,7 @@ extern void firewall_print_error_on_invalid_parameter(const fl_print_t output, c
  * @param filename
  *   The name of the file.
  */
-extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_static_t filename) F_attribute_visibility_internal_d;
 
 /**
  * Print an error about the given operation failed.
@@ -150,7 +150,7 @@ extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t
  * @param arguments
  *   The arguments passed to the tool.
  */
-extern void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_operation(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) F_attribute_visibility_internal_d;
 
 /**
  * Print an unhandled error for the given function.
@@ -176,7 +176,7 @@ extern void firewall_print_error_on_unhandled(const fl_print_t output, const f_s
  * @param filename
  *   The name of the file.
  */
-extern void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_static_t filename) F_attribute_visibility_internal_d;
 
 /**
  * Print a message about a process signal being recieved, such as an interrupt signal.
index 137492253a8ecfbc268b5ecc3e2df6a11ddf5cf5..e9ede711e2389f3823045522b3c927327a25062e 100644 (file)
@@ -20,7 +20,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
   bool is_ip_list = F_false;
   f_string_dynamic_t ip_list = f_string_dynamic_t_initialize;
 
-  // iptables command arguments
+  // Iptables command arguments
   bool device_all = F_false;
   bool ip_list_direction = F_false; // false = source, true = destination
   bool use_protocol = F_false;
@@ -56,7 +56,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
     }
   }
 
-  // for custom chains, the chain command may not be specified.
+  // For custom chains, the chain command may not be specified.
   if (!(local.is_main || local.is_stop || local.is_lock)) {
     chain = firewall_chain_custom_id_e;
   }
@@ -85,12 +85,13 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
     f_string_dynamic_resize(0, &ip_list);
 
-    // process chain rule
+    // Process chain rule
     if (length >= firewall_chain_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_chain_s, length, firewall_chain_s_length) == F_equal_to) {
       if (chain == firewall_chain_custom_id_e) {
 
-        // custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain.
+        // Custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain.
         fll_print_format("%r%[%QAt line %ul, the chain option is meaningless inside of a custom chain.%]%r", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
+
         continue;
       }
 
@@ -123,7 +124,8 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
       if (!invalid) continue;
     }
-    // process direction rule
+
+    // Process direction rule
     else if (length >= firewall_direction_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_direction_s, length, firewall_direction_s_length) == F_equal_to) {
       length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
 
@@ -140,13 +142,15 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         direction = firewall_direction_none_id_e;
       }
       else {
-        // direction must be specified, and no custom directions are allowed.
+
+        // Direction must be specified, and no custom directions are allowed.
         invalid = F_true;
       }
 
       if (!invalid) continue;
     }
-    // process device rule.
+
+    // Process device rule.
     else if (length >= firewall_device_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_device_s, length, firewall_device_s_length) == F_equal_to) {
       length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
 
@@ -200,7 +204,8 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         continue;
       }
     }
-    // process action rule.
+
+    // Process action rule.
     else if (length >= firewall_action_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_action_s, length, firewall_action_length_s) == F_equal_to) {
       length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
 
@@ -225,7 +230,8 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
       if (!invalid) continue;
     }
-    // process ip_list rule.
+
+    // Process ip_list rule.
     else if (length >= firewall_ip_list_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_ip_list, length, firewall_ip_list_length_s) == F_equal_to) {
       length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
       is_ip_list = F_true;
@@ -266,7 +272,8 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         continue;
       }
     }
-    // process tool rule.
+
+    // Process tool rule.
     else if (length >= firewall_tool_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_tool_s, length, firewall_tool_s_length) == F_equal_to) {
       length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
 
@@ -299,7 +306,8 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         if (!invalid) continue;
       }
     }
-    // process rule rule, if the remaining rule does not match as firewall_rule_s, then it is an invalid rule.
+
+    // Process rule rule, if the remaining rule does not match as firewall_rule_s, then it is an invalid rule.
     else if (length < firewall_rule_s_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_rule_s, length, firewall_rule_s_length) == F_equal_to_not) {
       if (length) {
         flockfile(main->warning.to.stream);
@@ -340,7 +348,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
     for (r = repeat; r > 0; --r) {
 
-      // first add the program name
+      // First add the program name
       f_string_dynamics_resize(0, &arguments);
 
       status = f_string_dynamics_increase(F_memory_default_allocation_small_d, &arguments);
@@ -361,7 +369,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
       if (F_status_is_error(status)) break;
 
-      // process the action when a non-none chain is specified.
+      // Process the action when a non-none chain is specified.
       if (chain != firewall_chain_none_id_e && action != firewall_action_none_id_e) {
         if (action == firewall_action_append_id_e) {
            macro_f_string_dynamic_t_resize(status, argument, firewall_action_append_command_s_length);
@@ -396,7 +404,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
             break;
           }
 
-          // process the chain, which is required by the action.
+          // Process the chain, which is required by the action.
           if (chain == firewall_chain_custom_id_e) {
             if (main->chains.array[local.chain_ids.array[local.chain]].used > 0) {
                macro_f_string_dynamic_t_resize(status, argument, main->chains.array[local.chain_ids.array[local.chain]].used);
@@ -457,7 +465,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         }
       }
 
-      // add the device if and only if a non-none direction is specified.
+      // Add the device if and only if a non-none direction is specified.
       if (device.used > 0 && (direction == firewall_direction_input_id_e || direction == firewall_direction_output_id_e)) {
         if (length < firewall_device_all_s_length || fl_string_compare(local.buffer.string + local.rule_contents.array[i].array[0].start, (f_string_t) firewall_device_all_s, length, firewall_device_all_s_length) == F_equal_to_not) {
           if (direction == firewall_direction_input_id_e) {
@@ -483,7 +491,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
           }
         }
 
-        // add the device.
+        // Add the device.
         if (device.used > 0) {
            macro_f_string_dynamic_t_resize(status, argument, device.used);
 
@@ -527,13 +535,13 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         }
       }
 
-      // last up is the "rule"
+      // Last up is the "rule"
       if ((!is_ip_list && local.rule_contents.array[i].used > 0) || (is_ip_list && local.rule_contents.array[i].used > 1)) {
         f_array_length_t subcounter = 0;
 
         if (is_ip_list) {
 
-          // skip past the chain
+          // Skip past the chain
           ++subcounter;
 
           length = macro_firewall_structure_size(local.rule_contents.array[i], subcounter);
@@ -542,7 +550,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
              macro_f_string_dynamic_t_resize(status, ip_list, length);
 
             if (F_status_is_error(status)) {
-              // prevent the loop below from being processed.
+              // Prevent the loop below from being processed.
               subcounter = local.rule_contents.array[i].used;
             }
             else {
@@ -587,7 +595,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
         break;
       }
 
-      // now execute the generated commands.
+      // Now execute the generated commands.
       if (arguments.used > 1) {
         if (is_ip_list) {
           f_file_t file = f_file_t_initialize;
@@ -618,7 +626,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
             }
             else if (status == F_file_found_not) {
 
-              // the file does not have to exist
+              // The file does not have to exist
               if (main->error.verbosity != f_console_verbosity_verbose_e || main->error.verbosity == f_console_verbosity_debug_e) {
                 fll_print_format("%r%[%QCannot find the file '%Q'.%]%r", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, file_path, main->warning.context, f_string_eol_s);
               }
@@ -699,7 +707,7 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
                   firewall_print_error_on_invalid_parameter_for_file(main->error, "fll_fss_basic_read", file_path.used ? file_path.string : "");
                 }
                 else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
-                  // empty files are to be silently ignored
+                  // Empty files are to be silently ignored
                 }
                 else if (status == F_memory_not) {
                   firewall_print_error_on_allocation_failure(main->error);
@@ -784,7 +792,6 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
                     status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code);
 
-                    // Immediately exit child process, @todo this may require additional memory deallocation and relating changes.
                     if (status == F_child) {
                       f_string_dynamic_resize(0, &ip_list);
                       f_string_dynamic_resize(0, &argument);
@@ -792,7 +799,9 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
                       f_string_dynamic_resize(0, &device);
                       f_string_dynamic_resize(0, &protocol);
 
-                      exit(return_code);
+                      main->child = return_code;
+
+                      return status;
                     }
 
                     if (F_status_is_error(status)) {
@@ -839,7 +848,6 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
 
           status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code);
 
-          // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
           if (status == F_child) {
             f_string_dynamic_resize(0, &ip_list);
             f_string_dynamic_resize(0, &argument);
@@ -847,7 +855,9 @@ f_status_t firewall_perform_commands(firewall_main_t * const main, const firewal
             f_string_dynamic_resize(0, &device);
             f_string_dynamic_resize(0, &protocol);
 
-            exit(return_code);
+            main->child = return_code;
+
+            return status;
           }
 
           if (F_status_is_error(status)) {
@@ -946,7 +956,7 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
       }
     }
 
-    // skip globally reserved chain name: main
+    // Skip globally reserved chain name: main
     range.start = 0;
     range.stop = firewall_group_main_s_length - 1;
     fixed_string.string = firewall_group_main_s;
@@ -957,7 +967,7 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
       reserved->main_at = i;
     }
 
-    // skip globally reserved chain name: stop
+    // Skip globally reserved chain name: stop
     range.start = 0;
     range.stop = firewall_group_stop_s_length - 1;
     fixed_string.string = firewall_group_stop_s;
@@ -968,7 +978,7 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
       reserved->stop_at = i;
     }
 
-    // skip globally reserved chain name: lock
+    // Skip globally reserved chain name: lock
     range.start = 0;
     range.stop = firewall_group_lock_s_length - 1;
     fixed_string.string = firewall_group_lock_s;
@@ -979,7 +989,7 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
       reserved->lock_at = i;
     }
 
-    // skip globally reserved chain name: none
+    // Skip globally reserved chain name: none
     range.start = 0;
     range.stop = firewall_group_lock_s_length - 1;
     fixed_string.string = firewall_chain_none_s;
@@ -1082,11 +1092,12 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
         tool = firewall_program_iptables_e;
         status = fll_execute_program(firewall_tool_iptables_s, arguments, 0, 0, (void *) &return_code);
 
-        // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
         if (status == F_child) {
           f_string_dynamics_resize(0, &arguments);
 
-          exit(return_code);
+          main->child = return_code;
+
+          return status;
         }
 
         if (F_status_is_error_not(status)) {
@@ -1103,11 +1114,12 @@ f_status_t firewall_create_custom_chains(firewall_main_t * const main, firewall_
           tool = firewall_program_ip6tables_e;
           status = fll_execute_program((f_string_t) firewall_tool_ip6tables_s, arguments, 0, 0, (void *) &return_code);
 
-          // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
           if (status == F_child) {
             f_string_dynamics_resize(0, &arguments);
 
-            exit(return_code);
+            main->child = return_code;
+
+            return status;
           }
         }
 
@@ -1151,25 +1163,23 @@ f_status_t firewall_delete_chains(firewall_main_t * const main) {
       return F_status_set_error(F_interrupt);
     }
 
-    f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
-    f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize;
-    int return_code = 0;
+    f_string_statics_t arguments = f_string_statics_t_initialize;
+    arguments.used = 1;
 
-    argument[0].string = "-F";
-    argument[0].size = 2;
-    argument[0].used = 2;
+    f_string_static_t arguments_array[arguments.used];
+    arguments_array[0] = firewall_chain_forward_s;
+    arguments.array = arguments_array;
 
-    arguments.array = argument;
-    arguments.size = 1;
-    arguments.used = 1;
+    int return_code = 0;
 
     firewall_print_debug_tool(main->warning, tools[i], arguments);
 
     status = fll_execute_program(tools[i], arguments, 0, 0, (void *) &return_code);
 
-    // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
     if (status == F_child) {
-      exit(return_code);
+      main->child = return_code;
+
+      return status;
     }
 
     if (F_status_is_error(status)) {
@@ -1211,9 +1221,10 @@ f_status_t firewall_delete_chains(firewall_main_t * const main) {
 
     status = fll_execute_program(tools[i], arguments, 0, 0, (void *) &return_code);
 
-    // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
     if (status == F_child) {
-      exit(return_code);
+      main->child = return_code;
+
+      return status;
     }
 
     if (F_status_is_error(status)) {
@@ -1238,10 +1249,8 @@ f_status_t firewall_delete_chains(firewall_main_t * const main) {
 
 f_status_t firewall_default_lock(firewall_main_t * const main) {
 
-  const f_string_t chains[3] = { firewall_chain_input_s, firewall_chain_output_s, firewall_chain_forward_s };
-  const f_string_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s };
-
-  const f_array_length_t lengths[3] = { firewall_chain_input_s_length, firewall_chain_output_s_length, firewall_chain_forward_s_length };
+  const f_string_static_t chains[3] = { firewall_chain_input_s, firewall_chain_output_s, firewall_chain_forward_s };
+  const f_string_static_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s };
 
   f_status_t status = F_none;
 
@@ -1249,23 +1258,19 @@ f_status_t firewall_default_lock(firewall_main_t * const main) {
 
   for (f_array_length_t i = 0; i < 3; ++i) {
 
-    f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
-    f_string_dynamic_t argument[3];
+    f_string_statics_t arguments = f_string_statics_t_initialize;
+    f_string_static_t argument[3];
 
     arguments.array = argument;
     arguments.used = 3;
     arguments.size = arguments.used;
 
-    arguments.array[0].string = firewall_action_policy_command_s;
-    arguments.array[1].string = chains[i];
+    arguments.array[0] = firewall_action_policy_command_s;
+    arguments.array[1] = chains[i];
     arguments.array[2].string = "DROP";
 
-    arguments.array[0].used = firewall_action_append_command_s_length;
-    arguments.array[1].used = lengths[i];
     arguments.array[2].used = 4;
 
-    arguments.array[0].size = arguments.array[0].used;
-    arguments.array[1].size = arguments.array[1].used;
     arguments.array[2].size = arguments.array[2].used;
 
     for (f_array_length_t j = 0; j < 2; ++j) {
@@ -1276,9 +1281,10 @@ f_status_t firewall_default_lock(firewall_main_t * const main) {
 
       status = fll_execute_program(tools[j], arguments, 0, 0, (void *) &return_code);
 
-      // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
       if (status == F_child) {
-        exit(return_code);
+        main->child = return_code;
+
+        return status;
       }
 
       if (firewall_signal_received(main)) {
@@ -1306,7 +1312,7 @@ f_status_t firewall_default_lock(firewall_main_t * const main) {
   return status;
 }
 
-f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t filename, const bool optional, firewall_local_data_t *local) {
+f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_static_t filename, const bool optional, firewall_local_data_t *local) {
 
   f_file_t file = f_file_t_initialize;
 
@@ -1328,13 +1334,13 @@ f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t
           firewall_print_error_on_invalid_parameter(main->error, "f_file_open");
         }
         else if (status == F_file_found_not) {
-          fll_print_format("%r%[%QUnable to find the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+          fll_print_format("%r%[%QUnable to find the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
         }
         else if (status == F_file_open) {
-          fll_print_format("%r%[%QUnable to open the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+          fll_print_format("%r%[%QUnable to open the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
         }
         else if (status == F_file_descriptor) {
-          fll_print_format("%r%[%QFile descriptor error while trying to open the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+          fll_print_format("%r%[%QFile descriptor error while trying to open the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
         }
         else {
           firewall_print_error_on_unhandled(main->error, "f_file_open", status);
@@ -1357,16 +1363,16 @@ f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t
         firewall_print_error_on_invalid_parameter(main->error, "f_file_read");
       }
       else if (status == F_number_overflow) {
-        fll_print_format("%r%[%QInteger overflow while trying to buffer the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QInteger overflow while trying to buffer the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
       }
       else if (status == F_file_closed) {
-        fll_print_format("%r%[%QThe file '%S' is no longer open.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QThe file '%Q' is no longer open.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
       }
       else if (status == F_file_seek) {
-        fll_print_format("%r%[%QA seek error occurred while accessing the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QA seek error occurred while accessing the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
       }
       else if (status == F_file_read) {
-        fll_print_format("%r%[%QA read error occurred while accessing the file '%S'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QA read error occurred while accessing the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
       }
       else if (status == F_memory_not) {
         firewall_print_error_on_allocation_failure(main->error);
@@ -1397,7 +1403,7 @@ f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t
         firewall_print_error_on_invalid_parameter_for_file(main->error, "fll_fss_basic_list_read", filename);
       }
       else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
-        fll_print_format("%r%[%QNo relevant main was found within the file '%s'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
+        fll_print_format("%r%[%QNo relevant main was found within the file '%Q'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, filename, main->error.context, f_string_eol_s);
       }
       else if (status == F_memory_not) {
         firewall_print_error_on_allocation_failure(main->error);
@@ -1445,6 +1451,13 @@ f_status_t firewall_process_rules(firewall_main_t * const main, f_string_range_t
   if (F_status_is_error_not(status)) {
     status = firewall_perform_commands(main, *local);
 
+    if (status == F_child) {
+      macro_f_fss_objects_t_delete_simple(local->rule_objects);
+      macro_f_fss_contents_t_delete_simple(local->rule_contents);
+
+      return status;
+    }
+
     if (F_status_is_error(status)) {
       status = F_status_set_fine(status);
 
@@ -1452,7 +1465,7 @@ f_status_t firewall_process_rules(firewall_main_t * const main, f_string_range_t
         firewall_print_error_on_allocation_failure(main->error);
       }
       else if (status == F_failure) {
-        // the error message has already been displayed.
+        // The error message has already been displayed.
       }
       else {
         firewall_print_error_on_unhandled(main->error, "firewall_perform_commands", status);
@@ -1460,6 +1473,7 @@ f_status_t firewall_process_rules(firewall_main_t * const main, f_string_range_t
 
       macro_f_fss_objects_t_delete_simple(local->rule_objects);
       macro_f_fss_contents_t_delete_simple(local->rule_contents);
+
       return status;
     }
   }
index a1fd7cdcd6e397b818dfb960a32d4e2cd38b4ed1..fdb0c686d27c3212665044ca1aee3c0e21964068 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
  *
@@ -41,6 +42,7 @@ extern f_status_t firewall_perform_commands(firewall_main_t * const main, const
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
  *
@@ -56,6 +58,7 @@ extern f_status_t firewall_create_custom_chains(firewall_main_t * const main, fi
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
  *
@@ -71,6 +74,7 @@ extern f_status_t firewall_delete_chains(firewall_main_t * const main) F_attribu
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   Status codes (with error bit) are returned on any problem.
  */
@@ -91,10 +95,11 @@ extern f_status_t firewall_default_lock(firewall_main_t * const main) F_attribut
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   Status codes (with error bit) are returned on any problem.
  */
-extern f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t filename, const bool optional, firewall_local_data_t *local) F_attribute_visibility_internal_d;
+extern f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_static_t filename, const bool optional, firewall_local_data_t *local) F_attribute_visibility_internal_d;
 
 /**
  * Process buffered rules.
@@ -108,6 +113,7 @@ extern f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_st
  *
  * @return
  *   F_none on success.
+ *   F_child on child process exiting.
  *
  *   Status codes (with error bit) are returned on any problem.
  */
index 73dd9d556666c12b87953c923be9eb2d9eb44d37..fee492d4f6c238eea47f824b671eaf7f35f81fb3 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library firewall.c private-common.c private-firewall.c
+build_sources_library firewall.c common.c private-common.c private-firewall.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers firewall.h
+build_sources_headers firewall.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_basic_list_read/c/common.c b/level_3/fss_basic_list_read/c/common.c
new file mode 100644 (file)
index 0000000..afa5e52
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fss_basic_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_list_read_main_delete_
+  f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_basic_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_basic_list_read/c/common.h b/level_3/fss_basic_list_read/c/common.h
new file mode 100644 (file)
index 0000000..8aa5e49
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic List Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_basic_list_read_common_h
+#define _fss_basic_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_basic_list_read_program_version_
+  #define FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_BASIC_LIST_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_BASIC_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_BASIC_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_BASIC_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
+    #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s
+    #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
+    #define FSS_BASIC_LIST_READ_program_version_nano_s
+    #define FSS_BASIC_LIST_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
+
+  #define FSS_BASIC_LIST_READ_program_version_s FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_micro_s fss_basic_list_program_version_nano_prefix_s FSS_BASIC_LIST_READ_program_version_nano_s
+
+  #define FSS_BASIC_LIST_READ_program_version_s_length FSS_BASIC_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_micro_s_length + fss_basic_list_program_version_nano_prefix_s_length + FSS_BASIC_LIST_READ_program_version_nano_s_length
+
+  extern const f_string_static_t fss_basic_list_program_version_s;
+#endif // _di_fss_basic_list_read_program_version_
+
+#ifndef _di_fss_basic_list_read_program_name_
+  #define FSS_BASIC_LIST_READ_program_name_s      "fss_basic_list_read"
+  #define FSS_BASIC_LIST_READ_program_name_long_s "FSS Basic List Read"
+
+  #define FSS_BASIC_LIST_READ_program_name_s_length      19
+  #define FSS_BASIC_LIST_READ_program_name_long_s_length 19
+
+  extern const f_string_static_t fss_basic_list_program_name_s;
+  extern const f_string_static_t fss_basic_list_program_name_long_s;
+#endif // _di_fss_basic_list_read_program_name_
+
+#ifndef _di_fss_basic_list_read_defines_
+  #define fss_basic_list_read_signal_check_d 10000
+
+  #define fss_basic_list_read_pipe_content_end_s    '\f'
+  #define fss_basic_list_read_pipe_content_ignore_s '\v'
+  #define fss_basic_list_read_pipe_content_start_s  '\b'
+
+  #define fss_basic_list_read_short_at_s      "a"
+  #define fss_basic_list_read_short_content_s "c"
+  #define fss_basic_list_read_short_columns_s "C"
+  #define fss_basic_list_read_short_delimit_s "D"
+  #define fss_basic_list_read_short_depth_s   "d"
+  #define fss_basic_list_read_short_empty_s   "e"
+  #define fss_basic_list_read_short_line_s    "l"
+  #define fss_basic_list_read_short_name_s    "n"
+  #define fss_basic_list_read_short_object_s  "o"
+  #define fss_basic_list_read_short_pipe_s    "p"
+  #define fss_basic_list_read_short_raw_s     "R"
+  #define fss_basic_list_read_short_select_s  "s"
+  #define fss_basic_list_read_short_total_s   "t"
+  #define fss_basic_list_read_short_trim_s    "T"
+
+  #define fss_basic_list_read_long_at_s      "at"
+  #define fss_basic_list_read_long_content_s "content"
+  #define fss_basic_list_read_long_columns_s "columns"
+  #define fss_basic_list_read_long_delimit_s "delimit"
+  #define fss_basic_list_read_long_depth_s   "depth"
+  #define fss_basic_list_read_long_empty_s   "empty"
+  #define fss_basic_list_read_long_line_s    "line"
+  #define fss_basic_list_read_long_name_s    "name"
+  #define fss_basic_list_read_long_object_s  "object"
+  #define fss_basic_list_read_long_pipe_s    "pipe"
+  #define fss_basic_list_read_long_raw_s     "raw"
+  #define fss_basic_list_read_long_select_s  "select"
+  #define fss_basic_list_read_long_total_s   "total"
+  #define fss_basic_list_read_long_trim_s    "trim"
+
+  enum {
+    fss_basic_list_read_parameter_help_e,
+    fss_basic_list_read_parameter_light_e,
+    fss_basic_list_read_parameter_dark_e,
+    fss_basic_list_read_parameter_no_color_e,
+    fss_basic_list_read_parameter_verbosity_quiet_e,
+    fss_basic_list_read_parameter_verbosity_normal_e,
+    fss_basic_list_read_parameter_verbosity_verbose_e,
+    fss_basic_list_read_parameter_verbosity_debug_e,
+    fss_basic_list_read_parameter_version_e,
+
+    fss_basic_list_read_parameter_at_e,
+    fss_basic_list_read_parameter_content_e,
+    fss_basic_list_read_parameter_columns_e,
+    fss_basic_list_read_parameter_delimit_e,
+    fss_basic_list_read_parameter_depth_e,
+    fss_basic_list_read_parameter_empty_e,
+    fss_basic_list_read_parameter_line_e,
+    fss_basic_list_read_parameter_name_e,
+    fss_basic_list_read_parameter_object_e,
+    fss_basic_list_read_parameter_pipe_e,
+    fss_basic_list_read_parameter_raw_e,
+    fss_basic_list_read_parameter_select_e,
+    fss_basic_list_read_parameter_total_e,
+    fss_basic_list_read_parameter_trim_e,
+  };
+
+  #define fss_basic_list_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_basic_list_total_parameters_d 23
+#endif // _di_fss_basic_list_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_basic_list_read_delimit_mode_*:
+ *   - all:                    All delimits are to be aplied.
+ *   - content:                Content are to have delimits applied.
+ *   - content_greater:        Content at this number or higher are to have delimits applied.
+ *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ *   - content_lesser:         Content at this number or lower are to have delimits applied.
+ *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
+ *   - content_object:         Objects and Content are to have delimits applied
+ *   - object:                 Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_basic_list_read_delimit_mode_
+  #define fss_basic_list_read_delimit_mode_name_none_s    "none"
+  #define fss_basic_list_read_delimit_mode_name_all_s     "all"
+  #define fss_basic_list_read_delimit_mode_name_object_s  "object"
+  #define fss_basic_list_read_delimit_mode_name_greater_s "+"
+  #define fss_basic_list_read_delimit_mode_name_lesser_s  "-"
+
+  #define fss_basic_list_read_delimit_mode_name_none_s_length    4
+  #define fss_basic_list_read_delimit_mode_name_all_s_length     3
+  #define fss_basic_list_read_delimit_mode_name_object_s_length  6
+  #define fss_basic_list_read_delimit_mode_name_greater_s_length 1
+  #define fss_basic_list_read_delimit_mode_name_lesser_s_length  1
+
+  enum {
+    fss_basic_list_read_delimit_mode_none_e = 1,
+    fss_basic_list_read_delimit_mode_all_e,
+    fss_basic_list_read_delimit_mode_content_e,
+    fss_basic_list_read_delimit_mode_content_greater_e,
+    fss_basic_list_read_delimit_mode_content_greater_object_e,
+    fss_basic_list_read_delimit_mode_content_lesser_e,
+    fss_basic_list_read_delimit_mode_content_lesser_object_e,
+    fss_basic_list_read_delimit_mode_content_object_e,
+    fss_basic_list_read_delimit_mode_object_e,
+  };
+#endif // _di_fss_basic_list_read_delimit_modes_
+
+#ifndef _di_fss_basic_list_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_basic_list_read_main_t;
+
+  #define fss_basic_list_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_basic_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_list_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_list_read_main()
+ */
+#ifndef _di_fss_basic_list_read_main_delete_
+  extern f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main);
+#endif // _di_fss_basic_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_list_read_common_h
index fa9730c1d859aeacdc6dd5681130fab057fa7403..2e013c0cafe52b452c8701e572f89f8a39372225 100644 (file)
@@ -669,18 +669,6 @@ extern "C" {
   }
 #endif // _di_fss_basic_list_read_main_
 
-#ifndef _di_fss_basic_list_read_main_delete_
-  f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_basic_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index d6de141f86586baafb60ff585a49dcd56e2d3d13..cc3b30e7ecb151b67a49b454c88bbf9761a90100 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Basic List Read includes.
+#include <program/fss_basic_list_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_basic_list_read_program_version_
-  #define FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_BASIC_LIST_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_BASIC_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_BASIC_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_BASIC_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
-    #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s
-    #define FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
-    #define FSS_BASIC_LIST_READ_program_version_nano_s
-    #define FSS_BASIC_LIST_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_BASIC_LIST_READ_program_version_nano_s) && defined(FSS_BASIC_LIST_READ_program_version_nano_s_length))
-
-  #define FSS_BASIC_LIST_READ_program_version_s FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_READ_program_version_micro_s fss_basic_list_program_version_nano_prefix_s FSS_BASIC_LIST_READ_program_version_nano_s
-
-  #define FSS_BASIC_LIST_READ_program_version_s_length FSS_BASIC_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_READ_program_version_micro_s_length + fss_basic_list_program_version_nano_prefix_s_length + FSS_BASIC_LIST_READ_program_version_nano_s_length
-
-  extern const f_string_static_t fss_basic_list_program_version_s;
-#endif // _di_fss_basic_list_read_program_version_
-
-#ifndef _di_fss_basic_list_read_program_name_
-  #define FSS_BASIC_LIST_READ_program_name_s      "fss_basic_list_read"
-  #define FSS_BASIC_LIST_READ_program_name_long_s "FSS Basic List Read"
-
-  #define FSS_BASIC_LIST_READ_program_name_s_length      19
-  #define FSS_BASIC_LIST_READ_program_name_long_s_length 19
-
-  extern const f_string_static_t fss_basic_list_program_name_s;
-  extern const f_string_static_t fss_basic_list_program_name_long_s;
-#endif // _di_fss_basic_list_read_program_name_
-
-#ifndef _di_fss_basic_list_read_defines_
-  #define fss_basic_list_read_signal_check_d 10000
-
-  #define fss_basic_list_read_pipe_content_end_s    '\f'
-  #define fss_basic_list_read_pipe_content_ignore_s '\v'
-  #define fss_basic_list_read_pipe_content_start_s  '\b'
-
-  #define fss_basic_list_read_short_at_s      "a"
-  #define fss_basic_list_read_short_content_s "c"
-  #define fss_basic_list_read_short_columns_s "C"
-  #define fss_basic_list_read_short_delimit_s "D"
-  #define fss_basic_list_read_short_depth_s   "d"
-  #define fss_basic_list_read_short_empty_s   "e"
-  #define fss_basic_list_read_short_line_s    "l"
-  #define fss_basic_list_read_short_name_s    "n"
-  #define fss_basic_list_read_short_object_s  "o"
-  #define fss_basic_list_read_short_pipe_s    "p"
-  #define fss_basic_list_read_short_raw_s     "R"
-  #define fss_basic_list_read_short_select_s  "s"
-  #define fss_basic_list_read_short_total_s   "t"
-  #define fss_basic_list_read_short_trim_s    "T"
-
-  #define fss_basic_list_read_long_at_s      "at"
-  #define fss_basic_list_read_long_content_s "content"
-  #define fss_basic_list_read_long_columns_s "columns"
-  #define fss_basic_list_read_long_delimit_s "delimit"
-  #define fss_basic_list_read_long_depth_s   "depth"
-  #define fss_basic_list_read_long_empty_s   "empty"
-  #define fss_basic_list_read_long_line_s    "line"
-  #define fss_basic_list_read_long_name_s    "name"
-  #define fss_basic_list_read_long_object_s  "object"
-  #define fss_basic_list_read_long_pipe_s    "pipe"
-  #define fss_basic_list_read_long_raw_s     "raw"
-  #define fss_basic_list_read_long_select_s  "select"
-  #define fss_basic_list_read_long_total_s   "total"
-  #define fss_basic_list_read_long_trim_s    "trim"
-
-  enum {
-    fss_basic_list_read_parameter_help_e,
-    fss_basic_list_read_parameter_light_e,
-    fss_basic_list_read_parameter_dark_e,
-    fss_basic_list_read_parameter_no_color_e,
-    fss_basic_list_read_parameter_verbosity_quiet_e,
-    fss_basic_list_read_parameter_verbosity_normal_e,
-    fss_basic_list_read_parameter_verbosity_verbose_e,
-    fss_basic_list_read_parameter_verbosity_debug_e,
-    fss_basic_list_read_parameter_version_e,
-
-    fss_basic_list_read_parameter_at_e,
-    fss_basic_list_read_parameter_content_e,
-    fss_basic_list_read_parameter_columns_e,
-    fss_basic_list_read_parameter_delimit_e,
-    fss_basic_list_read_parameter_depth_e,
-    fss_basic_list_read_parameter_empty_e,
-    fss_basic_list_read_parameter_line_e,
-    fss_basic_list_read_parameter_name_e,
-    fss_basic_list_read_parameter_object_e,
-    fss_basic_list_read_parameter_pipe_e,
-    fss_basic_list_read_parameter_raw_e,
-    fss_basic_list_read_parameter_select_e,
-    fss_basic_list_read_parameter_total_e,
-    fss_basic_list_read_parameter_trim_e,
-  };
-
-  #define fss_basic_list_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_basic_list_total_parameters_d 23
-#endif // _di_fss_basic_list_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_basic_list_read_delimit_mode_*:
- *   - all:                    All delimits are to be aplied.
- *   - content:                Content are to have delimits applied.
- *   - content_greater:        Content at this number or higher are to have delimits applied.
- *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- *   - content_lesser:         Content at this number or lower are to have delimits applied.
- *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
- *   - content_object:         Objects and Content are to have delimits applied
- *   - object:                 Objects arre to have delimits applied.
- */
-#ifndef _di_fss_basic_list_read_delimit_mode_
-  #define fss_basic_list_read_delimit_mode_name_none_s    "none"
-  #define fss_basic_list_read_delimit_mode_name_all_s     "all"
-  #define fss_basic_list_read_delimit_mode_name_object_s  "object"
-  #define fss_basic_list_read_delimit_mode_name_greater_s "+"
-  #define fss_basic_list_read_delimit_mode_name_lesser_s  "-"
-
-  #define fss_basic_list_read_delimit_mode_name_none_s_length    4
-  #define fss_basic_list_read_delimit_mode_name_all_s_length     3
-  #define fss_basic_list_read_delimit_mode_name_object_s_length  6
-  #define fss_basic_list_read_delimit_mode_name_greater_s_length 1
-  #define fss_basic_list_read_delimit_mode_name_lesser_s_length  1
-
-  enum {
-    fss_basic_list_read_delimit_mode_none_e = 1,
-    fss_basic_list_read_delimit_mode_all_e,
-    fss_basic_list_read_delimit_mode_content_e,
-    fss_basic_list_read_delimit_mode_content_greater_e,
-    fss_basic_list_read_delimit_mode_content_greater_object_e,
-    fss_basic_list_read_delimit_mode_content_lesser_e,
-    fss_basic_list_read_delimit_mode_content_lesser_object_e,
-    fss_basic_list_read_delimit_mode_content_object_e,
-    fss_basic_list_read_delimit_mode_object_e,
-  };
-#endif // _di_fss_basic_list_read_delimit_modes_
-
-#ifndef _di_fss_basic_list_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_basic_list_read_main_t;
-
-  #define fss_basic_list_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_basic_list_read_main_t_
-
 /**
  * Print help.
  *
@@ -295,25 +99,6 @@ extern "C" {
   extern f_status_t fss_basic_list_read_main(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_basic_list_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_list_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_list_read_main()
- */
-#ifndef _di_fss_basic_list_read_main_delete_
-  extern f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main);
-#endif // _di_fss_basic_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 69aede5665285f23953ad0caa61daab33ff7351b..e4e42f7177518e76834799bdb9d7a0327c95e110 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_basic_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_basic_list_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_basic_list_read.h
+build_sources_headers fss_basic_list_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_basic_list_write/c/common.c b/level_3/fss_basic_list_write/c/common.c
new file mode 100644 (file)
index 0000000..dec052c
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_basic_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_list_write_main_delete_
+  f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_basic_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_basic_list_write/c/common.h b/level_3/fss_basic_list_write/c/common.h
new file mode 100644 (file)
index 0000000..816d71d
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic List Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_basic_list_write_common_h
+#define _fss_basic_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_basic_list_write_program_version_
+  #define FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_BASIC_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_BASIC_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_BASIC_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_BASIC_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s
+    #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
+    #define FSS_BASIC_LIST_WRITE_program_version_nano_s
+    #define FSS_BASIC_LIST_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
+
+  #define FSS_BASIC_LIST_WRITE_program_version_s FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_micro_s FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s FSS_BASIC_LIST_WRITE_program_version_nano_s
+
+  #define FSS_BASIC_LIST_WRITE_program_version_s_length FSS_BASIC_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_micro_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_basic_list_write_program_version_s;
+#endif // _di_fss_basic_list_write_program_version_
+
+#ifndef _di_fss_basic_list_write_program_name_
+  #define FSS_BASIC_LIST_WRITE_program_name_s      "fss_basic_list_write"
+  #define FSS_BASIC_LIST_WRITE_program_name_long_s "FSS Basic List Write"
+
+  #define FSS_BASIC_LIST_WRITE_program_name_s_length      20
+  #define FSS_BASIC_LIST_WRITE_program_name_long_s_length 20
+
+  extern const f_string_static_t fss_basic_list_write_program_name_s;
+  extern const f_string_static_t fss_basic_list_write_program_name_long_s;
+#endif // _di_fss_basic_list_write_program_name_
+
+#ifndef _di_fss_basic_list_write_defines_
+  #define fss_basic_list_write_signal_check_d 10000
+
+  #define fss_basic_list_write_pipe_content_end_s    '\f'
+  #define fss_basic_list_write_pipe_content_ignore_s '\v'
+  #define fss_basic_list_write_pipe_content_start_s  '\b'
+
+  #define fss_basic_list_write_short_file_s    "f"
+  #define fss_basic_list_write_short_content_s "c"
+  #define fss_basic_list_write_short_double_s  "d"
+  #define fss_basic_list_write_short_ignore_s  "I"
+  #define fss_basic_list_write_short_object_s  "o"
+  #define fss_basic_list_write_short_partial_s "p"
+  #define fss_basic_list_write_short_prepend_s "P"
+  #define fss_basic_list_write_short_single_s  "s"
+  #define fss_basic_list_write_short_trim_s    "T"
+
+  #define fss_basic_list_write_long_file_s    "file"
+  #define fss_basic_list_write_long_content_s "content"
+  #define fss_basic_list_write_long_double_s  "double"
+  #define fss_basic_list_write_long_ignore_s  "ignore"
+  #define fss_basic_list_write_long_object_s  "object"
+  #define fss_basic_list_write_long_partial_s "partial"
+  #define fss_basic_list_write_long_prepend_s "prepend"
+  #define fss_basic_list_write_long_single_s  "single"
+  #define fss_basic_list_write_long_trim_s    "trim"
+
+  enum {
+    fss_basic_list_write_parameter_help_e,
+    fss_basic_list_write_parameter_light_e,
+    fss_basic_list_write_parameter_dark_e,
+    fss_basic_list_write_parameter_no_color_e,
+    fss_basic_list_write_parameter_verbosity_quiet_e,
+    fss_basic_list_write_parameter_verbosity_normal_e,
+    fss_basic_list_write_parameter_verbosity_verbose_e,
+    fss_basic_list_write_parameter_verbosity_debug_e,
+    fss_basic_list_write_parameter_version_e,
+
+    fss_basic_list_write_parameter_file_e,
+    fss_basic_list_write_parameter_content_e,
+    fss_basic_list_write_parameter_double_e,
+    fss_basic_list_write_parameter_ignore_e,
+    fss_basic_list_write_parameter_object_e,
+    fss_basic_list_write_parameter_partial_e,
+    fss_basic_list_write_parameter_prepend_e,
+    fss_basic_list_write_parameter_single_e,
+    fss_basic_list_write_parameter_trim_e,
+  };
+
+  #define fss_basic_list_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_basic_list_write_total_parameters_d 18
+#endif // _di_fss_basic_list_write_defines_
+
+#ifndef _di_fss_basic_list_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t prepend;
+
+    f_color_context_t context;
+  } fss_basic_list_write_main_t;
+
+  #define fss_basic_list_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_basic_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_list_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_list_write_main()
+ */
+#ifndef _di_fss_basic_list_write_main_delete_
+  extern f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main);
+#endif // _di_fss_basic_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_list_write_common_h
index a8ec3e36084b87ce5ec95a8bc4bb699a99b9b3e6..22036498a6d31b8a952aae518e9af8bbb0dec524 100644 (file)
@@ -560,19 +560,6 @@ extern "C" {
   }
 #endif // _di_fss_basic_list_write_main_
 
-#ifndef _di_fss_basic_list_write_main_delete_
-  f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_basic_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0e042199f46693dd46f73475139d7ffbc09961b3..dc1b8fb8cfcf1ec9224a8c37e38fbf681cf39670 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Basic List Write includes.
+#include <program/fss_basic_list_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_basic_list_write_program_version_
-  #define FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_BASIC_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_BASIC_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_BASIC_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_BASIC_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s
-    #define FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
-    #define FSS_BASIC_LIST_WRITE_program_version_nano_s
-    #define FSS_BASIC_LIST_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_BASIC_LIST_WRITE_program_version_nano_s) && defined(FSS_BASIC_LIST_WRITE_program_version_nano_s_length))
-
-  #define FSS_BASIC_LIST_WRITE_program_version_s FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_LIST_WRITE_program_version_micro_s FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s FSS_BASIC_LIST_WRITE_program_version_nano_s
-
-  #define FSS_BASIC_LIST_WRITE_program_version_s_length FSS_BASIC_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_LIST_WRITE_program_version_micro_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_LIST_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_basic_list_write_program_version_s;
-#endif // _di_fss_basic_list_write_program_version_
-
-#ifndef _di_fss_basic_list_write_program_name_
-  #define FSS_BASIC_LIST_WRITE_program_name_s      "fss_basic_list_write"
-  #define FSS_BASIC_LIST_WRITE_program_name_long_s "FSS Basic List Write"
-
-  #define FSS_BASIC_LIST_WRITE_program_name_s_length      20
-  #define FSS_BASIC_LIST_WRITE_program_name_long_s_length 20
-
-  extern const f_string_static_t fss_basic_list_write_program_name_s;
-  extern const f_string_static_t fss_basic_list_write_program_name_long_s;
-#endif // _di_fss_basic_list_write_program_name_
-
-#ifndef _di_fss_basic_list_write_defines_
-  #define fss_basic_list_write_signal_check_d 10000
-
-  #define fss_basic_list_write_pipe_content_end_s    '\f'
-  #define fss_basic_list_write_pipe_content_ignore_s '\v'
-  #define fss_basic_list_write_pipe_content_start_s  '\b'
-
-  #define fss_basic_list_write_short_file_s    "f"
-  #define fss_basic_list_write_short_content_s "c"
-  #define fss_basic_list_write_short_double_s  "d"
-  #define fss_basic_list_write_short_ignore_s  "I"
-  #define fss_basic_list_write_short_object_s  "o"
-  #define fss_basic_list_write_short_partial_s "p"
-  #define fss_basic_list_write_short_prepend_s "P"
-  #define fss_basic_list_write_short_single_s  "s"
-  #define fss_basic_list_write_short_trim_s    "T"
-
-  #define fss_basic_list_write_long_file_s    "file"
-  #define fss_basic_list_write_long_content_s "content"
-  #define fss_basic_list_write_long_double_s  "double"
-  #define fss_basic_list_write_long_ignore_s  "ignore"
-  #define fss_basic_list_write_long_object_s  "object"
-  #define fss_basic_list_write_long_partial_s "partial"
-  #define fss_basic_list_write_long_prepend_s "prepend"
-  #define fss_basic_list_write_long_single_s  "single"
-  #define fss_basic_list_write_long_trim_s    "trim"
-
-  enum {
-    fss_basic_list_write_parameter_help_e,
-    fss_basic_list_write_parameter_light_e,
-    fss_basic_list_write_parameter_dark_e,
-    fss_basic_list_write_parameter_no_color_e,
-    fss_basic_list_write_parameter_verbosity_quiet_e,
-    fss_basic_list_write_parameter_verbosity_normal_e,
-    fss_basic_list_write_parameter_verbosity_verbose_e,
-    fss_basic_list_write_parameter_verbosity_debug_e,
-    fss_basic_list_write_parameter_version_e,
-
-    fss_basic_list_write_parameter_file_e,
-    fss_basic_list_write_parameter_content_e,
-    fss_basic_list_write_parameter_double_e,
-    fss_basic_list_write_parameter_ignore_e,
-    fss_basic_list_write_parameter_object_e,
-    fss_basic_list_write_parameter_partial_e,
-    fss_basic_list_write_parameter_prepend_e,
-    fss_basic_list_write_parameter_single_e,
-    fss_basic_list_write_parameter_trim_e,
-  };
-
-  #define fss_basic_list_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_basic_list_write_total_parameters_d 18
-#endif // _di_fss_basic_list_write_defines_
-
-#ifndef _di_fss_basic_list_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t prepend;
-
-    f_color_context_t context;
-  } fss_basic_list_write_main_t;
-
-  #define fss_basic_list_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_basic_list_write_main_t_
-
 /**
  * Print help.
  *
@@ -231,25 +91,6 @@ extern "C" {
   extern f_status_t fss_basic_list_write_main(fss_basic_list_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_basic_list_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_list_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_list_write_main()
- */
-#ifndef _di_fss_basic_list_write_main_delete_
-  extern f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main);
-#endif // _di_fss_basic_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a118cf73b7c4a8e578362bc85f393f664137a217..63dd3e999c4f392f2216f1bcb41d2373d95f8b2c 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_basic_list_write.c private-common.c private-write.c
+build_sources_library fss_basic_list_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_basic_list_write.h
+build_sources_headers fss_basic_list_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_basic_read/c/common.c b/level_3/fss_basic_read/c/common.c
new file mode 100644 (file)
index 0000000..6393649
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fss_basic_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_read_main_delete_
+  f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_basic_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_basic_read/c/common.h b/level_3/fss_basic_read/c/common.h
new file mode 100644 (file)
index 0000000..a157de5
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_basic_read_common_h
+#define _fss_basic_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_basic_read_program_version_
+  #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s_length
+  #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s_length
+  #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s_length
+
+  #if !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
+    #define FSS_BASIC_READ_program_version_nano_prefix_s
+    #define FSS_BASIC_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
+    #define FSS_BASIC_READ_program_version_nano_s
+    #define FSS_BASIC_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
+
+  #define FSS_BASIC_READ_program_version_s FSS_BASIC_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_READ_program_version_micro_s FSS_BASIC_READ_program_version_nano_prefix_s FSS_BASIC_READ_program_version_nano_s
+
+  #define FSS_BASIC_READ_program_version_s_length FSS_BASIC_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_micro_s_length + FSS_BASIC_READ_program_version_nano_prefix_s_length + FSS_BASIC_READ_program_version_nano_s_length
+
+  extern const f_string_static_t fss_basic_read_program_version_s;
+#endif // _di_fss_basic_read_program_version_
+
+#ifndef _di_fss_basic_read_program_name_
+  #define FSS_BASIC_READ_program_name_s      "fss_basic_read"
+  #define FSS_BASIC_READ_program_name_long_s "FSS Basic Read"
+
+  #define FSS_BASIC_READ_program_name_s_length      14
+  #define FSS_BASIC_READ_program_name_long_s_length 14
+
+  extern const f_string_static_t fss_basic_read_program_name_s;
+  extern const f_string_static_t fss_basic_read_program_name_long_s;
+#endif // _di_fss_basic_read_program_name_
+
+#ifndef _di_fss_basic_read_defines_
+  #define fss_basic_read_signal_check_d 10000
+
+  #define fss_basic_read_pipe_content_end_s    '\f'
+  #define fss_basic_read_pipe_content_ignore_s '\v'
+  #define fss_basic_read_pipe_content_start_s  '\b'
+
+  #define fss_basic_read_short_at_s      "a"
+  #define fss_basic_read_short_content_s "c"
+  #define fss_basic_read_short_columns_s "C"
+  #define fss_basic_read_short_delimit_s "D"
+  #define fss_basic_read_short_depth_s   "d"
+  #define fss_basic_read_short_empty_s   "e"
+  #define fss_basic_read_short_line_s    "l"
+  #define fss_basic_read_short_name_s    "n"
+  #define fss_basic_read_short_object_s  "o"
+  #define fss_basic_read_short_pipe_s    "p"
+  #define fss_basic_read_short_raw_s     "R"
+  #define fss_basic_read_short_select_s  "s"
+  #define fss_basic_read_short_total_s   "t"
+  #define fss_basic_read_short_trim_s    "T"
+
+  #define fss_basic_read_long_at_s      "at"
+  #define fss_basic_read_long_content_s "content"
+  #define fss_basic_read_long_columns_s "columns"
+  #define fss_basic_read_long_delimit_s "delimit"
+  #define fss_basic_read_long_depth_s   "depth"
+  #define fss_basic_read_long_empty_s   "empty"
+  #define fss_basic_read_long_line_s    "line"
+  #define fss_basic_read_long_name_s    "name"
+  #define fss_basic_read_long_object_s  "object"
+  #define fss_basic_read_long_pipe_s    "pipe"
+  #define fss_basic_read_long_raw_s     "raw"
+  #define fss_basic_read_long_select_s  "select"
+  #define fss_basic_read_long_total_s   "total"
+  #define fss_basic_read_long_trim_s    "trim"
+
+  enum {
+    fss_basic_read_parameter_help_e,
+    fss_basic_read_parameter_light_e,
+    fss_basic_read_parameter_dark_e,
+    fss_basic_read_parameter_no_color_e,
+    fss_basic_read_parameter_verbosity_quiet_e,
+    fss_basic_read_parameter_verbosity_normal_e,
+    fss_basic_read_parameter_verbosity_verbose_e,
+    fss_basic_read_parameter_verbosity_debug_e,
+    fss_basic_read_parameter_version_e,
+
+    fss_basic_read_parameter_at_e,
+    fss_basic_read_parameter_content_e,
+    fss_basic_read_parameter_columns_e,
+    fss_basic_read_parameter_delimit_e,
+    fss_basic_read_parameter_depth_e,
+    fss_basic_read_parameter_empty_e,
+    fss_basic_read_parameter_line_e,
+    fss_basic_read_parameter_name_e,
+    fss_basic_read_parameter_object_e,
+    fss_basic_read_parameter_pipe_e,
+    fss_basic_read_parameter_raw_e,
+    fss_basic_read_parameter_select_e,
+    fss_basic_read_parameter_total_e,
+    fss_basic_read_parameter_trim_e,
+  };
+
+  #define fss_basic_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s, fss_basic_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s, fss_basic_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s, fss_basic_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s, fss_basic_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s, fss_basic_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_basic_read_total_parameters_d 23
+#endif // _di_fss_basic_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_basic_read_delimit_mode_*:
+ *   - all:                    All delimits are to be aplied.
+ *   - content:                Content are to have delimits applied.
+ *   - content_greater:        Content at this number or higher are to have delimits applied.
+ *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ *   - content_lesser:         Content at this number or lower are to have delimits applied.
+ *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
+ *   - content_object:         Objects and Content are to have delimits applied
+ *   - object:                 Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_basic_read_delimit_mode_
+  #define fss_basic_read_delimit_mode_name_none_s    "none"
+  #define fss_basic_read_delimit_mode_name_all_s     "all"
+  #define fss_basic_read_delimit_mode_name_object_s  "object"
+  #define fss_basic_read_delimit_mode_name_greater_s "+"
+  #define fss_basic_read_delimit_mode_name_lesser_s  "-"
+
+  #define fss_basic_read_delimit_mode_name_none_s_length    4
+  #define fss_basic_read_delimit_mode_name_all_s_length     3
+  #define fss_basic_read_delimit_mode_name_object_s_length  6
+  #define fss_basic_read_delimit_mode_name_greater_s_length 1
+  #define fss_basic_read_delimit_mode_name_lesser_s_length  1
+
+  enum {
+    fss_basic_read_delimit_mode_none_e = 1,
+    fss_basic_read_delimit_mode_all_e,
+    fss_basic_read_delimit_mode_content_e,
+    fss_basic_read_delimit_mode_content_greater_e,
+    fss_basic_read_delimit_mode_content_greater_object_e,
+    fss_basic_read_delimit_mode_content_lesser_e,
+    fss_basic_read_delimit_mode_content_lesser_object_e,
+    fss_basic_read_delimit_mode_content_object_e,
+    fss_basic_read_delimit_mode_object_e,
+  };
+#endif // _di_fss_basic_read_delimit_modes_
+
+#ifndef _di_fss_basic_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_basic_read_main_t;
+
+  #define fss_basic_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_basic_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_read_main()
+ */
+#ifndef _di_fss_basic_read_main_delete_
+  extern f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main);
+#endif // _di_fss_basic_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_read_common_h
index d597454cae9d93cdc00b9996ba2434b1353b23e0..a6ab07455cc2d2496b48d27e793fc2665794f89d 100644 (file)
@@ -659,18 +659,6 @@ extern "C" {
   }
 #endif // _di_fss_basic_read_main_
 
-#ifndef _di_fss_basic_read_main_delete_
-  f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_basic_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 56e2397594259f0349e5fa0d9e832b0bfd0d1d43..fb2b8226bf1452b65d18c87fdfcfbfa0b304f8d2 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Basic Read includes.
+#include <program/fss_basic_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_basic_read_program_version_
-  #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s_length
-  #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s_length
-  #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s_length
-
-  #if !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
-    #define FSS_BASIC_READ_program_version_nano_prefix_s
-    #define FSS_BASIC_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
-    #define FSS_BASIC_READ_program_version_nano_s
-    #define FSS_BASIC_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_BASIC_READ_program_version_nano_s) && defined(FSS_BASIC_READ_program_version_nano_s_length))
-
-  #define FSS_BASIC_READ_program_version_s FSS_BASIC_READ_program_version_major_s F_string_ascii_period_s FSS_BASIC_READ_program_version_minor_s F_string_ascii_period_s FSS_BASIC_READ_program_version_micro_s FSS_BASIC_READ_program_version_nano_prefix_s FSS_BASIC_READ_program_version_nano_s
-
-  #define FSS_BASIC_READ_program_version_s_length FSS_BASIC_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_READ_program_version_micro_s_length + FSS_BASIC_READ_program_version_nano_prefix_s_length + FSS_BASIC_READ_program_version_nano_s_length
-
-  extern const f_string_static_t fss_basic_read_program_version_s;
-#endif // _di_fss_basic_read_program_version_
-
-#ifndef _di_fss_basic_read_program_name_
-  #define FSS_BASIC_READ_program_name_s      "fss_basic_read"
-  #define FSS_BASIC_READ_program_name_long_s "FSS Basic Read"
-
-  #define FSS_BASIC_READ_program_name_s_length      14
-  #define FSS_BASIC_READ_program_name_long_s_length 14
-
-  extern const f_string_static_t fss_basic_read_program_name_s;
-  extern const f_string_static_t fss_basic_read_program_name_long_s;
-#endif // _di_fss_basic_read_program_name_
-
-#ifndef _di_fss_basic_read_defines_
-  #define fss_basic_read_signal_check_d 10000
-
-  #define fss_basic_read_pipe_content_end_s    '\f'
-  #define fss_basic_read_pipe_content_ignore_s '\v'
-  #define fss_basic_read_pipe_content_start_s  '\b'
-
-  #define fss_basic_read_short_at_s      "a"
-  #define fss_basic_read_short_content_s "c"
-  #define fss_basic_read_short_columns_s "C"
-  #define fss_basic_read_short_delimit_s "D"
-  #define fss_basic_read_short_depth_s   "d"
-  #define fss_basic_read_short_empty_s   "e"
-  #define fss_basic_read_short_line_s    "l"
-  #define fss_basic_read_short_name_s    "n"
-  #define fss_basic_read_short_object_s  "o"
-  #define fss_basic_read_short_pipe_s    "p"
-  #define fss_basic_read_short_raw_s     "R"
-  #define fss_basic_read_short_select_s  "s"
-  #define fss_basic_read_short_total_s   "t"
-  #define fss_basic_read_short_trim_s    "T"
-
-  #define fss_basic_read_long_at_s      "at"
-  #define fss_basic_read_long_content_s "content"
-  #define fss_basic_read_long_columns_s "columns"
-  #define fss_basic_read_long_delimit_s "delimit"
-  #define fss_basic_read_long_depth_s   "depth"
-  #define fss_basic_read_long_empty_s   "empty"
-  #define fss_basic_read_long_line_s    "line"
-  #define fss_basic_read_long_name_s    "name"
-  #define fss_basic_read_long_object_s  "object"
-  #define fss_basic_read_long_pipe_s    "pipe"
-  #define fss_basic_read_long_raw_s     "raw"
-  #define fss_basic_read_long_select_s  "select"
-  #define fss_basic_read_long_total_s   "total"
-  #define fss_basic_read_long_trim_s    "trim"
-
-  enum {
-    fss_basic_read_parameter_help_e,
-    fss_basic_read_parameter_light_e,
-    fss_basic_read_parameter_dark_e,
-    fss_basic_read_parameter_no_color_e,
-    fss_basic_read_parameter_verbosity_quiet_e,
-    fss_basic_read_parameter_verbosity_normal_e,
-    fss_basic_read_parameter_verbosity_verbose_e,
-    fss_basic_read_parameter_verbosity_debug_e,
-    fss_basic_read_parameter_version_e,
-
-    fss_basic_read_parameter_at_e,
-    fss_basic_read_parameter_content_e,
-    fss_basic_read_parameter_columns_e,
-    fss_basic_read_parameter_delimit_e,
-    fss_basic_read_parameter_depth_e,
-    fss_basic_read_parameter_empty_e,
-    fss_basic_read_parameter_line_e,
-    fss_basic_read_parameter_name_e,
-    fss_basic_read_parameter_object_e,
-    fss_basic_read_parameter_pipe_e,
-    fss_basic_read_parameter_raw_e,
-    fss_basic_read_parameter_select_e,
-    fss_basic_read_parameter_total_e,
-    fss_basic_read_parameter_trim_e,
-  };
-
-  #define fss_basic_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s, fss_basic_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s, fss_basic_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s, fss_basic_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s, fss_basic_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s, fss_basic_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_basic_read_total_parameters_d 23
-#endif // _di_fss_basic_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_basic_read_delimit_mode_*:
- *   - all:                    All delimits are to be aplied.
- *   - content:                Content are to have delimits applied.
- *   - content_greater:        Content at this number or higher are to have delimits applied.
- *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- *   - content_lesser:         Content at this number or lower are to have delimits applied.
- *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
- *   - content_object:         Objects and Content are to have delimits applied
- *   - object:                 Objects arre to have delimits applied.
- */
-#ifndef _di_fss_basic_read_delimit_mode_
-  #define fss_basic_read_delimit_mode_name_none_s    "none"
-  #define fss_basic_read_delimit_mode_name_all_s     "all"
-  #define fss_basic_read_delimit_mode_name_object_s  "object"
-  #define fss_basic_read_delimit_mode_name_greater_s "+"
-  #define fss_basic_read_delimit_mode_name_lesser_s  "-"
-
-  #define fss_basic_read_delimit_mode_name_none_s_length    4
-  #define fss_basic_read_delimit_mode_name_all_s_length     3
-  #define fss_basic_read_delimit_mode_name_object_s_length  6
-  #define fss_basic_read_delimit_mode_name_greater_s_length 1
-  #define fss_basic_read_delimit_mode_name_lesser_s_length  1
-
-  enum {
-    fss_basic_read_delimit_mode_none_e = 1,
-    fss_basic_read_delimit_mode_all_e,
-    fss_basic_read_delimit_mode_content_e,
-    fss_basic_read_delimit_mode_content_greater_e,
-    fss_basic_read_delimit_mode_content_greater_object_e,
-    fss_basic_read_delimit_mode_content_lesser_e,
-    fss_basic_read_delimit_mode_content_lesser_object_e,
-    fss_basic_read_delimit_mode_content_object_e,
-    fss_basic_read_delimit_mode_object_e,
-  };
-#endif // _di_fss_basic_read_delimit_modes_
-
-#ifndef _di_fss_basic_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_basic_read_main_t;
-
-  #define fss_basic_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_basic_read_main_t_
-
 /**
  * Print help.
  *
@@ -295,25 +99,6 @@ extern "C" {
   extern f_status_t fss_basic_read_main(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_basic_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_read_main()
- */
-#ifndef _di_fss_basic_read_main_delete_
-  extern f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main);
-#endif // _di_fss_basic_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 6555cb58c4340cb418b61053bb7f0030bbde1a17..b16256e4a8b0ac6b1fd605504539cad921cc0b2f 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_basic_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_basic_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_basic_read.h
+build_sources_headers fss_basic_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_basic_write/c/common.c b/level_3/fss_basic_write/c/common.c
new file mode 100644 (file)
index 0000000..2b16896
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_basic_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_write_main_delete_
+  f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_basic_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_basic_write/c/common.h b/level_3/fss_basic_write/c/common.h
new file mode 100644 (file)
index 0000000..1704a32
--- /dev/null
@@ -0,0 +1,181 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_basic_write_common_h
+#define _fss_basic_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_basic_write_program_version_
+  #define FSS_BASIC_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_BASIC_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_BASIC_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_BASIC_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_BASIC_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_BASIC_WRITE_program_version_nano_prefix_s
+    #define FSS_BASIC_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
+    #define FSS_BASIC_WRITE_program_version_nano_s
+    #define FSS_BASIC_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
+
+  #define FSS_BASIC_WRITE_program_version_s FSS_BASIC_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_micro_s FSS_BASIC_WRITE_program_version_nano_prefix_s FSS_BASIC_WRITE_program_version_nano_s
+
+  #define FSS_BASIC_WRITE_program_version_s_length FSS_BASIC_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_micro_s_length + FSS_BASIC_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_basic_write_program_version_s;
+#endif // _di_fss_basic_write_program_version_
+
+#ifndef _di_fss_basic_write_program_name_
+  #define FSS_BASIC_WRITE_program_name_s      "fss_basic_write"
+  #define FSS_BASIC_WRITE_program_name_long_s "FSS Basic Write"
+
+  #define FSS_BASIC_WRITE_program_name_s_length      15
+  #define FSS_BASIC_WRITE_program_name_long_s_length 15
+
+  extern const f_string_static_t fss_basic_write_program_name_s;
+  extern const f_string_static_t fss_basic_write_program_name_long_s;
+#endif // _di_fss_basic_write_program_name_
+
+#ifndef _di_fss_basic_write_defines_
+  #define fss_basic_write_signal_check_d 10000
+
+  #define fss_basic_write_pipe_content_end_s    '\f'
+  #define fss_basic_write_pipe_content_ignore_s '\v'
+  #define fss_basic_write_pipe_content_start_s  '\b'
+
+  #define fss_basic_write_short_file_s    "f"
+  #define fss_basic_write_short_content_s "c"
+  #define fss_basic_write_short_double_s  "d"
+  #define fss_basic_write_short_ignore_s  "I"
+  #define fss_basic_write_short_object_s  "o"
+  #define fss_basic_write_short_partial_s "p"
+  #define fss_basic_write_short_prepend_s "P"
+  #define fss_basic_write_short_single_s  "s"
+  #define fss_basic_write_short_trim_s    "T"
+
+  #define fss_basic_write_long_file_s    "file"
+  #define fss_basic_write_long_content_s "content"
+  #define fss_basic_write_long_double_s  "double"
+  #define fss_basic_write_long_ignore_s  "ignore"
+  #define fss_basic_write_long_object_s  "object"
+  #define fss_basic_write_long_partial_s "partial"
+  #define fss_basic_write_long_prepend_s "prepend"
+  #define fss_basic_write_long_single_s  "single"
+  #define fss_basic_write_long_trim_s    "trim"
+
+  enum {
+    fss_basic_write_parameter_help_e,
+    fss_basic_write_parameter_light_e,
+    fss_basic_write_parameter_dark_e,
+    fss_basic_write_parameter_no_color_e,
+    fss_basic_write_parameter_verbosity_quiet_e,
+    fss_basic_write_parameter_verbosity_normal_e,
+    fss_basic_write_parameter_verbosity_verbose_e,
+    fss_basic_write_parameter_verbosity_debug_e,
+    fss_basic_write_parameter_version_e,
+
+    fss_basic_write_parameter_file_e,
+    fss_basic_write_parameter_content_e,
+    fss_basic_write_parameter_double_e,
+    fss_basic_write_parameter_ignore_e,
+    fss_basic_write_parameter_object_e,
+    fss_basic_write_parameter_partial_e,
+    fss_basic_write_parameter_prepend_e,
+    fss_basic_write_parameter_single_e,
+    fss_basic_write_parameter_trim_e,
+  };
+
+  #define fss_basic_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_file_s, fss_basic_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s, fss_basic_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s, fss_basic_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s, fss_basic_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s, fss_basic_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_basic_write_total_parameters_d 18
+#endif // _di_fss_basic_write_defines_
+
+#ifndef _di_fss_basic_write_data_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_basic_write_main_t;
+
+  #define fss_basic_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_basic_write_data_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_write_main()
+ */
+#ifndef _di_fss_basic_write_main_delete_
+  extern f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main);
+#endif // _di_fss_basic_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_write_common_h
index b17246d118a92f4a14c4167a231a56f16e1e63af..36236b6591843f810830fc878eaff2e6c290cb1b 100644 (file)
@@ -558,19 +558,6 @@ extern "C" {
   }
 #endif // _di_fss_basic_write_main_
 
-#ifndef _di_fss_basic_write_main_delete_
-  f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_basic_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index a869d87d9ee82bf655d88ef43411c6e4901ca3db..ed2fe64a8fd6fff05306dedc6ac63b29f7e9b57d 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Basic Write includes.
+#include <program/fss_basic_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_basic_write_program_version_
-  #define FSS_BASIC_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_BASIC_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_BASIC_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_BASIC_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_BASIC_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_BASIC_WRITE_program_version_nano_prefix_s
-    #define FSS_BASIC_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_prefix_s) && defined(FSS_BASIC_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
-    #define FSS_BASIC_WRITE_program_version_nano_s
-    #define FSS_BASIC_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_BASIC_WRITE_program_version_nano_s) && defined(FSS_BASIC_WRITE_program_version_nano_s_length))
-
-  #define FSS_BASIC_WRITE_program_version_s FSS_BASIC_WRITE_program_version_major_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_period_s FSS_BASIC_WRITE_program_version_micro_s FSS_BASIC_WRITE_program_version_nano_prefix_s FSS_BASIC_WRITE_program_version_nano_s
-
-  #define FSS_BASIC_WRITE_program_version_s_length FSS_BASIC_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_BASIC_WRITE_program_version_micro_s_length + FSS_BASIC_WRITE_program_version_nano_prefix_s_length + FSS_BASIC_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_basic_write_program_version_s;
-#endif // _di_fss_basic_write_program_version_
-
-#ifndef _di_fss_basic_write_program_name_
-  #define FSS_BASIC_WRITE_program_name_s      "fss_basic_write"
-  #define FSS_BASIC_WRITE_program_name_long_s "FSS Basic Write"
-
-  #define FSS_BASIC_WRITE_program_name_s_length      15
-  #define FSS_BASIC_WRITE_program_name_long_s_length 15
-
-  extern const f_string_static_t fss_basic_write_program_name_s;
-  extern const f_string_static_t fss_basic_write_program_name_long_s;
-#endif // _di_fss_basic_write_program_name_
-
-#ifndef _di_fss_basic_write_defines_
-  #define fss_basic_write_signal_check_d 10000
-
-  #define fss_basic_write_pipe_content_end_s    '\f'
-  #define fss_basic_write_pipe_content_ignore_s '\v'
-  #define fss_basic_write_pipe_content_start_s  '\b'
-
-  #define fss_basic_write_short_file_s    "f"
-  #define fss_basic_write_short_content_s "c"
-  #define fss_basic_write_short_double_s  "d"
-  #define fss_basic_write_short_ignore_s  "I"
-  #define fss_basic_write_short_object_s  "o"
-  #define fss_basic_write_short_partial_s "p"
-  #define fss_basic_write_short_prepend_s "P"
-  #define fss_basic_write_short_single_s  "s"
-  #define fss_basic_write_short_trim_s    "T"
-
-  #define fss_basic_write_long_file_s    "file"
-  #define fss_basic_write_long_content_s "content"
-  #define fss_basic_write_long_double_s  "double"
-  #define fss_basic_write_long_ignore_s  "ignore"
-  #define fss_basic_write_long_object_s  "object"
-  #define fss_basic_write_long_partial_s "partial"
-  #define fss_basic_write_long_prepend_s "prepend"
-  #define fss_basic_write_long_single_s  "single"
-  #define fss_basic_write_long_trim_s    "trim"
-
-  enum {
-    fss_basic_write_parameter_help_e,
-    fss_basic_write_parameter_light_e,
-    fss_basic_write_parameter_dark_e,
-    fss_basic_write_parameter_no_color_e,
-    fss_basic_write_parameter_verbosity_quiet_e,
-    fss_basic_write_parameter_verbosity_normal_e,
-    fss_basic_write_parameter_verbosity_verbose_e,
-    fss_basic_write_parameter_verbosity_debug_e,
-    fss_basic_write_parameter_version_e,
-
-    fss_basic_write_parameter_file_e,
-    fss_basic_write_parameter_content_e,
-    fss_basic_write_parameter_double_e,
-    fss_basic_write_parameter_ignore_e,
-    fss_basic_write_parameter_object_e,
-    fss_basic_write_parameter_partial_e,
-    fss_basic_write_parameter_prepend_e,
-    fss_basic_write_parameter_single_e,
-    fss_basic_write_parameter_trim_e,
-  };
-
-  #define fss_basic_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_file_s, fss_basic_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s, fss_basic_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s, fss_basic_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s, fss_basic_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s, fss_basic_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_basic_write_total_parameters_d 18
-#endif // _di_fss_basic_write_defines_
-
-#ifndef _di_fss_basic_write_data_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_basic_write_main_t;
-
-  #define fss_basic_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_basic_write_data_
-
 /**
  * Print help.
  *
@@ -228,24 +91,6 @@ extern "C" {
   extern f_status_t fss_basic_write_main(fss_basic_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_basic_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_write_main()
- */
-#ifndef _di_fss_basic_write_main_delete_
-  extern f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main);
-#endif // _di_fss_basic_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 74e288edbc1a10e85880e0b1a69788cda0a09a9c..5d149cc869c7a2c23cc44d9563c70f0a88bb5cca 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_basic_write.c private-common.c private-write.c
+build_sources_library fss_basic_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_basic_write.h
+build_sources_headers fss_basic_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_embedded_list_read/c/common.c b/level_3/fss_embedded_list_read/c/common.c
new file mode 100644 (file)
index 0000000..99fec5e
--- /dev/null
@@ -0,0 +1,34 @@
+#include "fss_embedded_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_embedded_list_read_main_delete_
+  f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    macro_f_fss_nest_t_delete_simple(main->nest);
+
+    f_string_dynamic_resize(0, &main->buffer);
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_embedded_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_embedded_list_read/c/common.h b/level_3/fss_embedded_list_read/c/common.h
new file mode 100644 (file)
index 0000000..c6e4307
--- /dev/null
@@ -0,0 +1,234 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Embedded List Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_embedded_list_read_common_h
+#define _fss_embedded_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_embedded_list_read_program_version_
+  #define FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EMBEDDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EMBEDDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EMBEDDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EMBEDDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
+    #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s
+    #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
+    #define FSS_EMBEDDED_LIST_READ_program_version_nano_s
+    #define FSS_EMBEDDED_LIST_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
+
+  #define FSS_EMBEDDED_LIST_READ_program_version_s FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_micro_s FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s FSS_EMBEDDED_LIST_READ_program_version_nano_s
+
+  #define FSS_EMBEDDED_LIST_READ_program_version_s_length FSS_EMBEDDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_micro_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_s_length
+
+  extern const f_string_static_t fss_embedded_list_read_program_version_s;
+#endif // _di_fss_embedded_list_read_program_version_
+
+#ifndef _di_fss_embedded_list_read_program_name_
+  #define FSS_EMBEDDED_LIST_READ_program_name_s      "fss_embedded_list_read"
+  #define FSS_EMBEDDED_LIST_READ_program_name_long_s "FSS Embedded List Read"
+
+  #define FSS_EMBEDDED_LIST_READ_program_name_s_length      22
+  #define FSS_EMBEDDED_LIST_READ_program_name_long_s_length 22
+
+  extern const f_string_static_t fss_embedded_list_read_program_name_s;
+  extern const f_string_static_t fss_embedded_list_read_program_name_long_s;
+#endif // _di_fss_embedded_list_read_program_name_
+
+#ifndef _di_fss_embedded_list_read_defines_
+  #define fss_embedded_list_read_signal_check_d 10000
+
+  #define fss_embedded_list_read_pipe_content_end_s    '\f'
+  #define fss_embedded_list_read_pipe_content_ignore_s '\v'
+  #define fss_embedded_list_read_pipe_content_start_s  '\b'
+
+  #define fss_embedded_list_read_short_at_s      "a"
+  #define fss_embedded_list_read_short_content_s "c"
+  #define fss_embedded_list_read_short_columns_s "C"
+  #define fss_embedded_list_read_short_delimit_s "D"
+  #define fss_embedded_list_read_short_depth_s   "d"
+  #define fss_embedded_list_read_short_empty_s   "e"
+  #define fss_embedded_list_read_short_line_s    "l"
+  #define fss_embedded_list_read_short_name_s    "n"
+  #define fss_embedded_list_read_short_object_s  "o"
+  #define fss_embedded_list_read_short_pipe_s    "p"
+  #define fss_embedded_list_read_short_raw_s     "R"
+  #define fss_embedded_list_read_short_select_s  "s"
+  #define fss_embedded_list_read_short_total_s   "t"
+  #define fss_embedded_list_read_short_trim_s    "T"
+
+  #define fss_embedded_list_read_long_at_s      "at"
+  #define fss_embedded_list_read_long_content_s "content"
+  #define fss_embedded_list_read_long_columns_s "columns"
+  #define fss_embedded_list_read_long_delimit_s "delimit"
+  #define fss_embedded_list_read_long_depth_s   "depth"
+  #define fss_embedded_list_read_long_empty_s   "empty"
+  #define fss_embedded_list_read_long_line_s    "line"
+  #define fss_embedded_list_read_long_name_s    "name"
+  #define fss_embedded_list_read_long_object_s  "object"
+  #define fss_embedded_list_read_long_pipe_s    "pipe"
+  #define fss_embedded_list_read_long_raw_s     "raw"
+  #define fss_embedded_list_read_long_select_s  "select"
+  #define fss_embedded_list_read_long_total_s   "total"
+  #define fss_embedded_list_read_long_trim_s    "trim"
+
+  enum {
+    fss_embedded_list_read_parameter_help_e,
+    fss_embedded_list_read_parameter_light_e,
+    fss_embedded_list_read_parameter_dark_e,
+    fss_embedded_list_read_parameter_no_color_e,
+    fss_embedded_list_read_parameter_verbosity_quiet_e,
+    fss_embedded_list_read_parameter_verbosity_normal_e,
+    fss_embedded_list_read_parameter_verbosity_verbose_e,
+    fss_embedded_list_read_parameter_verbosity_debug_e,
+    fss_embedded_list_read_parameter_version_e,
+
+    fss_embedded_list_read_parameter_at_e,
+    fss_embedded_list_read_parameter_content_e,
+    fss_embedded_list_read_parameter_columns_e,
+    fss_embedded_list_read_parameter_delimit_e,
+    fss_embedded_list_read_parameter_depth_e,
+    fss_embedded_list_read_parameter_empty_e,
+    fss_embedded_list_read_parameter_line_e,
+    fss_embedded_list_read_parameter_name_e,
+    fss_embedded_list_read_parameter_object_e,
+    fss_embedded_list_read_parameter_pipe_e,
+    fss_embedded_list_read_parameter_raw_e,
+    fss_embedded_list_read_parameter_select_e,
+    fss_embedded_list_read_parameter_total_e,
+    fss_embedded_list_read_parameter_trim_e,
+  };
+
+  #define fss_embedded_list_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_embedded_list_read_total_parameters_d 23
+#endif // _di_fss_embedded_list_read_defines_
+
+#ifndef _di_fss_embedded_list_read_delimit_mode_
+  #define fss_embedded_list_read_delimit_mode_name_none_s    "none"
+  #define fss_embedded_list_read_delimit_mode_name_all_s     "all"
+  #define fss_embedded_list_read_delimit_mode_name_greater_s "+"
+  #define fss_embedded_list_read_delimit_mode_name_lesser_s  "-"
+
+  #define fss_embedded_list_read_delimit_mode_name_none_s_length    4
+  #define fss_embedded_list_read_delimit_mode_name_all_s_length     3
+  #define fss_embedded_list_read_delimit_mode_name_greater_s_length 1
+  #define fss_embedded_list_read_delimit_mode_name_lesser_s_length  1
+
+  enum {
+    fss_embedded_list_read_delimit_mode_none_e = 1,
+    fss_embedded_list_read_delimit_mode_all_e,
+    fss_embedded_list_read_delimit_mode_depth_e,
+    fss_embedded_list_read_delimit_mode_depth_greater_e,
+    fss_embedded_list_read_delimit_mode_depth_lesser_e,
+  };
+#endif // _di_fss_embedded_list_read_delimit_modes_
+
+#ifndef _di_fss_embedded_list_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_dynamic_t buffer;
+    f_fss_nest_t nest;
+    f_string_quantity_t quantity;
+
+    uint8_t delimit_mode;
+    f_array_length_t delimit_depth;
+
+    f_color_context_t context;
+  } fss_embedded_list_read_main_t;
+
+  #define fss_embedded_list_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_dynamic_t_initialize, \
+      f_fss_nest_t_initialize, \
+      f_string_quantity_t_initialize, \
+      fss_embedded_list_read_delimit_mode_all_e, \
+      0, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_embedded_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_embedded_list_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_embedded_list_read_main()
+ */
+#ifndef _di_fss_embedded_list_read_main_delete_
+  extern f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main);
+#endif // _di_fss_embedded_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_embedded_list_read_common_h
index 52e4b1e0ade762528560dd0b27d9bb3d6c3617e0..f7d2f180d060fa137e8ddb54d8e7513b720f325d 100644 (file)
@@ -372,19 +372,19 @@ extern "C" {
             if (arguments->argv[location][length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) {
               main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_greater_e;
 
-              // shorten the length to better convert the remainder to a number.
+              // Shorten the length to better convert the remainder to a number.
               --length;
             }
             else if (arguments->argv[location][length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) {
               main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_lesser_e;
 
-              // shorten the length to better convert the remainder to a number.
+              // Shorten the length to better convert the remainder to a number.
               --length;
             }
 
             f_string_range_t range = macro_f_string_range_t_initialize(length);
 
-            // ignore leading plus sign.
+            // Ignore leading plus sign.
             if (arguments->argv[location][0] == '+') {
               ++range.start;
             }
@@ -544,22 +544,6 @@ extern "C" {
   }
 #endif // _di_fss_embedded_list_read_main_
 
-#ifndef _di_fss_embedded_list_read_main_delete_
-  f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    macro_f_fss_nest_t_delete_simple(main->nest);
-
-    f_string_dynamic_resize(0, &main->buffer);
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_embedded_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8ca572e4e711b37a36a6469eef2fcf30ab7b3f9c..05b454f1e55b84a54c27653fe6c7c2d386df5e6c 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Embedded List Read includes.
+#include <program/fss_embedded_list_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_embedded_list_read_program_version_
-  #define FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EMBEDDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EMBEDDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EMBEDDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EMBEDDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
-    #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s
-    #define FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
-    #define FSS_EMBEDDED_LIST_READ_program_version_nano_s
-    #define FSS_EMBEDDED_LIST_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_READ_program_version_nano_s_length))
-
-  #define FSS_EMBEDDED_LIST_READ_program_version_s FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_READ_program_version_micro_s FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s FSS_EMBEDDED_LIST_READ_program_version_nano_s
-
-  #define FSS_EMBEDDED_LIST_READ_program_version_s_length FSS_EMBEDDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_READ_program_version_micro_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_READ_program_version_nano_s_length
-
-  extern const f_string_static_t fss_embedded_list_read_program_version_s;
-#endif // _di_fss_embedded_list_read_program_version_
-
-#ifndef _di_fss_embedded_list_read_program_name_
-  #define FSS_EMBEDDED_LIST_READ_program_name_s      "fss_embedded_list_read"
-  #define FSS_EMBEDDED_LIST_READ_program_name_long_s "FSS Embedded List Read"
-
-  #define FSS_EMBEDDED_LIST_READ_program_name_s_length      22
-  #define FSS_EMBEDDED_LIST_READ_program_name_long_s_length 22
-
-  extern const f_string_static_t fss_embedded_list_read_program_name_s;
-  extern const f_string_static_t fss_embedded_list_read_program_name_long_s;
-#endif // _di_fss_embedded_list_read_program_name_
-
-#ifndef _di_fss_embedded_list_read_defines_
-  #define fss_embedded_list_read_signal_check_d 10000
-
-  #define fss_embedded_list_read_pipe_content_end_s    '\f'
-  #define fss_embedded_list_read_pipe_content_ignore_s '\v'
-  #define fss_embedded_list_read_pipe_content_start_s  '\b'
-
-  #define fss_embedded_list_read_short_at_s      "a"
-  #define fss_embedded_list_read_short_content_s "c"
-  #define fss_embedded_list_read_short_columns_s "C"
-  #define fss_embedded_list_read_short_delimit_s "D"
-  #define fss_embedded_list_read_short_depth_s   "d"
-  #define fss_embedded_list_read_short_empty_s   "e"
-  #define fss_embedded_list_read_short_line_s    "l"
-  #define fss_embedded_list_read_short_name_s    "n"
-  #define fss_embedded_list_read_short_object_s  "o"
-  #define fss_embedded_list_read_short_pipe_s    "p"
-  #define fss_embedded_list_read_short_raw_s     "R"
-  #define fss_embedded_list_read_short_select_s  "s"
-  #define fss_embedded_list_read_short_total_s   "t"
-  #define fss_embedded_list_read_short_trim_s    "T"
-
-  #define fss_embedded_list_read_long_at_s      "at"
-  #define fss_embedded_list_read_long_content_s "content"
-  #define fss_embedded_list_read_long_columns_s "columns"
-  #define fss_embedded_list_read_long_delimit_s "delimit"
-  #define fss_embedded_list_read_long_depth_s   "depth"
-  #define fss_embedded_list_read_long_empty_s   "empty"
-  #define fss_embedded_list_read_long_line_s    "line"
-  #define fss_embedded_list_read_long_name_s    "name"
-  #define fss_embedded_list_read_long_object_s  "object"
-  #define fss_embedded_list_read_long_pipe_s    "pipe"
-  #define fss_embedded_list_read_long_raw_s     "raw"
-  #define fss_embedded_list_read_long_select_s  "select"
-  #define fss_embedded_list_read_long_total_s   "total"
-  #define fss_embedded_list_read_long_trim_s    "trim"
-
-  enum {
-    fss_embedded_list_read_parameter_help_e,
-    fss_embedded_list_read_parameter_light_e,
-    fss_embedded_list_read_parameter_dark_e,
-    fss_embedded_list_read_parameter_no_color_e,
-    fss_embedded_list_read_parameter_verbosity_quiet_e,
-    fss_embedded_list_read_parameter_verbosity_normal_e,
-    fss_embedded_list_read_parameter_verbosity_verbose_e,
-    fss_embedded_list_read_parameter_verbosity_debug_e,
-    fss_embedded_list_read_parameter_version_e,
-
-    fss_embedded_list_read_parameter_at_e,
-    fss_embedded_list_read_parameter_content_e,
-    fss_embedded_list_read_parameter_columns_e,
-    fss_embedded_list_read_parameter_delimit_e,
-    fss_embedded_list_read_parameter_depth_e,
-    fss_embedded_list_read_parameter_empty_e,
-    fss_embedded_list_read_parameter_line_e,
-    fss_embedded_list_read_parameter_name_e,
-    fss_embedded_list_read_parameter_object_e,
-    fss_embedded_list_read_parameter_pipe_e,
-    fss_embedded_list_read_parameter_raw_e,
-    fss_embedded_list_read_parameter_select_e,
-    fss_embedded_list_read_parameter_total_e,
-    fss_embedded_list_read_parameter_trim_e,
-  };
-
-  #define fss_embedded_list_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_embedded_list_read_total_parameters_d 23
-#endif // _di_fss_embedded_list_read_defines_
-
-#ifndef _di_fss_embedded_list_read_delimit_mode_
-  #define fss_embedded_list_read_delimit_mode_name_none_s    "none"
-  #define fss_embedded_list_read_delimit_mode_name_all_s     "all"
-  #define fss_embedded_list_read_delimit_mode_name_greater_s "+"
-  #define fss_embedded_list_read_delimit_mode_name_lesser_s  "-"
-
-  #define fss_embedded_list_read_delimit_mode_name_none_s_length    4
-  #define fss_embedded_list_read_delimit_mode_name_all_s_length     3
-  #define fss_embedded_list_read_delimit_mode_name_greater_s_length 1
-  #define fss_embedded_list_read_delimit_mode_name_lesser_s_length  1
-
-  enum {
-    fss_embedded_list_read_delimit_mode_none_e = 1,
-    fss_embedded_list_read_delimit_mode_all_e,
-    fss_embedded_list_read_delimit_mode_depth_e,
-    fss_embedded_list_read_delimit_mode_depth_greater_e,
-    fss_embedded_list_read_delimit_mode_depth_lesser_e,
-  };
-#endif // _di_fss_embedded_list_read_delimit_modes_
-
-#ifndef _di_fss_embedded_list_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_dynamic_t buffer;
-    f_fss_nest_t nest;
-    f_string_quantity_t quantity;
-
-    uint8_t delimit_mode;
-    f_array_length_t delimit_depth;
-
-    f_color_context_t context;
-  } fss_embedded_list_read_main_t;
-
-  #define fss_embedded_list_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_fss_nest_t_initialize, \
-      f_string_quantity_t_initialize, \
-      fss_embedded_list_read_delimit_mode_all_e, \
-      0, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_embedded_list_read_main_t_
-
 /**
  * Print help.
  *
@@ -288,25 +99,6 @@ extern "C" {
   extern f_status_t fss_embedded_list_read_main(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_embedded_list_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_embedded_list_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_embedded_list_read_main()
- */
-#ifndef _di_fss_embedded_list_read_main_delete_
-  extern f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main);
-#endif // _di_fss_embedded_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8a0b67c255a68e6ec99577755fffd82afb55b507..d22a180c74302b9d99ec82253abc7d8c46c06b72 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_embedded_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_embedded_list_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_embedded_list_read.h
+build_sources_headers fss_embedded_list_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_embedded_list_write/c/common.c b/level_3/fss_embedded_list_write/c/common.c
new file mode 100644 (file)
index 0000000..28fdc85
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_embedded_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_embedded_list_write_main_delete_
+  f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_embedded_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_embedded_list_write/c/common.h b/level_3/fss_embedded_list_write/c/common.h
new file mode 100644 (file)
index 0000000..4d09ff3
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Embedded List Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_embedded_list_write_common_h
+#define _fss_embedded_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_embedded_list_write_program_version_
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s
+    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
+    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
+    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
+
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_s FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_micro_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
+
+  #define FSS_EMBEDDED_LIST_WRITE_program_version_s_length FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_embedded_list_write_program_version_s;
+#endif // _di_fss_embedded_list_write_program_version_
+
+#ifndef _di_fss_embedded_list_write_program_name_
+  #define FSS_EMBEDDED_LIST_WRITE_program_name_s      "fss_embedded_list_write"
+  #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s "FSS Embedded List Write"
+
+  #define FSS_EMBEDDED_LIST_WRITE_program_name_s_length      23
+  #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length 23
+
+  extern const f_string_static_t fss_embedded_list_write_program_name_s;
+  extern const f_string_static_t fss_embedded_list_write_program_name_long_s;
+#endif // _di_fss_embedded_list_write_program_name_
+
+#ifndef _di_fss_embedded_list_write_defines_
+  #define fss_embedded_list_write_signal_check_d 10000
+
+  #define fss_embedded_list_write_pipe_content_end_s    '\f'
+  #define fss_embedded_list_write_pipe_content_ignore_s '\v'
+  #define fss_embedded_list_write_pipe_content_start_s  '\b'
+
+  #define fss_embedded_list_write_short_file_s    "f"
+  #define fss_embedded_list_write_short_content_s "c"
+  #define fss_embedded_list_write_short_double_s  "d"
+  #define fss_embedded_list_write_short_ignore_s  "I"
+  #define fss_embedded_list_write_short_object_s  "o"
+  #define fss_embedded_list_write_short_partial_s "p"
+  #define fss_embedded_list_write_short_prepend_s "P"
+  #define fss_embedded_list_write_short_single_s  "s"
+  #define fss_embedded_list_write_short_trim_s    "T"
+
+  #define fss_embedded_list_write_long_file_s    "file"
+  #define fss_embedded_list_write_long_content_s "content"
+  #define fss_embedded_list_write_long_double_s  "double"
+  #define fss_embedded_list_write_long_ignore_s  "ignore"
+  #define fss_embedded_list_write_long_object_s  "object"
+  #define fss_embedded_list_write_long_partial_s "partial"
+  #define fss_embedded_list_write_long_prepend_s "prepend"
+  #define fss_embedded_list_write_long_single_s  "single"
+  #define fss_embedded_list_write_long_trim_s    "trim"
+
+  enum {
+    fss_embedded_list_write_parameter_help_e,
+    fss_embedded_list_write_parameter_light_e,
+    fss_embedded_list_write_parameter_dark_e,
+    fss_embedded_list_write_parameter_no_color_e,
+    fss_embedded_list_write_parameter_verbosity_quiet_e,
+    fss_embedded_list_write_parameter_verbosity_normal_e,
+    fss_embedded_list_write_parameter_verbosity_verbose_e,
+    fss_embedded_list_write_parameter_verbosity_debug_e,
+    fss_embedded_list_write_parameter_version_e,
+
+    fss_embedded_list_write_parameter_file_e,
+    fss_embedded_list_write_parameter_content_e,
+    fss_embedded_list_write_parameter_double_e,
+    fss_embedded_list_write_parameter_ignore_e,
+    fss_embedded_list_write_parameter_object_e,
+    fss_embedded_list_write_parameter_partial_e,
+    fss_embedded_list_write_parameter_prepend_e,
+    fss_embedded_list_write_parameter_single_e,
+    fss_embedded_list_write_parameter_trim_e,
+  };
+
+  #define fss_embedded_list_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_embedded_list_write_total_parameters_d 18
+#endif // _di_fss_embedded_list_write_defines_
+
+#ifndef _di_fss_embedded_list_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t prepend;
+
+    f_color_context_t context;
+  } fss_embedded_list_write_main_t;
+
+  #define fss_embedded_list_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_embedded_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_embedded_list_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_embedded_list_write_main()
+ */
+#ifndef _di_fss_embedded_list_write_main_delete_
+  extern f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main);
+#endif // _di_fss_embedded_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_embedded_list_write_common_h
index 33beebe61e2193fb6dc43200b0f832b150c933d0..7cccab655f18fda5358040f37e9d126d6894e4ad 100644 (file)
@@ -571,19 +571,6 @@ extern "C" {
   }
 #endif // _di_fss_embedded_list_write_main_
 
-#ifndef _di_fss_embedded_list_write_main_delete_
-  f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_embedded_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 8e24dc747bf2170f2fbea8aa56ff92a96effc1c4..e5956564dd39e6482a62e77574b82d32d344fd2c 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Embedded List Write includes.
+#include <program/fss_embedded_list_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_embedded_list_write_program_version_
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s
-    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
-    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
-    #define FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length))
-
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_s FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EMBEDDED_LIST_WRITE_program_version_micro_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s FSS_EMBEDDED_LIST_WRITE_program_version_nano_s
-
-  #define FSS_EMBEDDED_LIST_WRITE_program_version_s_length FSS_EMBEDDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_micro_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EMBEDDED_LIST_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_embedded_list_write_program_version_s;
-#endif // _di_fss_embedded_list_write_program_version_
-
-#ifndef _di_fss_embedded_list_write_program_name_
-  #define FSS_EMBEDDED_LIST_WRITE_program_name_s      "fss_embedded_list_write"
-  #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s "FSS Embedded List Write"
-
-  #define FSS_EMBEDDED_LIST_WRITE_program_name_s_length      23
-  #define FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length 23
-
-  extern const f_string_static_t fss_embedded_list_write_program_name_s;
-  extern const f_string_static_t fss_embedded_list_write_program_name_long_s;
-#endif // _di_fss_embedded_list_write_program_name_
-
-#ifndef _di_fss_embedded_list_write_defines_
-  #define fss_embedded_list_write_signal_check_d 10000
-
-  #define fss_embedded_list_write_pipe_content_end_s    '\f'
-  #define fss_embedded_list_write_pipe_content_ignore_s '\v'
-  #define fss_embedded_list_write_pipe_content_start_s  '\b'
-
-  #define fss_embedded_list_write_short_file_s    "f"
-  #define fss_embedded_list_write_short_content_s "c"
-  #define fss_embedded_list_write_short_double_s  "d"
-  #define fss_embedded_list_write_short_ignore_s  "I"
-  #define fss_embedded_list_write_short_object_s  "o"
-  #define fss_embedded_list_write_short_partial_s "p"
-  #define fss_embedded_list_write_short_prepend_s "P"
-  #define fss_embedded_list_write_short_single_s  "s"
-  #define fss_embedded_list_write_short_trim_s    "T"
-
-  #define fss_embedded_list_write_long_file_s    "file"
-  #define fss_embedded_list_write_long_content_s "content"
-  #define fss_embedded_list_write_long_double_s  "double"
-  #define fss_embedded_list_write_long_ignore_s  "ignore"
-  #define fss_embedded_list_write_long_object_s  "object"
-  #define fss_embedded_list_write_long_partial_s "partial"
-  #define fss_embedded_list_write_long_prepend_s "prepend"
-  #define fss_embedded_list_write_long_single_s  "single"
-  #define fss_embedded_list_write_long_trim_s    "trim"
-
-  enum {
-    fss_embedded_list_write_parameter_help_e,
-    fss_embedded_list_write_parameter_light_e,
-    fss_embedded_list_write_parameter_dark_e,
-    fss_embedded_list_write_parameter_no_color_e,
-    fss_embedded_list_write_parameter_verbosity_quiet_e,
-    fss_embedded_list_write_parameter_verbosity_normal_e,
-    fss_embedded_list_write_parameter_verbosity_verbose_e,
-    fss_embedded_list_write_parameter_verbosity_debug_e,
-    fss_embedded_list_write_parameter_version_e,
-
-    fss_embedded_list_write_parameter_file_e,
-    fss_embedded_list_write_parameter_content_e,
-    fss_embedded_list_write_parameter_double_e,
-    fss_embedded_list_write_parameter_ignore_e,
-    fss_embedded_list_write_parameter_object_e,
-    fss_embedded_list_write_parameter_partial_e,
-    fss_embedded_list_write_parameter_prepend_e,
-    fss_embedded_list_write_parameter_single_e,
-    fss_embedded_list_write_parameter_trim_e,
-  };
-
-  #define fss_embedded_list_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_embedded_list_write_total_parameters_d 18
-#endif // _di_fss_embedded_list_write_defines_
-
-#ifndef _di_fss_embedded_list_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t prepend;
-
-    f_color_context_t context;
-  } fss_embedded_list_write_main_t;
-
-  #define fss_embedded_list_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_embedded_list_write_main_t_
-
 /**
  * Print help.
  *
@@ -232,25 +92,6 @@ extern "C" {
   extern f_status_t fss_embedded_list_write_main(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_embedded_list_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_embedded_list_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_embedded_list_write_main()
- */
-#ifndef _di_fss_embedded_list_write_main_delete_
-  extern f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main);
-#endif // _di_fss_embedded_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c953bdd671c2728d7e22626011313eeff746abb6..d9d73474ee93f547ef0155daf2ae06b19ccdb575 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_embedded_list_write.c private-common.c private-write.c
+build_sources_library fss_embedded_list_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_embedded_list_write.h
+build_sources_headers fss_embedded_list_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_extended_list_read/c/common.c b/level_3/fss_extended_list_read/c/common.c
new file mode 100644 (file)
index 0000000..55823ac
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fss_extended_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_list_read_main_delete_
+  f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_extended_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_extended_list_read/c/common.h b/level_3/fss_extended_list_read/c/common.h
new file mode 100644 (file)
index 0000000..f14c7ae
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended List Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_extended_list_read_common_h
+#define _fss_extended_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_extended_list_read_program_version_
+  #define FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EXTENDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EXTENDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EXTENDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EXTENDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
+    #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s
+    #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
+    #define FSS_EXTENDED_LIST_READ_program_version_nano_s
+    #define FSS_EXTENDED_LIST_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
+
+  #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_version_nano_prefix_s FSS_EXTENDED_LIST_READ_version_nano_s
+
+  #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_version_nano_s_length
+
+  extern const f_string_static_t fss_extended_list_read_program_version_s;
+#endif // _di_fss_extended_list_read_program_version_
+
+#ifndef _di_fss_extended_list_read_program_name_
+  #define FSS_EXTENDED_LIST_READ_program_name_s      "fss_extended_list_read"
+  #define FSS_EXTENDED_LIST_READ_program_name_long_s "FSS Extended List Read"
+
+  #define FSS_EXTENDED_LIST_READ_program_name_s_length      22
+  #define FSS_EXTENDED_LIST_READ_program_name_long_s_length 22
+
+  extern const f_string_static_t fss_extended_list_read_program_name_s;
+  extern const f_string_static_t fss_extended_list_read_program_name_long_s;
+#endif // _di_fss_extended_list_read_program_name_
+
+#ifndef _di_fss_extended_list_read_defines_
+  #define fss_extended_list_read_signal_check_d 10000
+
+  #define fss_extended_list_read_pipe_content_end    '\f'
+  #define fss_extended_list_read_pipe_content_ignore '\v'
+  #define fss_extended_list_read_pipe_content_start  '\b'
+
+  #define fss_extended_list_read_short_at_s      "a"
+  #define fss_extended_list_read_short_content_s "c"
+  #define fss_extended_list_read_short_columns_s "C"
+  #define fss_extended_list_read_short_delimit_s "D"
+  #define fss_extended_list_read_short_depth_s   "d"
+  #define fss_extended_list_read_short_empty_s   "e"
+  #define fss_extended_list_read_short_line_s    "l"
+  #define fss_extended_list_read_short_name_s    "n"
+  #define fss_extended_list_read_short_object_s  "o"
+  #define fss_extended_list_read_short_pipe_s    "p"
+  #define fss_extended_list_read_short_raw_s     "R"
+  #define fss_extended_list_read_short_select_s  "s"
+  #define fss_extended_list_read_short_total_s   "t"
+  #define fss_extended_list_read_short_trim_s    "T"
+
+  #define fss_extended_list_read_long_at_s      "at"
+  #define fss_extended_list_read_long_content_s "content"
+  #define fss_extended_list_read_long_columns_s "columns"
+  #define fss_extended_list_read_long_delimit_s "delimit"
+  #define fss_extended_list_read_long_depth_s   "depth"
+  #define fss_extended_list_read_long_empty_s   "empty"
+  #define fss_extended_list_read_long_line_s    "line"
+  #define fss_extended_list_read_long_name_s    "name"
+  #define fss_extended_list_read_long_object_s  "object"
+  #define fss_extended_list_read_long_pipe_s    "pipe"
+  #define fss_extended_list_read_long_raw_s     "raw"
+  #define fss_extended_list_read_long_select_s  "select"
+  #define fss_extended_list_read_long_total_s   "total"
+  #define fss_extended_list_read_long_trim_s    "trim"
+
+  enum {
+    fss_extended_list_read_parameter_help_e,
+    fss_extended_list_read_parameter_light_e,
+    fss_extended_list_read_parameter_dark_e,
+    fss_extended_list_read_parameter_no_color_e,
+    fss_extended_list_read_parameter_verbosity_quiet_e,
+    fss_extended_list_read_parameter_verbosity_normal_e,
+    fss_extended_list_read_parameter_verbosity_verbose_e,
+    fss_extended_list_read_parameter_verbosity_debug_e,
+    fss_extended_list_read_parameter_version_e,
+
+    fss_extended_list_read_parameter_at_e,
+    fss_extended_list_read_parameter_content_e,
+    fss_extended_list_read_parameter_columns_e,
+    fss_extended_list_read_parameter_delimit_e,
+    fss_extended_list_read_parameter_depth_e,
+    fss_extended_list_read_parameter_empty_e,
+    fss_extended_list_read_parameter_line_e,
+    fss_extended_list_read_parameter_name_e,
+    fss_extended_list_read_parameter_object_e,
+    fss_extended_list_read_parameter_pipe_e,
+    fss_extended_list_read_parameter_raw_e,
+    fss_extended_list_read_parameter_select_e,
+    fss_extended_list_read_parameter_total_e,
+    fss_extended_list_read_parameter_trim_e,
+  };
+
+  #define fss_extended_list_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_extended_list_read_total_parameters_d 23
+#endif // _di_fss_extended_list_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_extended_list_read_delimit_mode_*:
+ *   - all:                    All delimits are to be aplied.
+ *   - content:                Content are to have delimits applied.
+ *   - content_greater:        Content at this number or higher are to have delimits applied.
+ *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ *   - content_lesser:         Content at this number or lower are to have delimits applied.
+ *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
+ *   - content_object:         Objects and Content are to have delimits applied
+ *   - object:                 Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_extended_list_read_delimit_mode_
+  #define fss_extended_list_read_delimit_mode_name_none_s    "none"
+  #define fss_extended_list_read_delimit_mode_name_all_s     "all"
+  #define fss_extended_list_read_delimit_mode_name_object_s  "object"
+  #define fss_extended_list_read_delimit_mode_name_greater_s "+"
+  #define fss_extended_list_read_delimit_mode_name_lesser_s  "-"
+
+  #define fss_extended_list_read_delimit_mode_name_none_s_length    4
+  #define fss_extended_list_read_delimit_mode_name_all_s_length     3
+  #define fss_extended_list_read_delimit_mode_name_object_s_length  6
+  #define fss_extended_list_read_delimit_mode_name_greater_s_length 1
+  #define fss_extended_list_read_delimit_mode_name_lesser_s_length  1
+
+  enum {
+    fss_extended_list_read_delimit_mode_none_e = 1,
+    fss_extended_list_read_delimit_mode_all_e,
+    fss_extended_list_read_delimit_mode_content_e,
+    fss_extended_list_read_delimit_mode_content_greater_e,
+    fss_extended_list_read_delimit_mode_content_greater_object_e,
+    fss_extended_list_read_delimit_mode_content_lesser_e,
+    fss_extended_list_read_delimit_mode_content_lesser_object_e,
+    fss_extended_list_read_delimit_mode_content_object_e,
+    fss_extended_list_read_delimit_mode_object_e,
+  };
+#endif // _di_fss_extended_list_read_delimit_modes_
+
+#ifndef _di_fss_extended_list_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_extended_list_read_main_t;
+
+  #define fss_extended_list_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_extended_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_list_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_list_read_main()
+ */
+#ifndef _di_fss_extended_list_read_main_delete_
+  extern f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main);
+#endif // _di_fss_extended_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_list_read_common_h
index 83c8af5f5fb940fad3325d42dc92875034bb4ef8..18cb5ca66668debad00976823f8ce747b9e7cc85 100644 (file)
@@ -659,18 +659,6 @@ extern "C" {
   }
 #endif // _di_fss_extended_list_read_main_
 
-#ifndef _di_fss_extended_list_read_main_delete_
-  f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_extended_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0b02f3462538a1591fc93a6d1e199bc91842a5f2..cbfef7efed213d02abd526238517bdf48d7d3010 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Extended List Read includes.
+#include <program/fss_extended_list_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_extended_list_read_program_version_
-  #define FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EXTENDED_LIST_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EXTENDED_LIST_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EXTENDED_LIST_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EXTENDED_LIST_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
-    #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s
-    #define FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
-    #define FSS_EXTENDED_LIST_READ_program_version_nano_s
-    #define FSS_EXTENDED_LIST_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length))
-
-  #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_version_nano_prefix_s FSS_EXTENDED_LIST_READ_version_nano_s
-
-  #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_version_nano_s_length
-
-  extern const f_string_static_t fss_extended_list_read_program_version_s;
-#endif // _di_fss_extended_list_read_program_version_
-
-#ifndef _di_fss_extended_list_read_program_name_
-  #define FSS_EXTENDED_LIST_READ_program_name_s      "fss_extended_list_read"
-  #define FSS_EXTENDED_LIST_READ_program_name_long_s "FSS Extended List Read"
-
-  #define FSS_EXTENDED_LIST_READ_program_name_s_length      22
-  #define FSS_EXTENDED_LIST_READ_program_name_long_s_length 22
-
-  extern const f_string_static_t fss_extended_list_read_program_name_s;
-  extern const f_string_static_t fss_extended_list_read_program_name_long_s;
-#endif // _di_fss_extended_list_read_program_name_
-
-#ifndef _di_fss_extended_list_read_defines_
-  #define fss_extended_list_read_signal_check_d 10000
-
-  #define fss_extended_list_read_pipe_content_end    '\f'
-  #define fss_extended_list_read_pipe_content_ignore '\v'
-  #define fss_extended_list_read_pipe_content_start  '\b'
-
-  #define fss_extended_list_read_short_at_s      "a"
-  #define fss_extended_list_read_short_content_s "c"
-  #define fss_extended_list_read_short_columns_s "C"
-  #define fss_extended_list_read_short_delimit_s "D"
-  #define fss_extended_list_read_short_depth_s   "d"
-  #define fss_extended_list_read_short_empty_s   "e"
-  #define fss_extended_list_read_short_line_s    "l"
-  #define fss_extended_list_read_short_name_s    "n"
-  #define fss_extended_list_read_short_object_s  "o"
-  #define fss_extended_list_read_short_pipe_s    "p"
-  #define fss_extended_list_read_short_raw_s     "R"
-  #define fss_extended_list_read_short_select_s  "s"
-  #define fss_extended_list_read_short_total_s   "t"
-  #define fss_extended_list_read_short_trim_s    "T"
-
-  #define fss_extended_list_read_long_at_s      "at"
-  #define fss_extended_list_read_long_content_s "content"
-  #define fss_extended_list_read_long_columns_s "columns"
-  #define fss_extended_list_read_long_delimit_s "delimit"
-  #define fss_extended_list_read_long_depth_s   "depth"
-  #define fss_extended_list_read_long_empty_s   "empty"
-  #define fss_extended_list_read_long_line_s    "line"
-  #define fss_extended_list_read_long_name_s    "name"
-  #define fss_extended_list_read_long_object_s  "object"
-  #define fss_extended_list_read_long_pipe_s    "pipe"
-  #define fss_extended_list_read_long_raw_s     "raw"
-  #define fss_extended_list_read_long_select_s  "select"
-  #define fss_extended_list_read_long_total_s   "total"
-  #define fss_extended_list_read_long_trim_s    "trim"
-
-  enum {
-    fss_extended_list_read_parameter_help_e,
-    fss_extended_list_read_parameter_light_e,
-    fss_extended_list_read_parameter_dark_e,
-    fss_extended_list_read_parameter_no_color_e,
-    fss_extended_list_read_parameter_verbosity_quiet_e,
-    fss_extended_list_read_parameter_verbosity_normal_e,
-    fss_extended_list_read_parameter_verbosity_verbose_e,
-    fss_extended_list_read_parameter_verbosity_debug_e,
-    fss_extended_list_read_parameter_version_e,
-
-    fss_extended_list_read_parameter_at_e,
-    fss_extended_list_read_parameter_content_e,
-    fss_extended_list_read_parameter_columns_e,
-    fss_extended_list_read_parameter_delimit_e,
-    fss_extended_list_read_parameter_depth_e,
-    fss_extended_list_read_parameter_empty_e,
-    fss_extended_list_read_parameter_line_e,
-    fss_extended_list_read_parameter_name_e,
-    fss_extended_list_read_parameter_object_e,
-    fss_extended_list_read_parameter_pipe_e,
-    fss_extended_list_read_parameter_raw_e,
-    fss_extended_list_read_parameter_select_e,
-    fss_extended_list_read_parameter_total_e,
-    fss_extended_list_read_parameter_trim_e,
-  };
-
-  #define fss_extended_list_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_extended_list_read_total_parameters_d 23
-#endif // _di_fss_extended_list_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_extended_list_read_delimit_mode_*:
- *   - all:                    All delimits are to be aplied.
- *   - content:                Content are to have delimits applied.
- *   - content_greater:        Content at this number or higher are to have delimits applied.
- *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- *   - content_lesser:         Content at this number or lower are to have delimits applied.
- *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
- *   - content_object:         Objects and Content are to have delimits applied
- *   - object:                 Objects arre to have delimits applied.
- */
-#ifndef _di_fss_extended_list_read_delimit_mode_
-  #define fss_extended_list_read_delimit_mode_name_none_s    "none"
-  #define fss_extended_list_read_delimit_mode_name_all_s     "all"
-  #define fss_extended_list_read_delimit_mode_name_object_s  "object"
-  #define fss_extended_list_read_delimit_mode_name_greater_s "+"
-  #define fss_extended_list_read_delimit_mode_name_lesser_s  "-"
-
-  #define fss_extended_list_read_delimit_mode_name_none_s_length    4
-  #define fss_extended_list_read_delimit_mode_name_all_s_length     3
-  #define fss_extended_list_read_delimit_mode_name_object_s_length  6
-  #define fss_extended_list_read_delimit_mode_name_greater_s_length 1
-  #define fss_extended_list_read_delimit_mode_name_lesser_s_length  1
-
-  enum {
-    fss_extended_list_read_delimit_mode_none_e = 1,
-    fss_extended_list_read_delimit_mode_all_e,
-    fss_extended_list_read_delimit_mode_content_e,
-    fss_extended_list_read_delimit_mode_content_greater_e,
-    fss_extended_list_read_delimit_mode_content_greater_object_e,
-    fss_extended_list_read_delimit_mode_content_lesser_e,
-    fss_extended_list_read_delimit_mode_content_lesser_object_e,
-    fss_extended_list_read_delimit_mode_content_object_e,
-    fss_extended_list_read_delimit_mode_object_e,
-  };
-#endif // _di_fss_extended_list_read_delimit_modes_
-
-#ifndef _di_fss_extended_list_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_extended_list_read_main_t;
-
-  #define fss_extended_list_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_extended_list_read_main_t_
-
 /**
  * Print help.
  *
@@ -295,25 +99,6 @@ extern "C" {
   extern f_status_t fss_extended_list_read_main(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_extended_list_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_list_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_list_read_main()
- */
-#ifndef _di_fss_extended_list_read_main_delete_
-  extern f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main);
-#endif // _di_fss_extended_list_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1c22e56993b9f0f14238d9802d32039e9f563c0f..f0d57e7d827bd1eadc121ef414ce3d3c40528302 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_extended_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_extended_list_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_extended_list_read.h
+build_sources_headers fss_extended_list_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_extended_list_write/c/common.c b/level_3/fss_extended_list_write/c/common.c
new file mode 100644 (file)
index 0000000..453756d
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_extended_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_list_write_main_delete_
+  f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_extended_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_extended_list_write/c/common.h b/level_3/fss_extended_list_write/c/common.h
new file mode 100644 (file)
index 0000000..3352294
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended List Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_extended_list_write_common_h
+#define _fss_extended_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_extended_list_write_program_version_
+  #define FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EXTENDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s
+    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
+    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s
+    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
+
+  #define FSS_EXTENDED_LIST_WRITE_program_version_s FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_micro_s FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s FSS_EXTENDED_LIST_WRITE_program_version_nano_s
+
+  #define FSS_EXTENDED_LIST_WRITE_program_version_s_length FSS_EXTENDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_extended_list_write_program_version_s;
+#endif // _di_fss_extended_list_write_program_version_
+
+#ifndef _di_fss_extended_list_write_program_name_
+  #define FSS_EXTENDED_LIST_WRITE_program_name_s      "fss_extended_list_write"
+  #define FSS_EXTENDED_LIST_WRITE_program_name_long_s "FSS Extended List Write"
+
+  #define FSS_EXTENDED_LIST_WRITE_program_name_s_length      23
+  #define FSS_EXTENDED_LIST_WRITE_program_name_long_s_length 23
+
+  extern const f_string_static_t fss_extended_list_write_program_name_s;
+  extern const f_string_static_t fss_extended_list_write_program_name_long_s;
+#endif // _di_fss_extended_list_write_program_name_
+
+#ifndef _di_fss_extended_list_write_defines_
+  #define fss_extended_list_write_signal_check_d 10000
+
+  #define fss_extended_list_write_pipe_content_end_s    '\f'
+  #define fss_extended_list_write_pipe_content_ignore_s '\v'
+  #define fss_extended_list_write_pipe_content_start_s  '\b'
+
+  #define fss_extended_list_write_short_file_s    "f"
+  #define fss_extended_list_write_short_content_s "c"
+  #define fss_extended_list_write_short_double_s  "d"
+  #define fss_extended_list_write_short_ignore_s  "I"
+  #define fss_extended_list_write_short_object_s  "o"
+  #define fss_extended_list_write_short_partial_s "p"
+  #define fss_extended_list_write_short_prepend_s "P"
+  #define fss_extended_list_write_short_single_s  "s"
+  #define fss_extended_list_write_short_trim_s    "T"
+
+  #define fss_extended_list_write_long_file_s    "file"
+  #define fss_extended_list_write_long_content_s "content"
+  #define fss_extended_list_write_long_double_s  "double"
+  #define fss_extended_list_write_long_ignore_s  "ignore"
+  #define fss_extended_list_write_long_object_s  "object"
+  #define fss_extended_list_write_long_partial_s "partial"
+  #define fss_extended_list_write_long_prepend_s "prepend"
+  #define fss_extended_list_write_long_single_s  "single"
+  #define fss_extended_list_write_long_trim_s    "trim"
+
+  enum {
+    fss_extended_list_write_parameter_help_e,
+    fss_extended_list_write_parameter_light_e,
+    fss_extended_list_write_parameter_dark_e,
+    fss_extended_list_write_parameter_no_color_e,
+    fss_extended_list_write_parameter_verbosity_quiet_e,
+    fss_extended_list_write_parameter_verbosity_normal_e,
+    fss_extended_list_write_parameter_verbosity_verbose_e,
+    fss_extended_list_write_parameter_verbosity_debug_e,
+    fss_extended_list_write_parameter_version_e,
+
+    fss_extended_list_write_parameter_file_e,
+    fss_extended_list_write_parameter_content_e,
+    fss_extended_list_write_parameter_double_e,
+    fss_extended_list_write_parameter_ignore_e,
+    fss_extended_list_write_parameter_object_e,
+    fss_extended_list_write_parameter_partial_e,
+    fss_extended_list_write_parameter_prepend_e,
+    fss_extended_list_write_parameter_single_e,
+    fss_extended_list_write_parameter_trim_e,
+  };
+
+  #define fss_extended_list_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_extended_list_write_total_parameters_d 18
+#endif // _di_fss_extended_list_write_defines_
+
+#ifndef _di_fss_extended_list_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t prepend;
+
+    f_color_context_t context;
+  } fss_extended_list_write_main_t;
+
+  #define fss_extended_list_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_extended_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_list_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_list_write_main()
+ */
+#ifndef _di_fss_extended_list_write_main_delete_
+  extern f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main);
+#endif // _di_fss_extended_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_list_write_common_h
index f08d312e44dcba91036a9cc61ce7189c4d82eec4..1f7ff5753dce65b81c7c7b46b95b8f31cbd7a0f5 100644 (file)
@@ -570,19 +570,6 @@ extern "C" {
   }
 #endif // _di_fss_extended_list_write_main_
 
-#ifndef _di_fss_extended_list_write_main_delete_
-  f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_extended_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index dc8f067bc22fb7da4a5472596a80cb64bfaa0f72..c6d34bc899743c9e0022ac3e718b4cf70a3de841 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Extended List Write includes.
+#include <program/fss_extended_list_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_extended_list_write_program_version_
-  #define FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EXTENDED_LIST_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s
-    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
-    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s
-    #define FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length))
-
-  #define FSS_EXTENDED_LIST_WRITE_program_version_s FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_WRITE_program_version_micro_s FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s FSS_EXTENDED_LIST_WRITE_program_version_nano_s
-
-  #define FSS_EXTENDED_LIST_WRITE_program_version_s_length FSS_EXTENDED_LIST_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_WRITE_program_version_micro_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_LIST_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_extended_list_write_program_version_s;
-#endif // _di_fss_extended_list_write_program_version_
-
-#ifndef _di_fss_extended_list_write_program_name_
-  #define FSS_EXTENDED_LIST_WRITE_program_name_s      "fss_extended_list_write"
-  #define FSS_EXTENDED_LIST_WRITE_program_name_long_s "FSS Extended List Write"
-
-  #define FSS_EXTENDED_LIST_WRITE_program_name_s_length      23
-  #define FSS_EXTENDED_LIST_WRITE_program_name_long_s_length 23
-
-  extern const f_string_static_t fss_extended_list_write_program_name_s;
-  extern const f_string_static_t fss_extended_list_write_program_name_long_s;
-#endif // _di_fss_extended_list_write_program_name_
-
-#ifndef _di_fss_extended_list_write_defines_
-  #define fss_extended_list_write_signal_check_d 10000
-
-  #define fss_extended_list_write_pipe_content_end_s    '\f'
-  #define fss_extended_list_write_pipe_content_ignore_s '\v'
-  #define fss_extended_list_write_pipe_content_start_s  '\b'
-
-  #define fss_extended_list_write_short_file_s    "f"
-  #define fss_extended_list_write_short_content_s "c"
-  #define fss_extended_list_write_short_double_s  "d"
-  #define fss_extended_list_write_short_ignore_s  "I"
-  #define fss_extended_list_write_short_object_s  "o"
-  #define fss_extended_list_write_short_partial_s "p"
-  #define fss_extended_list_write_short_prepend_s "P"
-  #define fss_extended_list_write_short_single_s  "s"
-  #define fss_extended_list_write_short_trim_s    "T"
-
-  #define fss_extended_list_write_long_file_s    "file"
-  #define fss_extended_list_write_long_content_s "content"
-  #define fss_extended_list_write_long_double_s  "double"
-  #define fss_extended_list_write_long_ignore_s  "ignore"
-  #define fss_extended_list_write_long_object_s  "object"
-  #define fss_extended_list_write_long_partial_s "partial"
-  #define fss_extended_list_write_long_prepend_s "prepend"
-  #define fss_extended_list_write_long_single_s  "single"
-  #define fss_extended_list_write_long_trim_s    "trim"
-
-  enum {
-    fss_extended_list_write_parameter_help_e,
-    fss_extended_list_write_parameter_light_e,
-    fss_extended_list_write_parameter_dark_e,
-    fss_extended_list_write_parameter_no_color_e,
-    fss_extended_list_write_parameter_verbosity_quiet_e,
-    fss_extended_list_write_parameter_verbosity_normal_e,
-    fss_extended_list_write_parameter_verbosity_verbose_e,
-    fss_extended_list_write_parameter_verbosity_debug_e,
-    fss_extended_list_write_parameter_version_e,
-
-    fss_extended_list_write_parameter_file_e,
-    fss_extended_list_write_parameter_content_e,
-    fss_extended_list_write_parameter_double_e,
-    fss_extended_list_write_parameter_ignore_e,
-    fss_extended_list_write_parameter_object_e,
-    fss_extended_list_write_parameter_partial_e,
-    fss_extended_list_write_parameter_prepend_e,
-    fss_extended_list_write_parameter_single_e,
-    fss_extended_list_write_parameter_trim_e,
-  };
-
-  #define fss_extended_list_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_extended_list_write_total_parameters_d 18
-#endif // _di_fss_extended_list_write_defines_
-
-#ifndef _di_fss_extended_list_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t prepend;
-
-    f_color_context_t context;
-  } fss_extended_list_write_main_t;
-
-  #define fss_extended_list_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_extended_list_write_main_t_
-
 /**
  * Print help.
  *
@@ -232,25 +92,6 @@ extern "C" {
   extern f_status_t fss_extended_list_write_main(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_extended_list_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_list_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_list_write_main()
- */
-#ifndef _di_fss_extended_list_write_main_delete_
-  extern f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main);
-#endif // _di_fss_extended_list_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 27b3a093ab20ecedc48ed272239112d4de0c3e4c..7f7093514e860e85303c15b73ed9a5ec617e67f5 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_extended_list_write.c private-common.c private-write.c
+build_sources_library fss_extended_list_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_extended_list_write.h
+build_sources_headers fss_extended_list_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_extended_read/c/common.c b/level_3/fss_extended_read/c/common.c
new file mode 100644 (file)
index 0000000..5721f09
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fss_extended_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_read_main_delete_
+  f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_extended_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_extended_read/c/common.h b/level_3/fss_extended_read/c/common.h
new file mode 100644 (file)
index 0000000..d20dcda
--- /dev/null
@@ -0,0 +1,242 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_extended_read_common_h
+#define _fss_extended_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_extended_read_program_version_
+  #define FSS_EXTENDED_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EXTENDED_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EXTENDED_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EXTENDED_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EXTENDED_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
+    #define FSS_EXTENDED_READ_program_version_nano_prefix_s
+    #define FSS_EXTENDED_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
+    #define FSS_EXTENDED_READ_program_version_nano_s
+    #define FSS_EXTENDED_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
+
+  #define FSS_EXTENDED_READ_program_version_s FSS_EXTENDED_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_micro_s FSS_EXTENDED_READ_program_version_nano_prefix_s FSS_EXTENDED_READ_program_version_nano_s
+
+  #define FSS_EXTENDED_READ_program_version_s_length FSS_EXTENDED_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_micro_s_length + FSS_EXTENDED_READ_program_version_nano_prefix_s_length + FSS_EXTENDED_READ_program_version_nano_s_length
+
+  extern const f_string_static_t fss_extended_read_program_version_s;
+#endif // _di_fss_extended_read_program_version_
+
+#ifndef _di_fss_extended_read_program_name_
+  #define FSS_EXTENDED_READ_program_name_s      "fss_extended_read"
+  #define FSS_EXTENDED_READ_program_name_long_s "FSS Extended Read"
+
+  #define FSS_EXTENDED_READ_program_name_s_length      17
+  #define FSS_EXTENDED_READ_program_name_long_s_length 17
+
+  extern const f_string_static_t fss_extended_read_program_name_s;
+  extern const f_string_static_t fss_extended_read_program_name_long_s;
+#endif // _di_fss_extended_read_program_name_
+
+#ifndef _di_fss_extended_read_defines_
+  #define fss_extended_read_signal_check_d 10000
+
+  #define fss_extended_read_pipe_content_end_s    '\f'
+  #define fss_extended_read_pipe_content_ignore_s '\v'
+  #define fss_extended_read_pipe_content_start_s  '\b'
+
+  #define fss_extended_read_short_at_s      "a"
+  #define fss_extended_read_short_content_s "c"
+  #define fss_extended_read_short_columns_s "C"
+  #define fss_extended_read_short_delimit_s "D"
+  #define fss_extended_read_short_depth_s   "d"
+  #define fss_extended_read_short_empty_s   "e"
+  #define fss_extended_read_short_line_s    "l"
+  #define fss_extended_read_short_name_s    "n"
+  #define fss_extended_read_short_object_s  "o"
+  #define fss_extended_read_short_pipe_s    "p"
+  #define fss_extended_read_short_raw_s     "R"
+  #define fss_extended_read_short_select_s  "s"
+  #define fss_extended_read_short_total_s   "t"
+  #define fss_extended_read_short_trim_s    "T"
+
+  #define fss_extended_read_long_at_s      "at"
+  #define fss_extended_read_long_content_s "content"
+  #define fss_extended_read_long_columns_s "columns"
+  #define fss_extended_read_long_delimit_s "delimit"
+  #define fss_extended_read_long_depth_s   "depth"
+  #define fss_extended_read_long_empty_s   "empty"
+  #define fss_extended_read_long_line_s    "line"
+  #define fss_extended_read_long_name_s    "name"
+  #define fss_extended_read_long_object_s  "object"
+  #define fss_extended_read_long_pipe_s    "pipe"
+  #define fss_extended_read_long_raw_s     "raw"
+  #define fss_extended_read_long_select_s  "select"
+  #define fss_extended_read_long_total_s   "total"
+  #define fss_extended_read_long_trim_s    "trim"
+
+  enum {
+    fss_extended_read_parameter_help_e,
+    fss_extended_read_parameter_light_e,
+    fss_extended_read_parameter_dark_e,
+    fss_extended_read_parameter_no_color_e,
+    fss_extended_read_parameter_verbosity_quiet_e,
+    fss_extended_read_parameter_verbosity_normal_e,
+    fss_extended_read_parameter_verbosity_verbose_e,
+    fss_extended_read_parameter_verbosity_debug_e,
+    fss_extended_read_parameter_version_e,
+
+    fss_extended_read_parameter_at_e,
+    fss_extended_read_parameter_content_e,
+    fss_extended_read_parameter_columns_e,
+    fss_extended_read_parameter_delimit_e,
+    fss_extended_read_parameter_depth_e,
+    fss_extended_read_parameter_empty_e,
+    fss_extended_read_parameter_line_e,
+    fss_extended_read_parameter_name_e,
+    fss_extended_read_parameter_object_e,
+    fss_extended_read_parameter_pipe_e,
+    fss_extended_read_parameter_raw_e,
+    fss_extended_read_parameter_select_e,
+    fss_extended_read_parameter_total_e,
+    fss_extended_read_parameter_trim_e,
+  };
+
+  #define fss_extended_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_at_s, fss_extended_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s, fss_extended_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s, fss_extended_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s, fss_extended_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s, fss_extended_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s, fss_extended_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_extended_read_total_parameters_d 23
+#endif // _di_fss_extended_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_extended_read_delimit_mode_*:
+ *   - all:                    All delimits are to be aplied.
+ *   - content:                Content are to have delimits applied.
+ *   - content_greater:        Content at this number or higher are to have delimits applied.
+ *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ *   - content_lesser:         Content at this number or lower are to have delimits applied.
+ *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
+ *   - content_object:         Objects and Content are to have delimits applied
+ *   - 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
+
+  enum {
+    fss_extended_read_delimit_mode_none_e = 1,
+    fss_extended_read_delimit_mode_all_e,
+    fss_extended_read_delimit_mode_content_e,
+    fss_extended_read_delimit_mode_content_greater_e,
+    fss_extended_read_delimit_mode_content_greater_object_e,
+    fss_extended_read_delimit_mode_content_lesser_e,
+    fss_extended_read_delimit_mode_content_lesser_object_e,
+    fss_extended_read_delimit_mode_content_object_e,
+    fss_extended_read_delimit_mode_object_e,
+  };
+#endif // _di_fss_extended_read_delimit_modes_
+
+
+#ifndef _di_fss_extended_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_extended_read_main_t;
+
+  #define fss_extended_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_extended_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_read_main()
+ */
+#ifndef _di_fss_extended_read_main_delete_
+  extern f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main);
+#endif // _di_fss_extended_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_read_common_h
index dba541ff5f64ee2f32d3a4178d0c741be4fea43c..30eb18f4cf26ab149f3a8d11a2c5c6f151e4ef35 100644 (file)
@@ -666,18 +666,6 @@ extern "C" {
   }
 #endif // _di_fss_extended_read_main_
 
-#ifndef _di_fss_extended_read_main_delete_
-  f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_extended_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 406d946efc39ffa6bae415bf7e6536ebd18d404a..aea06f9af45e54944a6dd837ff452e1e5f5e4ae3 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Extended Read includes.
+#include <program/fss_extended_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_extended_read_program_version_
-  #define FSS_EXTENDED_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EXTENDED_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EXTENDED_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EXTENDED_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EXTENDED_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
-    #define FSS_EXTENDED_READ_program_version_nano_prefix_s
-    #define FSS_EXTENDED_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_prefix_s) && defined(FSS_EXTENDED_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
-    #define FSS_EXTENDED_READ_program_version_nano_s
-    #define FSS_EXTENDED_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EXTENDED_READ_program_version_nano_s) && defined(FSS_EXTENDED_READ_program_version_nano_s_length))
-
-  #define FSS_EXTENDED_READ_program_version_s FSS_EXTENDED_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_READ_program_version_micro_s FSS_EXTENDED_READ_program_version_nano_prefix_s FSS_EXTENDED_READ_program_version_nano_s
-
-  #define FSS_EXTENDED_READ_program_version_s_length FSS_EXTENDED_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_READ_program_version_micro_s_length + FSS_EXTENDED_READ_program_version_nano_prefix_s_length + FSS_EXTENDED_READ_program_version_nano_s_length
-
-  extern const f_string_static_t fss_extended_read_program_version_s;
-#endif // _di_fss_extended_read_program_version_
-
-#ifndef _di_fss_extended_read_program_name_
-  #define FSS_EXTENDED_READ_program_name_s      "fss_extended_read"
-  #define FSS_EXTENDED_READ_program_name_long_s "FSS Extended Read"
-
-  #define FSS_EXTENDED_READ_program_name_s_length      17
-  #define FSS_EXTENDED_READ_program_name_long_s_length 17
-
-  extern const f_string_static_t fss_extended_read_program_name_s;
-  extern const f_string_static_t fss_extended_read_program_name_long_s;
-#endif // _di_fss_extended_read_program_name_
-
-#ifndef _di_fss_extended_read_defines_
-  #define fss_extended_read_signal_check_d 10000
-
-  #define fss_extended_read_pipe_content_end_s    '\f'
-  #define fss_extended_read_pipe_content_ignore_s '\v'
-  #define fss_extended_read_pipe_content_start_s  '\b'
-
-  #define fss_extended_read_short_at_s      "a"
-  #define fss_extended_read_short_content_s "c"
-  #define fss_extended_read_short_columns_s "C"
-  #define fss_extended_read_short_delimit_s "D"
-  #define fss_extended_read_short_depth_s   "d"
-  #define fss_extended_read_short_empty_s   "e"
-  #define fss_extended_read_short_line_s    "l"
-  #define fss_extended_read_short_name_s    "n"
-  #define fss_extended_read_short_object_s  "o"
-  #define fss_extended_read_short_pipe_s    "p"
-  #define fss_extended_read_short_raw_s     "R"
-  #define fss_extended_read_short_select_s  "s"
-  #define fss_extended_read_short_total_s   "t"
-  #define fss_extended_read_short_trim_s    "T"
-
-  #define fss_extended_read_long_at_s      "at"
-  #define fss_extended_read_long_content_s "content"
-  #define fss_extended_read_long_columns_s "columns"
-  #define fss_extended_read_long_delimit_s "delimit"
-  #define fss_extended_read_long_depth_s   "depth"
-  #define fss_extended_read_long_empty_s   "empty"
-  #define fss_extended_read_long_line_s    "line"
-  #define fss_extended_read_long_name_s    "name"
-  #define fss_extended_read_long_object_s  "object"
-  #define fss_extended_read_long_pipe_s    "pipe"
-  #define fss_extended_read_long_raw_s     "raw"
-  #define fss_extended_read_long_select_s  "select"
-  #define fss_extended_read_long_total_s   "total"
-  #define fss_extended_read_long_trim_s    "trim"
-
-  enum {
-    fss_extended_read_parameter_help_e,
-    fss_extended_read_parameter_light_e,
-    fss_extended_read_parameter_dark_e,
-    fss_extended_read_parameter_no_color_e,
-    fss_extended_read_parameter_verbosity_quiet_e,
-    fss_extended_read_parameter_verbosity_normal_e,
-    fss_extended_read_parameter_verbosity_verbose_e,
-    fss_extended_read_parameter_verbosity_debug_e,
-    fss_extended_read_parameter_version_e,
-
-    fss_extended_read_parameter_at_e,
-    fss_extended_read_parameter_content_e,
-    fss_extended_read_parameter_columns_e,
-    fss_extended_read_parameter_delimit_e,
-    fss_extended_read_parameter_depth_e,
-    fss_extended_read_parameter_empty_e,
-    fss_extended_read_parameter_line_e,
-    fss_extended_read_parameter_name_e,
-    fss_extended_read_parameter_object_e,
-    fss_extended_read_parameter_pipe_e,
-    fss_extended_read_parameter_raw_e,
-    fss_extended_read_parameter_select_e,
-    fss_extended_read_parameter_total_e,
-    fss_extended_read_parameter_trim_e,
-  };
-
-  #define fss_extended_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_at_s, fss_extended_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s, fss_extended_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s, fss_extended_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s, fss_extended_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s, fss_extended_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s, fss_extended_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_extended_read_total_parameters_d 23
-#endif // _di_fss_extended_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_extended_read_delimit_mode_*:
- *   - all:                    All delimits are to be aplied.
- *   - content:                Content are to have delimits applied.
- *   - content_greater:        Content at this number or higher are to have delimits applied.
- *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- *   - content_lesser:         Content at this number or lower are to have delimits applied.
- *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
- *   - content_object:         Objects and Content are to have delimits applied
- *   - 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
-
-  enum {
-    fss_extended_read_delimit_mode_none_e = 1,
-    fss_extended_read_delimit_mode_all_e,
-    fss_extended_read_delimit_mode_content_e,
-    fss_extended_read_delimit_mode_content_greater_e,
-    fss_extended_read_delimit_mode_content_greater_object_e,
-    fss_extended_read_delimit_mode_content_lesser_e,
-    fss_extended_read_delimit_mode_content_lesser_object_e,
-    fss_extended_read_delimit_mode_content_object_e,
-    fss_extended_read_delimit_mode_object_e,
-  };
-#endif // _di_fss_extended_read_delimit_modes_
-
-
-#ifndef _di_fss_extended_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_extended_read_main_t;
-
-  #define fss_extended_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_extended_read_main_t_
-
 /**
  * Print help.
  *
@@ -296,25 +99,6 @@ extern "C" {
   extern f_status_t fss_extended_read_main(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_extended_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_read_main()
- */
-#ifndef _di_fss_extended_read_main_delete_
-  extern f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main);
-#endif // _di_fss_extended_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index f82ea349871613c60692e3a6d5ba535effc43172..88b2ec0ee5ca4c3946bf011cc9f8a33283c58ea8 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_extended_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_extended_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_extended_read.h
+build_sources_headers fss_extended_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_extended_write/c/common.c b/level_3/fss_extended_write/c/common.c
new file mode 100644 (file)
index 0000000..1150784
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_extended_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_write_main_delete_
+  f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_extended_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_extended_write/c/common.h b/level_3/fss_extended_write/c/common.h
new file mode 100644 (file)
index 0000000..1d5480c
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_extended_write_common_h
+#define _fss_extended_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_extended_write_program_version_
+  #define FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_EXTENDED_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_EXTENDED_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_EXTENDED_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_EXTENDED_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s
+    #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
+    #define FSS_EXTENDED_WRITE_program_version_nano_s
+    #define FSS_EXTENDED_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
+
+  #define FSS_EXTENDED_WRITE_program_version_s FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_micro_s FSS_EXTENDED_WRITE_program_version_nano_prefix_s FSS_EXTENDED_WRITE_program_version_nano_s
+
+  #define FSS_EXTENDED_WRITE_program_version_s_length FSS_EXTENDED_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_micro_s_length + FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_extended_write_program_version_s;
+#endif // _di_fss_extended_write_program_version_
+
+#ifndef _di_fss_extended_write_program_name_
+  #define FSS_EXTENDED_WRITE_program_name_s      "fss_extended_write"
+  #define FSS_EXTENDED_WRITE_program_name_long_s "FSS Extended Write"
+
+  #define FSS_EXTENDED_WRITE_program_name_s_length      18
+  #define FSS_EXTENDED_WRITE_program_name_long_s_length 18
+
+  extern const f_string_static_t fss_extended_write_program_name_s;
+  extern const f_string_static_t fss_extended_write_program_name_long_s;
+#endif // _di_fss_extended_write_program_name_
+
+#ifndef _di_fss_extended_write_defines_
+  #define fss_extended_write_signal_check_d 10000
+
+  #define fss_extended_write_pipe_content_end_s    '\f'
+  #define fss_extended_write_pipe_content_ignore_s '\v'
+  #define fss_extended_write_pipe_content_start_s  '\b'
+
+  #define fss_extended_write_short_file_s    "f"
+  #define fss_extended_write_short_content_s "c"
+  #define fss_extended_write_short_double_s  "d"
+  #define fss_extended_write_short_ignore_s  "I"
+  #define fss_extended_write_short_object_s  "o"
+  #define fss_extended_write_short_partial_s "p"
+  #define fss_extended_write_short_prepend_s "P"
+  #define fss_extended_write_short_single_s  "s"
+  #define fss_extended_write_short_trim_s    "T"
+
+  #define fss_extended_write_long_file_s    "file"
+  #define fss_extended_write_long_content_s "content"
+  #define fss_extended_write_long_double_s  "double"
+  #define fss_extended_write_long_ignore_s  "ignore"
+  #define fss_extended_write_long_object_s  "object"
+  #define fss_extended_write_long_partial_s "partial"
+  #define fss_extended_write_long_prepend_s "prepend"
+  #define fss_extended_write_long_single_s  "single"
+  #define fss_extended_write_long_trim_s    "trim"
+
+  enum {
+    fss_extended_write_parameter_help_e,
+    fss_extended_write_parameter_light_e,
+    fss_extended_write_parameter_dark_e,
+    fss_extended_write_parameter_no_color_e,
+    fss_extended_write_parameter_verbosity_quiet_e,
+    fss_extended_write_parameter_verbosity_normal_e,
+    fss_extended_write_parameter_verbosity_verbose_e,
+    fss_extended_write_parameter_verbosity_debug_e,
+    fss_extended_write_parameter_version_e,
+
+    fss_extended_write_parameter_file_e,
+    fss_extended_write_parameter_content_e,
+    fss_extended_write_parameter_double_e,
+    fss_extended_write_parameter_ignore_e,
+    fss_extended_write_parameter_object_e,
+    fss_extended_write_parameter_partial_e,
+    fss_extended_write_parameter_prepend_e,
+    fss_extended_write_parameter_single_e,
+    fss_extended_write_parameter_trim_e,
+  };
+
+  #define fss_extended_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s, fss_extended_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s, fss_extended_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s, fss_extended_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s, fss_extended_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s, fss_extended_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_extended_write_total_parameters_d 18
+#endif // _di_fss_extended_write_defines_
+
+#ifndef _di_fss_extended_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t prepend;
+
+    f_color_context_t context;
+  } fss_extended_write_main_t;
+
+  #define fss_extended_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_extended_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_write_main()
+ */
+#ifndef _di_fss_extended_write_main_delete_
+  extern f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main);
+#endif // _di_fss_extended_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_write_common_h
index 9ddb4bedfc85df8922724dfa4786730620b78074..d898e2eab072edd04a0ea0d2088deaeb4716c884 100644 (file)
@@ -642,19 +642,6 @@ extern "C" {
   }
 #endif // _di_fss_extended_write_main_
 
-#ifndef _di_fss_extended_write_main_delete_
-  f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_extended_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e15e9dad27cd249016593a0c64112cf37c4eada5..d60aea75886b719e66ff30aaab823e11f8dd29a0 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Extended Write includes.
+#include <program/fss_extended_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_extended_write_program_version_
-  #define FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_EXTENDED_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_EXTENDED_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_EXTENDED_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_EXTENDED_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s
-    #define FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
-    #define FSS_EXTENDED_WRITE_program_version_nano_s
-    #define FSS_EXTENDED_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_EXTENDED_WRITE_program_version_nano_s) && defined(FSS_EXTENDED_WRITE_program_version_nano_s_length))
-
-  #define FSS_EXTENDED_WRITE_program_version_s FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_WRITE_program_version_micro_s FSS_EXTENDED_WRITE_program_version_nano_prefix_s FSS_EXTENDED_WRITE_program_version_nano_s
-
-  #define FSS_EXTENDED_WRITE_program_version_s_length FSS_EXTENDED_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_WRITE_program_version_micro_s_length + FSS_EXTENDED_WRITE_program_version_nano_prefix_s_length + FSS_EXTENDED_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_extended_write_program_version_s;
-#endif // _di_fss_extended_write_program_version_
-
-#ifndef _di_fss_extended_write_program_name_
-  #define FSS_EXTENDED_WRITE_program_name_s      "fss_extended_write"
-  #define FSS_EXTENDED_WRITE_program_name_long_s "FSS Extended Write"
-
-  #define FSS_EXTENDED_WRITE_program_name_s_length      18
-  #define FSS_EXTENDED_WRITE_program_name_long_s_length 18
-
-  extern const f_string_static_t fss_extended_write_program_name_s;
-  extern const f_string_static_t fss_extended_write_program_name_long_s;
-#endif // _di_fss_extended_write_program_name_
-
-#ifndef _di_fss_extended_write_defines_
-  #define fss_extended_write_signal_check_d 10000
-
-  #define fss_extended_write_pipe_content_end_s    '\f'
-  #define fss_extended_write_pipe_content_ignore_s '\v'
-  #define fss_extended_write_pipe_content_start_s  '\b'
-
-  #define fss_extended_write_short_file_s    "f"
-  #define fss_extended_write_short_content_s "c"
-  #define fss_extended_write_short_double_s  "d"
-  #define fss_extended_write_short_ignore_s  "I"
-  #define fss_extended_write_short_object_s  "o"
-  #define fss_extended_write_short_partial_s "p"
-  #define fss_extended_write_short_prepend_s "P"
-  #define fss_extended_write_short_single_s  "s"
-  #define fss_extended_write_short_trim_s    "T"
-
-  #define fss_extended_write_long_file_s    "file"
-  #define fss_extended_write_long_content_s "content"
-  #define fss_extended_write_long_double_s  "double"
-  #define fss_extended_write_long_ignore_s  "ignore"
-  #define fss_extended_write_long_object_s  "object"
-  #define fss_extended_write_long_partial_s "partial"
-  #define fss_extended_write_long_prepend_s "prepend"
-  #define fss_extended_write_long_single_s  "single"
-  #define fss_extended_write_long_trim_s    "trim"
-
-  enum {
-    fss_extended_write_parameter_help_e,
-    fss_extended_write_parameter_light_e,
-    fss_extended_write_parameter_dark_e,
-    fss_extended_write_parameter_no_color_e,
-    fss_extended_write_parameter_verbosity_quiet_e,
-    fss_extended_write_parameter_verbosity_normal_e,
-    fss_extended_write_parameter_verbosity_verbose_e,
-    fss_extended_write_parameter_verbosity_debug_e,
-    fss_extended_write_parameter_version_e,
-
-    fss_extended_write_parameter_file_e,
-    fss_extended_write_parameter_content_e,
-    fss_extended_write_parameter_double_e,
-    fss_extended_write_parameter_ignore_e,
-    fss_extended_write_parameter_object_e,
-    fss_extended_write_parameter_partial_e,
-    fss_extended_write_parameter_prepend_e,
-    fss_extended_write_parameter_single_e,
-    fss_extended_write_parameter_trim_e,
-  };
-
-  #define fss_extended_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s, fss_extended_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s, fss_extended_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s, fss_extended_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s, fss_extended_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s, fss_extended_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_extended_write_total_parameters_d 18
-#endif // _di_fss_extended_write_defines_
-
-#ifndef _di_fss_extended_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t prepend;
-
-    f_color_context_t context;
-  } fss_extended_write_main_t;
-
-  #define fss_extended_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_extended_write_main_t_
-
 /**
  * Print help.
  *
@@ -231,25 +91,6 @@ extern "C" {
   extern f_status_t fss_extended_write_main(fss_extended_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_extended_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_write_main()
- */
-#ifndef _di_fss_extended_write_main_delete_
-  extern f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main);
-#endif // _di_fss_extended_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index d51226244d2120522d2f9df9e2c0f498da71591d..80c4c3e31201b79fbb4866e37ebb9e875fa5d408 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_extended_write.c private-common.c private-write.c
+build_sources_library fss_extended_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_extended_write.h
+build_sources_headers fss_extended_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_identify/c/common.c b/level_3/fss_identify/c/common.c
new file mode 100644 (file)
index 0000000..c55c2cb
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_identify.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_identify_main_delete_
+  f_status_t fss_identify_main_delete(fss_identify_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_identify_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_identify/c/common.h b/level_3/fss_identify/c/common.h
new file mode 100644 (file)
index 0000000..6e2786e
--- /dev/null
@@ -0,0 +1,162 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Identify
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_identify_common_h
+#define _fss_identify_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_identify_program_version_
+  #define FSS_IDENTIFY_program_version_major_s F_string_ascii_0_s
+  #define FSS_IDENTIFY_program_version_minor_s F_string_ascii_5_s
+  #define FSS_IDENTIFY_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_IDENTIFY_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_IDENTIFY_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_IDENTIFY_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
+    #define FSS_IDENTIFY_program_version_nano_prefix_s
+    #define FSS_IDENTIFY_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
+    #define FSS_IDENTIFY_program_version_nano_s
+    #define FSS_IDENTIFY_program_version_nano_s_length 0
+  #endif // !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
+
+  #define FSS_IDENTIFY_program_version_s FSS_IDENTIFY_program_version_major_s F_string_ascii_period_s FSS_IDENTIFY_program_version_minor_s F_string_ascii_period_s FSS_IDENTIFY_program_version_micro_s FSS_IDENTIFY_program_version_nano_prefix_s FSS_IDENTIFY_program_version_nano_s
+
+  #define FSS_IDENTIFY_program_version_s_length FSS_IDENTIFY_program_version_major_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_micro_s_length + FSS_IDENTIFY_program_version_nano_prefix_s_length + FSS_IDENTIFY_program_version_nano_s_length
+
+  const f_string_static_t fss_identify_program_version_s;
+#endif // _di_fss_identify_program_version_
+
+#ifndef _di_fss_identify_program_name_
+  #define FSS_IDENTIFY_program_name_s      "fss_identify"
+  #define FSS_IDENTIFY_program_name_long_s "FSS Identify"
+
+  #define FSS_IDENTIFY_program_name_s_length      12
+  #define FSS_IDENTIFY_program_name_long_s_length 12
+
+  const f_string_static_t fss_identify_program_name_s;
+  const f_string_static_t fss_identify_program_name_long_s;
+#endif // _di_fss_identify_program_name_
+
+#ifndef _di_fss_identify_defines_
+  #define fss_identify_signal_check_d 10000
+
+  #define fss_identify_short_content_s "c"
+  #define fss_identify_short_line_s    "l"
+  #define fss_identify_short_name_s    "n"
+  #define fss_identify_short_object_s  "o"
+  #define fss_identify_short_total_s   "t"
+
+  #define fss_identify_long_content_s "content"
+  #define fss_identify_long_line_s    "line"
+  #define fss_identify_long_name_s    "name"
+  #define fss_identify_long_object_s  "object"
+  #define fss_identify_long_total_s   "total"
+
+  enum {
+    fss_identify_parameter_help_e,
+    fss_identify_parameter_light_e,
+    fss_identify_parameter_dark_e,
+    fss_identify_parameter_no_color_e,
+    fss_identify_parameter_verbosity_quiet_e,
+    fss_identify_parameter_verbosity_normal_e,
+    fss_identify_parameter_verbosity_verbose_e,
+    fss_identify_parameter_verbosity_debug_e,
+    fss_identify_parameter_version_e,
+
+    fss_identify_parameter_content_e,
+    fss_identify_parameter_line_e,
+    fss_identify_parameter_name_e,
+    fss_identify_parameter_object_e,
+    fss_identify_parameter_total_e,
+  };
+
+  #define fss_identify_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_identify_short_name_s, fss_identify_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_identify_short_object_s, fss_identify_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_identify_total_parameters_d 14
+#endif // _di_fss_identify_defines_
+
+#ifndef _di_fss_identify_data_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_identify_main_t;
+
+  #define fss_identify_data_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_identify_data_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_identify_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_identify_main()
+ */
+#ifndef _di_fss_identify_main_delete_
+  extern f_status_t fss_identify_main_delete(fss_identify_main_t * const main);
+#endif // _di_fss_identify_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_identify_common_h
index a2a078f2620ee2e482471b80ce15236a292175e9..0ea7f0b01bc03616701c03de47ed5d494d72067a 100644 (file)
@@ -376,19 +376,6 @@ extern "C" {
   }
 #endif // _di_fss_identify_main_
 
-#ifndef _di_fss_identify_main_delete_
-  f_status_t fss_identify_main_delete(fss_identify_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_identify_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 78b231cc40ecc958dbfc8b98a84f2d447d0efa4c..b1b8d45393b446fe7f745aaed0aaf1496b7197ec 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Identify includes.
+#include <program/fss_identify/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_identify_program_version_
-  #define FSS_IDENTIFY_program_version_major_s F_string_ascii_0_s
-  #define FSS_IDENTIFY_program_version_minor_s F_string_ascii_5_s
-  #define FSS_IDENTIFY_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_IDENTIFY_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_IDENTIFY_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_IDENTIFY_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
-    #define FSS_IDENTIFY_program_version_nano_prefix_s
-    #define FSS_IDENTIFY_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_IDENTIFY_program_version_nano_prefix_s) && defined(FSS_IDENTIFY_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
-    #define FSS_IDENTIFY_program_version_nano_s
-    #define FSS_IDENTIFY_program_version_nano_s_length 0
-  #endif // !(defined(FSS_IDENTIFY_program_version_nano_s) && defined(FSS_IDENTIFY_program_version_nano_s_length))
-
-  #define FSS_IDENTIFY_program_version_s FSS_IDENTIFY_program_version_major_s F_string_ascii_period_s FSS_IDENTIFY_program_version_minor_s F_string_ascii_period_s FSS_IDENTIFY_program_version_micro_s FSS_IDENTIFY_program_version_nano_prefix_s FSS_IDENTIFY_program_version_nano_s
-
-  #define FSS_IDENTIFY_program_version_s_length FSS_IDENTIFY_program_version_major_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_IDENTIFY_program_version_micro_s_length + FSS_IDENTIFY_program_version_nano_prefix_s_length + FSS_IDENTIFY_program_version_nano_s_length
-
-  const f_string_static_t fss_identify_program_version_s;
-#endif // _di_fss_identify_program_version_
-
-#ifndef _di_fss_identify_program_name_
-  #define FSS_IDENTIFY_program_name_s      "fss_identify"
-  #define FSS_IDENTIFY_program_name_long_s "FSS Identify"
-
-  #define FSS_IDENTIFY_program_name_s_length      12
-  #define FSS_IDENTIFY_program_name_long_s_length 12
-
-  const f_string_static_t fss_identify_program_name_s;
-  const f_string_static_t fss_identify_program_name_long_s;
-#endif // _di_fss_identify_program_name_
-
-#ifndef _di_fss_identify_defines_
-  #define fss_identify_signal_check_d 10000
-
-  #define fss_identify_short_content_s "c"
-  #define fss_identify_short_line_s    "l"
-  #define fss_identify_short_name_s    "n"
-  #define fss_identify_short_object_s  "o"
-  #define fss_identify_short_total_s   "t"
-
-  #define fss_identify_long_content_s "content"
-  #define fss_identify_long_line_s    "line"
-  #define fss_identify_long_name_s    "name"
-  #define fss_identify_long_object_s  "object"
-  #define fss_identify_long_total_s   "total"
-
-  enum {
-    fss_identify_parameter_help_e,
-    fss_identify_parameter_light_e,
-    fss_identify_parameter_dark_e,
-    fss_identify_parameter_no_color_e,
-    fss_identify_parameter_verbosity_quiet_e,
-    fss_identify_parameter_verbosity_normal_e,
-    fss_identify_parameter_verbosity_verbose_e,
-    fss_identify_parameter_verbosity_debug_e,
-    fss_identify_parameter_version_e,
-
-    fss_identify_parameter_content_e,
-    fss_identify_parameter_line_e,
-    fss_identify_parameter_name_e,
-    fss_identify_parameter_object_e,
-    fss_identify_parameter_total_e,
-  };
-
-  #define fss_identify_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_identify_short_name_s, fss_identify_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_identify_short_object_s, fss_identify_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_identify_total_parameters_d 14
-#endif // _di_fss_identify_defines_
-
-#ifndef _di_fss_identify_data_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_identify_main_t;
-
-  #define fss_identify_data_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_identify_data_t_
-
 /**
  * Print help.
  *
@@ -214,25 +97,6 @@ extern "C" {
   extern f_status_t fss_identify_main(fss_identify_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_identify_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_identify_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_identify_main()
- */
-#ifndef _di_fss_identify_main_delete_
-  extern f_status_t fss_identify_main_delete(fss_identify_main_t * const main);
-#endif // _di_fss_identify_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9dd12facd65f6593e832544b8da802358c5b218c..59fcf5a1ffa9637af5cc1e3e48a81be56bb4ecb6 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_identify.c private-common.c private-identify.c private-print.c
+build_sources_library fss_identify.c common.c private-common.c private-identify.c private-print.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_identify.h
+build_sources_headers fss_identify.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_payload_read/c/common.c b/level_3/fss_payload_read/c/common.c
new file mode 100644 (file)
index 0000000..c2ec9b3
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fss_payload_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_payload_read_main_delete_
+  f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_payload_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_payload_read/c/common.h b/level_3/fss_payload_read/c/common.h
new file mode 100644 (file)
index 0000000..375e5f9
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Payload Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_payload_read_common_h
+#define _fss_payload_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_payload_read_program_version_
+  #define FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_0_s
+  #define FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_5_s
+  #define FSS_PAYLOAD_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_PAYLOAD_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_PAYLOAD_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_PAYLOAD_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
+    #define FSS_PAYLOAD_READ_program_version_nano_prefix_s
+    #define FSS_PAYLOAD_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
+    #define FSS_PAYLOAD_READ_program_version_nano_s
+    #define FSS_PAYLOAD_READ_program_version_nano_s_length 0
+  #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
+
+  #define FSS_PAYLOAD_READ_program_version_s FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_micro_s FSS_PAYLOAD_READ_program_version_nano_prefix_s FSS_PAYLOAD_READ_program_version_nano_s
+
+  #define FSS_PAYLOAD_READ_program_version_s_length FSS_PAYLOAD_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_micro_s_length + FSS_PAYLOAD_READ_program_version_nano_prefix_s_length + FSS_PAYLOAD_READ_program_version_nano_s_length
+
+  extern const f_string_static_t fss_payload_read_program_version_s;
+#endif // _di_fss_payload_read_program_version_
+
+#ifndef _di_fss_payload_read_program_name_
+  #define FSS_PAYLOAD_READ_program_name_s      "fss_payload_read"
+  #define FSS_PAYLOAD_READ_program_name_long_s "FSS Payload Read"
+
+  #define FSS_PAYLOAD_READ_program_name_s_length      16
+  #define FSS_PAYLOAD_READ_program_name_long_s_length 16
+
+  extern const f_string_static_t fss_payload_read_program_name_s;
+  extern const f_string_static_t fss_payload_read_program_name_long_s;
+#endif // _di_fss_payload_read_program_name_
+
+#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_short_at_s      "a"
+  #define fss_payload_read_short_content_s "c"
+  #define fss_payload_read_short_columns_s "C"
+  #define fss_payload_read_short_delimit_s "D"
+  #define fss_payload_read_short_depth_s   "d"
+  #define fss_payload_read_short_empty_s   "e"
+  #define fss_payload_read_short_line_s    "l"
+  #define fss_payload_read_short_name_s    "n"
+  #define fss_payload_read_short_object_s  "o"
+  #define fss_payload_read_short_pipe_s    "p"
+  #define fss_payload_read_short_raw_s     "R"
+  #define fss_payload_read_short_select_s  "s"
+  #define fss_payload_read_short_total_s   "t"
+  #define fss_payload_read_short_trim_s    "T"
+
+  #define fss_payload_read_long_at_s      "at"
+  #define fss_payload_read_long_content_s "content"
+  #define fss_payload_read_long_columns_s "columns"
+  #define fss_payload_read_long_delimit_s "delimit"
+  #define fss_payload_read_long_depth_s   "depth"
+  #define fss_payload_read_long_empty_s   "empty"
+  #define fss_payload_read_long_line_s    "line"
+  #define fss_payload_read_long_name_s    "name"
+  #define fss_payload_read_long_object_s  "object"
+  #define fss_payload_read_long_pipe_s    "pipe"
+  #define fss_payload_read_long_raw_s     "raw"
+  #define fss_payload_read_long_select_s  "select"
+  #define fss_payload_read_long_total_s   "total"
+  #define fss_payload_read_long_trim_s    "trim"
+
+  enum {
+    fss_payload_read_parameter_help_e,
+    fss_payload_read_parameter_light_e,
+    fss_payload_read_parameter_dark_e,
+    fss_payload_read_parameter_no_color_e,
+    fss_payload_read_parameter_verbosity_quiet_e,
+    fss_payload_read_parameter_verbosity_normal_e,
+    fss_payload_read_parameter_verbosity_verbose_e,
+    fss_payload_read_parameter_verbosity_debug_e,
+    fss_payload_read_parameter_version_e,
+
+    fss_payload_read_parameter_at_e,
+    fss_payload_read_parameter_content_e,
+    fss_payload_read_parameter_columns_e,
+    fss_payload_read_parameter_delimit_e,
+    fss_payload_read_parameter_depth_e,
+    fss_payload_read_parameter_empty_e,
+    fss_payload_read_parameter_line_e,
+    fss_payload_read_parameter_name_e,
+    fss_payload_read_parameter_object_e,
+    fss_payload_read_parameter_pipe_e,
+    fss_payload_read_parameter_raw_e,
+    fss_payload_read_parameter_select_e,
+    fss_payload_read_parameter_total_e,
+    fss_payload_read_parameter_trim_e,
+  };
+
+  #define fss_payload_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s, fss_payload_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s, fss_payload_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s, fss_payload_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s, fss_payload_read_long_select_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s, fss_payload_read_long_total_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_payload_total_parameters_d 23
+#endif // _di_fss_payload_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_payload_read_delimit_mode_*:
+ *   - all:                    All delimits are to be aplied.
+ *   - content:                Content are to have delimits applied.
+ *   - content_greater:        Content at this number or higher are to have delimits applied.
+ *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ *   - content_lesser:         Content at this number or lower are to have delimits applied.
+ *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
+ *   - content_object:         Objects and Content are to have delimits applied
+ *   - object:                 Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_payload_read_delimit_mode_
+  #define fss_payload_read_delimit_mode_name_none_s    "none"
+  #define fss_payload_read_delimit_mode_name_all_s     "all"
+  #define fss_payload_read_delimit_mode_name_object_s  "object"
+  #define fss_payload_read_delimit_mode_name_greater_s "+"
+  #define fss_payload_read_delimit_mode_name_lesser_s  "-"
+
+  #define fss_payload_read_delimit_mode_name_none_s_length    4
+  #define fss_payload_read_delimit_mode_name_all_s_length     3
+  #define fss_payload_read_delimit_mode_name_object_s_length  6
+  #define fss_payload_read_delimit_mode_name_greater_s_length 1
+  #define fss_payload_read_delimit_mode_name_lesser_s_length  1
+
+  enum {
+    fss_payload_read_delimit_mode_none_e = 1,
+    fss_payload_read_delimit_mode_all_e,
+    fss_payload_read_delimit_mode_content_e,
+    fss_payload_read_delimit_mode_content_greater_e,
+    fss_payload_read_delimit_mode_content_greater_object_e,
+    fss_payload_read_delimit_mode_content_lesser_e,
+    fss_payload_read_delimit_mode_content_lesser_object_e,
+    fss_payload_read_delimit_mode_content_object_e,
+    fss_payload_read_delimit_mode_object_e,
+  };
+#endif // _di_fss_payload_read_delimit_modes_
+
+#ifndef _di_fss_payload_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_payload_read_main_t;
+
+  #define fss_payload_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_payload_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_payload_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_payload_read_main()
+ */
+#ifndef _di_fss_payload_read_main_delete_
+  extern f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main);
+#endif // _di_fss_payload_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_payload_read_common_h
index eec2d7047bf754068efafaedd6c6d0e02b251f63..979c8772082847a77e88b6dabadeee5d99a0a88f 100644 (file)
@@ -691,18 +691,6 @@ extern "C" {
   }
 #endif // _di_fss_payload_read_main_
 
-#ifndef _di_fss_payload_read_main_delete_
-  f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_payload_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9fc157b54bbaa59c4ba55aaa08b70d9bcd9b7c3a..8dc2e92b0c8ea5069b6203857f5811c57ac2e4f7 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Payload Read includes.
+#include <program/fss_payload_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_payload_read_program_version_
-  #define FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_0_s
-  #define FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_5_s
-  #define FSS_PAYLOAD_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_PAYLOAD_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_PAYLOAD_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_PAYLOAD_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
-    #define FSS_PAYLOAD_READ_program_version_nano_prefix_s
-    #define FSS_PAYLOAD_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
-    #define FSS_PAYLOAD_READ_program_version_nano_s
-    #define FSS_PAYLOAD_READ_program_version_nano_s_length 0
-  #endif // !(defined(FSS_PAYLOAD_READ_program_version_nano_s) && defined(FSS_PAYLOAD_READ_program_version_nano_s_length))
-
-  #define FSS_PAYLOAD_READ_program_version_s FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_READ_program_version_micro_s FSS_PAYLOAD_READ_program_version_nano_prefix_s FSS_PAYLOAD_READ_program_version_nano_s
-
-  #define FSS_PAYLOAD_READ_program_version_s_length FSS_PAYLOAD_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_READ_program_version_micro_s_length + FSS_PAYLOAD_READ_program_version_nano_prefix_s_length + FSS_PAYLOAD_READ_program_version_nano_s_length
-
-  extern const f_string_static_t fss_payload_read_program_version_s;
-#endif // _di_fss_payload_read_program_version_
-
-#ifndef _di_fss_payload_read_program_name_
-  #define FSS_PAYLOAD_READ_program_name_s      "fss_payload_read"
-  #define FSS_PAYLOAD_READ_program_name_long_s "FSS Payload Read"
-
-  #define FSS_PAYLOAD_READ_program_name_s_length      16
-  #define FSS_PAYLOAD_READ_program_name_long_s_length 16
-
-  extern const f_string_static_t fss_payload_read_program_name_s;
-  extern const f_string_static_t fss_payload_read_program_name_long_s;
-#endif // _di_fss_payload_read_program_name_
-
-#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_short_at_s      "a"
-  #define fss_payload_read_short_content_s "c"
-  #define fss_payload_read_short_columns_s "C"
-  #define fss_payload_read_short_delimit_s "D"
-  #define fss_payload_read_short_depth_s   "d"
-  #define fss_payload_read_short_empty_s   "e"
-  #define fss_payload_read_short_line_s    "l"
-  #define fss_payload_read_short_name_s    "n"
-  #define fss_payload_read_short_object_s  "o"
-  #define fss_payload_read_short_pipe_s    "p"
-  #define fss_payload_read_short_raw_s     "R"
-  #define fss_payload_read_short_select_s  "s"
-  #define fss_payload_read_short_total_s   "t"
-  #define fss_payload_read_short_trim_s    "T"
-
-  #define fss_payload_read_long_at_s      "at"
-  #define fss_payload_read_long_content_s "content"
-  #define fss_payload_read_long_columns_s "columns"
-  #define fss_payload_read_long_delimit_s "delimit"
-  #define fss_payload_read_long_depth_s   "depth"
-  #define fss_payload_read_long_empty_s   "empty"
-  #define fss_payload_read_long_line_s    "line"
-  #define fss_payload_read_long_name_s    "name"
-  #define fss_payload_read_long_object_s  "object"
-  #define fss_payload_read_long_pipe_s    "pipe"
-  #define fss_payload_read_long_raw_s     "raw"
-  #define fss_payload_read_long_select_s  "select"
-  #define fss_payload_read_long_total_s   "total"
-  #define fss_payload_read_long_trim_s    "trim"
-
-  enum {
-    fss_payload_read_parameter_help_e,
-    fss_payload_read_parameter_light_e,
-    fss_payload_read_parameter_dark_e,
-    fss_payload_read_parameter_no_color_e,
-    fss_payload_read_parameter_verbosity_quiet_e,
-    fss_payload_read_parameter_verbosity_normal_e,
-    fss_payload_read_parameter_verbosity_verbose_e,
-    fss_payload_read_parameter_verbosity_debug_e,
-    fss_payload_read_parameter_version_e,
-
-    fss_payload_read_parameter_at_e,
-    fss_payload_read_parameter_content_e,
-    fss_payload_read_parameter_columns_e,
-    fss_payload_read_parameter_delimit_e,
-    fss_payload_read_parameter_depth_e,
-    fss_payload_read_parameter_empty_e,
-    fss_payload_read_parameter_line_e,
-    fss_payload_read_parameter_name_e,
-    fss_payload_read_parameter_object_e,
-    fss_payload_read_parameter_pipe_e,
-    fss_payload_read_parameter_raw_e,
-    fss_payload_read_parameter_select_e,
-    fss_payload_read_parameter_total_e,
-    fss_payload_read_parameter_trim_e,
-  };
-
-  #define fss_payload_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s, fss_payload_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s, fss_payload_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s, fss_payload_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s, fss_payload_read_long_select_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s, fss_payload_read_long_total_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_payload_total_parameters_d 23
-#endif // _di_fss_payload_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_payload_read_delimit_mode_*:
- *   - all:                    All delimits are to be aplied.
- *   - content:                Content are to have delimits applied.
- *   - content_greater:        Content at this number or higher are to have delimits applied.
- *   - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- *   - content_lesser:         Content at this number or lower are to have delimits applied.
- *   - content_lesser_object:  Objects and Content at this number or lower are to have delimits applied.
- *   - content_object:         Objects and Content are to have delimits applied
- *   - object:                 Objects arre to have delimits applied.
- */
-#ifndef _di_fss_payload_read_delimit_mode_
-  #define fss_payload_read_delimit_mode_name_none_s    "none"
-  #define fss_payload_read_delimit_mode_name_all_s     "all"
-  #define fss_payload_read_delimit_mode_name_object_s  "object"
-  #define fss_payload_read_delimit_mode_name_greater_s "+"
-  #define fss_payload_read_delimit_mode_name_lesser_s  "-"
-
-  #define fss_payload_read_delimit_mode_name_none_s_length    4
-  #define fss_payload_read_delimit_mode_name_all_s_length     3
-  #define fss_payload_read_delimit_mode_name_object_s_length  6
-  #define fss_payload_read_delimit_mode_name_greater_s_length 1
-  #define fss_payload_read_delimit_mode_name_lesser_s_length  1
-
-  enum {
-    fss_payload_read_delimit_mode_none_e = 1,
-    fss_payload_read_delimit_mode_all_e,
-    fss_payload_read_delimit_mode_content_e,
-    fss_payload_read_delimit_mode_content_greater_e,
-    fss_payload_read_delimit_mode_content_greater_object_e,
-    fss_payload_read_delimit_mode_content_lesser_e,
-    fss_payload_read_delimit_mode_content_lesser_object_e,
-    fss_payload_read_delimit_mode_content_object_e,
-    fss_payload_read_delimit_mode_object_e,
-  };
-#endif // _di_fss_payload_read_delimit_modes_
-
-#ifndef _di_fss_payload_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_payload_read_main_t;
-
-  #define fss_payload_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_payload_read_main_t_
-
 /**
  * Print help.
  *
@@ -296,25 +100,6 @@ extern "C" {
   extern f_status_t fss_payload_read_main(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_payload_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_payload_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_payload_read_main()
- */
-#ifndef _di_fss_payload_read_main_delete_
-  extern f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main);
-#endif // _di_fss_payload_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 32430dc65a746fdd4bb6963d55016de10165060b..2745d427ed3d753d3258ec9dc51b7cfc4e559157 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_payload_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_payload_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_payload_read.h
+build_sources_headers fss_payload_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_payload_write/c/common.c b/level_3/fss_payload_write/c/common.c
new file mode 100644 (file)
index 0000000..580f1d8
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_payload_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_payload_write_main_delete_
+  f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_payload_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_payload_write/c/common.h b/level_3/fss_payload_write/c/common.h
new file mode 100644 (file)
index 0000000..d6f079d
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Payload Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_payload_write_common_h
+#define _fss_payload_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_payload_write_program_version_
+  #define FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_0_s
+  #define FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define FSS_PAYLOAD_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_PAYLOAD_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_PAYLOAD_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_PAYLOAD_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
+    #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s
+    #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
+    #define FSS_PAYLOAD_WRITE_program_version_nano_s
+    #define FSS_PAYLOAD_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
+
+  #define FSS_PAYLOAD_WRITE_program_version_s FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_micro_s FSS_PAYLOAD_WRITE_program_version_nano_prefix_s FSS_PAYLOAD_WRITE_program_version_nano_s
+
+  #define FSS_PAYLOAD_WRITE_program_version_s_length FSS_PAYLOAD_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_micro_s_length + FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length + FSS_PAYLOAD_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t fss_payload_write_program_version_s;
+#endif // _di_fss_payload_write_program_version_
+
+#ifndef _di_fss_payload_write_program_name_
+  #define FSS_PAYLOAD_WRITE_program_name_s      "fss_payload_write"
+  #define FSS_PAYLOAD_WRITE_program_name_long_s "FSS Payload Write"
+
+  #define FSS_PAYLOAD_WRITE_program_name_s_length      17
+  #define FSS_PAYLOAD_WRITE_program_name_long_s_length 17
+
+  extern const f_string_static_t fss_payload_write_program_name_s;
+  extern const f_string_static_t fss_payload_write_program_name_long_s;
+#endif // _di_fss_payload_write_program_name_
+
+#ifndef _di_fss_payload_write_defines_
+  #define fss_payload_write_signal_check_d 10000
+
+  #define fss_payload_write_pipe_content_end_s    '\f'
+  #define fss_payload_write_pipe_content_ignore_s '\v'
+  #define fss_payload_write_pipe_content_start_s  '\b'
+
+  #define fss_payload_write_short_file_s    "f"
+  #define fss_payload_write_short_content_s "c"
+  #define fss_payload_write_short_double_s  "d"
+  #define fss_payload_write_short_ignore_s  "I"
+  #define fss_payload_write_short_object_s  "o"
+  #define fss_payload_write_short_partial_s "p"
+  #define fss_payload_write_short_prepend_s "P"
+  #define fss_payload_write_short_single_s  "s"
+  #define fss_payload_write_short_trim_s    "T"
+
+  #define fss_payload_write_long_file_s    "file"
+  #define fss_payload_write_long_content_s "content"
+  #define fss_payload_write_long_double_s  "double"
+  #define fss_payload_write_long_ignore_s  "ignore"
+  #define fss_payload_write_long_object_s  "object"
+  #define fss_payload_write_long_partial_s "partial"
+  #define fss_payload_write_long_prepend_s "prepend"
+  #define fss_payload_write_long_single_s  "single"
+  #define fss_payload_write_long_trim_s    "trim"
+
+  enum {
+    fss_payload_write_parameter_help_e,
+    fss_payload_write_parameter_light_e,
+    fss_payload_write_parameter_dark_e,
+    fss_payload_write_parameter_no_color_e,
+    fss_payload_write_parameter_verbosity_quiet_e,
+    fss_payload_write_parameter_verbosity_normal_e,
+    fss_payload_write_parameter_verbosity_verbose_e,
+    fss_payload_write_parameter_verbosity_debug_e,
+    fss_payload_write_parameter_version_e,
+
+    fss_payload_write_parameter_file_e,
+    fss_payload_write_parameter_content_e,
+    fss_payload_write_parameter_double_e,
+    fss_payload_write_parameter_ignore_e,
+    fss_payload_write_parameter_object_e,
+    fss_payload_write_parameter_partial_e,
+    fss_payload_write_parameter_prepend_e,
+    fss_payload_write_parameter_single_e,
+    fss_payload_write_parameter_trim_e,
+  };
+
+  #define fss_payload_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_file_s, fss_payload_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s, fss_payload_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s, fss_payload_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s, fss_payload_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s, fss_payload_write_long_single_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_payload_write_total_parameters_d 18
+#endif // _di_fss_payload_write_defines_
+
+#ifndef _di_fss_payload_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t prepend;
+
+    f_color_context_t context;
+  } fss_payload_write_main_t;
+
+  #define fss_payload_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_payload_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_payload_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_payload_write_main()
+ */
+#ifndef _di_fss_payload_write_main_delete_
+  extern f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main);
+#endif // _di_fss_payload_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_payload_write_common_h
index ce78e78bd0881f07d7ffc2297824c8f9e54572bc..0ccf72469260fb0ea5f0f32e0887333be8b93fa9 100644 (file)
@@ -554,19 +554,6 @@ extern "C" {
   }
 #endif // _di_fss_payload_write_main_
 
-#ifndef _di_fss_payload_write_main_delete_
-  f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_payload_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 74a723ee78d8d2f0949563423b3f03873242cbdb..6c9e4cec6828419c0f7066f7fc8932e45df2e732 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// FSS Payload Write includes.
+#include <program/fss_payload_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_payload_write_program_version_
-  #define FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_0_s
-  #define FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define FSS_PAYLOAD_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_PAYLOAD_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_PAYLOAD_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_PAYLOAD_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
-    #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s
-    #define FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
-    #define FSS_PAYLOAD_WRITE_program_version_nano_s
-    #define FSS_PAYLOAD_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(FSS_PAYLOAD_WRITE_program_version_nano_s) && defined(FSS_PAYLOAD_WRITE_program_version_nano_s_length))
-
-  #define FSS_PAYLOAD_WRITE_program_version_s FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_period_s FSS_PAYLOAD_WRITE_program_version_micro_s FSS_PAYLOAD_WRITE_program_version_nano_prefix_s FSS_PAYLOAD_WRITE_program_version_nano_s
-
-  #define FSS_PAYLOAD_WRITE_program_version_s_length FSS_PAYLOAD_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_PAYLOAD_WRITE_program_version_micro_s_length + FSS_PAYLOAD_WRITE_program_version_nano_prefix_s_length + FSS_PAYLOAD_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t fss_payload_write_program_version_s;
-#endif // _di_fss_payload_write_program_version_
-
-#ifndef _di_fss_payload_write_program_name_
-  #define FSS_PAYLOAD_WRITE_program_name_s      "fss_payload_write"
-  #define FSS_PAYLOAD_WRITE_program_name_long_s "FSS Payload Write"
-
-  #define FSS_PAYLOAD_WRITE_program_name_s_length      17
-  #define FSS_PAYLOAD_WRITE_program_name_long_s_length 17
-
-  extern const f_string_static_t fss_payload_write_program_name_s;
-  extern const f_string_static_t fss_payload_write_program_name_long_s;
-#endif // _di_fss_payload_write_program_name_
-
-#ifndef _di_fss_payload_write_defines_
-  #define fss_payload_write_signal_check_d 10000
-
-  #define fss_payload_write_pipe_content_end_s    '\f'
-  #define fss_payload_write_pipe_content_ignore_s '\v'
-  #define fss_payload_write_pipe_content_start_s  '\b'
-
-  #define fss_payload_write_short_file_s    "f"
-  #define fss_payload_write_short_content_s "c"
-  #define fss_payload_write_short_double_s  "d"
-  #define fss_payload_write_short_ignore_s  "I"
-  #define fss_payload_write_short_object_s  "o"
-  #define fss_payload_write_short_partial_s "p"
-  #define fss_payload_write_short_prepend_s "P"
-  #define fss_payload_write_short_single_s  "s"
-  #define fss_payload_write_short_trim_s    "T"
-
-  #define fss_payload_write_long_file_s    "file"
-  #define fss_payload_write_long_content_s "content"
-  #define fss_payload_write_long_double_s  "double"
-  #define fss_payload_write_long_ignore_s  "ignore"
-  #define fss_payload_write_long_object_s  "object"
-  #define fss_payload_write_long_partial_s "partial"
-  #define fss_payload_write_long_prepend_s "prepend"
-  #define fss_payload_write_long_single_s  "single"
-  #define fss_payload_write_long_trim_s    "trim"
-
-  enum {
-    fss_payload_write_parameter_help_e,
-    fss_payload_write_parameter_light_e,
-    fss_payload_write_parameter_dark_e,
-    fss_payload_write_parameter_no_color_e,
-    fss_payload_write_parameter_verbosity_quiet_e,
-    fss_payload_write_parameter_verbosity_normal_e,
-    fss_payload_write_parameter_verbosity_verbose_e,
-    fss_payload_write_parameter_verbosity_debug_e,
-    fss_payload_write_parameter_version_e,
-
-    fss_payload_write_parameter_file_e,
-    fss_payload_write_parameter_content_e,
-    fss_payload_write_parameter_double_e,
-    fss_payload_write_parameter_ignore_e,
-    fss_payload_write_parameter_object_e,
-    fss_payload_write_parameter_partial_e,
-    fss_payload_write_parameter_prepend_e,
-    fss_payload_write_parameter_single_e,
-    fss_payload_write_parameter_trim_e,
-  };
-
-  #define fss_payload_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, F_false, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_file_s, fss_payload_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s, fss_payload_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s, fss_payload_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s, fss_payload_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s, fss_payload_write_long_single_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_payload_write_total_parameters_d 18
-#endif // _di_fss_payload_write_defines_
-
-#ifndef _di_fss_payload_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t prepend;
-
-    f_color_context_t context;
-  } fss_payload_write_main_t;
-
-  #define fss_payload_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_payload_write_main_t_
-
 /**
  * Print help.
  *
@@ -232,25 +92,6 @@ extern "C" {
   extern f_status_t fss_payload_write_main(fss_payload_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_payload_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_payload_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_payload_write_main()
- */
-#ifndef _di_fss_payload_write_main_delete_
-  extern f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main);
-#endif // _di_fss_payload_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 3c8f149635c4b65578023ad847ec3ba40ee199f9..71031c99854d9c10bc4c9530cd5b6f335acbea7f 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_payload_write.c private-common.c private-write.c
+build_sources_library fss_payload_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_payload_write.h
+build_sources_headers fss_payload_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/fss_status_code/c/common.c b/level_3/fss_status_code/c/common.c
new file mode 100644 (file)
index 0000000..63ed5a1
--- /dev/null
@@ -0,0 +1,31 @@
+#include "fss_status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_status_code_main_delete_
+  f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_fss_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/fss_status_code/c/common.h b/level_3/fss_status_code/c/common.h
new file mode 100644 (file)
index 0000000..ef9e3b2
--- /dev/null
@@ -0,0 +1,156 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Status code
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _fss_status_code_common_h
+#define _fss_status_code_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_status_code_program_version_
+  #define FSS_STATUS_code_program_version_major_s F_string_ascii_0_s
+  #define FSS_STATUS_code_program_version_minor_s F_string_ascii_5_s
+  #define FSS_STATUS_code_program_version_micro_s F_string_ascii_8_s
+
+  #define FSS_STATUS_code_program_version_major_s_length F_string_ascii_0_s_length
+  #define FSS_STATUS_code_program_version_minor_s_length F_string_ascii_5_s_length
+  #define FSS_STATUS_code_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
+    #define FSS_STATUS_program_version_nano_prefix_s
+    #define FSS_STATUS_program_version_nano_prefix_s_length 0
+  #endif // !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
+
+  #if !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
+    #define FSS_STATUS_program_version_nano_s
+    #define FSS_STATUS_program_version_nano_s_length 0
+  #endif // !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
+
+  #define FSS_STATUS_code_program_version_length_s FSS_STATUS_code_program_version_major_s F_string_ascii_period_s FSS_STATUS_code_program_version_minor_s F_string_ascii_period_s FSS_STATUS_code_program_version_micro_s FSS_STATUS_code_program_version_nano_prefix_s FSS_STATUS_code_program_version_nano_s
+
+  extern const f_string_static_t fss_status_code_program_version_s;
+#endif // _di_fss_status_code_program_version_
+
+#ifndef _di_fss_status_code_program_name_
+  #define FSS_STATUS_code_program_name_s      "FSS_STATUS_code"
+  #define FSS_STATUS_code_program_name_long_s "FSS Status Code"
+
+  #define FSS_STATUS_CODE_program_name_s_length
+  #define FSS_STATUS_CODE_program_name_long_s_length
+
+  const f_string_static_t fss_status_code_program_name_s;
+  const f_string_static_t fss_status_code_program_name_long_s;
+#endif // _di_fss_status_code_program_name_
+
+#ifndef _di_fss_status_code_defines_
+  #define fss_status_code_signal_check_d 10000
+
+  #define fss_status_code_short_is_fine_s    "f"
+  #define fss_status_code_short_is_warning_s "w"
+  #define fss_status_code_short_is_error_s   "e"
+  #define fss_status_code_short_number_s     "n"
+
+  #define fss_status_code_long_is_fine_s    "is_fine"
+  #define fss_status_code_long_is_warning_s "is_warning"
+  #define fss_status_code_long_is_error_s   "is_error"
+  #define fss_status_code_long_number_s     "number"
+
+  enum {
+    fss_status_code_parameter_help_e,
+    fss_status_code_parameter_light_e,
+    fss_status_code_parameter_dark_e,
+    fss_status_code_parameter_no_color_e,
+    fss_status_code_parameter_verbosity_quiet_e,
+    fss_status_code_parameter_verbosity_normal_e,
+    fss_status_code_parameter_verbosity_verbose_e,
+    fss_status_code_parameter_verbosity_debug_e,
+    fss_status_code_parameter_version_e,
+
+    fss_status_code_parameter_is_fine_e,
+    fss_status_code_parameter_is_warning_e,
+    fss_status_code_parameter_is_error_e,
+    fss_status_code_parameter_number_e,
+  };
+
+  #define fss_status_code_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(fss_status_code_short_number_s, fss_status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define fss_status_code_total_parameters_d 13
+#endif // _di_fss_status_code_defines_
+
+#ifndef _di_fss_status_code_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } fss_status_code_main_t;
+
+  #define fss_status_code_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_fss_status_code_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_status_code_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_status_code_main()
+ */
+#ifndef _di_fss_status_code_main_delete_
+  extern f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main);
+#endif // _di_fss_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_status_code_common_h
index e1384f41c567efac873ac5c177df6d8c64e564f9..730cd8d9b5cb7dc465148b9239ed88d62fcb110c 100644 (file)
@@ -303,19 +303,6 @@ extern "C" {
   }
 #endif // _di_fss_status_code_main_
 
-#ifndef _di_fss_status_code_main_delete_
-  f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_fss_status_code_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index b1d3639a35e19ff607e6120a1bc54b4b62413ebf..9b4ad8ee52a11d4449f373833206cc0049954770 100644 (file)
 #include <fll/level_2/program.h>
 #include <fll/level_2/status_string.h>
 
+// FSS Status Code includes.
+#include <program/fss_status_code/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_fss_status_code_program_version_
-  #define FSS_STATUS_code_program_version_major_s F_string_ascii_0_s
-  #define FSS_STATUS_code_program_version_minor_s F_string_ascii_5_s
-  #define FSS_STATUS_code_program_version_micro_s F_string_ascii_8_s
-
-  #define FSS_STATUS_code_program_version_major_s_length F_string_ascii_0_s_length
-  #define FSS_STATUS_code_program_version_minor_s_length F_string_ascii_5_s_length
-  #define FSS_STATUS_code_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
-    #define FSS_STATUS_program_version_nano_prefix_s
-    #define FSS_STATUS_program_version_nano_prefix_s_length 0
-  #endif // !(defined(FSS_STATUS_program_version_nano_prefix_s) && defined(FSS_STATUS_program_version_nano_prefix_s_length))
-
-  #if !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
-    #define FSS_STATUS_program_version_nano_s
-    #define FSS_STATUS_program_version_nano_s_length 0
-  #endif // !(defined(FSS_STATUS_program_version_nano_s) && defined(FSS_STATUS_program_version_nano_s_length))
-
-  #define FSS_STATUS_code_program_version_length_s FSS_STATUS_code_program_version_major_s F_string_ascii_period_s FSS_STATUS_code_program_version_minor_s F_string_ascii_period_s FSS_STATUS_code_program_version_micro_s FSS_STATUS_code_program_version_nano_prefix_s FSS_STATUS_code_program_version_nano_s
-
-  extern const f_string_static_t fss_status_code_program_version_s;
-#endif // _di_fss_status_code_program_version_
-
-#ifndef _di_fss_status_code_program_name_
-  #define FSS_STATUS_code_program_name_s      "FSS_STATUS_code"
-  #define FSS_STATUS_code_program_name_long_s "FSS Status Code"
-
-  #define FSS_STATUS_CODE_program_name_s_length
-  #define FSS_STATUS_CODE_program_name_long_s_length
-
-  const f_string_static_t fss_status_code_program_name_s;
-  const f_string_static_t fss_status_code_program_name_long_s;
-#endif // _di_fss_status_code_program_name_
-
-#ifndef _di_fss_status_code_defines_
-  #define fss_status_code_signal_check_d 10000
-
-  #define fss_status_code_short_is_fine_s    "f"
-  #define fss_status_code_short_is_warning_s "w"
-  #define fss_status_code_short_is_error_s   "e"
-  #define fss_status_code_short_number_s     "n"
-
-  #define fss_status_code_long_is_fine_s    "is_fine"
-  #define fss_status_code_long_is_warning_s "is_warning"
-  #define fss_status_code_long_is_error_s   "is_error"
-  #define fss_status_code_long_number_s     "number"
-
-  enum {
-    fss_status_code_parameter_help_e,
-    fss_status_code_parameter_light_e,
-    fss_status_code_parameter_dark_e,
-    fss_status_code_parameter_no_color_e,
-    fss_status_code_parameter_verbosity_quiet_e,
-    fss_status_code_parameter_verbosity_normal_e,
-    fss_status_code_parameter_verbosity_verbose_e,
-    fss_status_code_parameter_verbosity_debug_e,
-    fss_status_code_parameter_version_e,
-
-    fss_status_code_parameter_is_fine_e,
-    fss_status_code_parameter_is_warning_e,
-    fss_status_code_parameter_is_error_e,
-    fss_status_code_parameter_number_e,
-  };
-
-  #define fss_status_code_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(fss_status_code_short_number_s, fss_status_code_long_number_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define fss_status_code_total_parameters_d 13
-#endif // _di_fss_status_code_defines_
-
-#ifndef _di_fss_status_code_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } fss_status_code_main_t;
-
-  #define fss_status_code_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_fss_status_code_main_t_
-
 /**
  * Print help.
  *
@@ -205,25 +94,6 @@ extern "C" {
   extern f_status_t fss_status_code_main(fss_status_code_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_fss_status_code_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_status_code_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see fss_status_code_main()
- */
-#ifndef _di_fss_status_code_main_delete_
-  extern f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main);
-#endif // _di_fss_status_code_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 1060e5cd843b79beb90e71963df50e3e266783ff..03273eedef976d832abe9593d3ae86ba1db9d30a 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library fss_status_code.c private-common.c private-fss_status_code.c
+build_sources_library fss_status_code.c common.c private-common.c private-fss_status_code.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers fss_status_code.h
+build_sources_headers fss_status_code.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/iki_read/c/common.c b/level_3/iki_read/c/common.c
new file mode 100644 (file)
index 0000000..8fb3210
--- /dev/null
@@ -0,0 +1,32 @@
+#include "iki_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_iki_read_main_delete_
+  f_status_t iki_read_main_delete(iki_read_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    f_string_dynamic_resize(0, &main->buffer);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_iki_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/iki_read/c/common.h b/level_3/iki_read/c/common.h
new file mode 100644 (file)
index 0000000..a8a2c43
--- /dev/null
@@ -0,0 +1,241 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Read
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_read_common_h
+#define _iki_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_iki_read_program_version_
+  #define IKI_READ_program_version_major_s F_string_ascii_0_s
+  #define IKI_READ_program_version_minor_s F_string_ascii_5_s
+  #define IKI_READ_program_version_micro_s F_string_ascii_8_s
+
+  #define IKI_READ_program_version_major_s_length F_string_ascii_0_s_length
+  #define IKI_READ_program_version_minor_s_length F_string_ascii_5_s_length
+  #define IKI_READ_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
+    #define IKI_READ_program_version_nano_prefix_s
+    #define IKI_READ_program_version_nano_prefix_s_length 0
+  #endif // !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
+
+  #if !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
+    #define IKI_READ_program_version_nano_s
+    #define IKI_READ_program_version_nano_s_length 0
+  #endif // !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
+
+  #define IKI_READ_program_version_s IKI_READ_program_version_major_s F_string_ascii_period_s IKI_READ_program_version_minor_s F_string_ascii_period_s IKI_READ_program_version_micro_s IKI_READ_program_version_nano_prefix_s IKI_READ_program_version_nano_s
+
+  #define IKI_READ_program_version_s_length iki_read_program_version_major_s_length + F_string_ascii_period_s iki_read_program_version_minor_s_length + F_string_ascii_period_s_length + iki_read_program_version_micro_s_length + iki_read_program_version_nano_prefix_s_length + iki_read_program_version_nano_s_length
+
+  extern const f_string_static_t iki_read_program_version_s;
+#endif // _di_iki_read_program_version_
+
+#ifndef _di_iki_read_program_name_
+  #define IKI_READ_program_name_s      "iki_read"
+  #define IKI_READ_program_name_long_s "IKI Read"
+
+  #define IKI_READ_program_name_s_length      9
+  #define IKI_READ_program_name_long_s_length 9
+
+  extern const f_string_static_t iki_read_program_name_s;
+  extern const f_string_static_t iki_read_program_name_long_s;
+#endif // _di_iki_read_program_name_
+
+#ifndef _di_iki_read_defines_
+  #define iki_read_signal_check_d 10000
+
+  enum {
+    iki_read_mode_content_e = 1,
+    iki_read_mode_literal_e,
+    iki_read_mode_object_e,
+    iki_read_mode_total_e,
+  };
+
+  #define iki_read_short_at_s         "a"
+  #define iki_read_short_content_s    "c"
+  #define iki_read_short_line_s       "l"
+  #define iki_read_short_literal_s    "L"
+  #define iki_read_short_name_s       "n"
+  #define iki_read_short_object_s     "o"
+  #define iki_read_short_substitute_s "s"
+  #define iki_read_short_total_s      "t"
+  #define iki_read_short_whole_s      "w"
+
+  #define iki_read_long_at_s         "at"
+  #define iki_read_long_content_s    "content"
+  #define iki_read_long_line_s       "line"
+  #define iki_read_long_literal_s    "literal"
+  #define iki_read_long_name_s       "name"
+  #define iki_read_long_object_s     "object"
+  #define iki_read_long_substitute_s "substitute"
+  #define iki_read_long_total_s      "total"
+  #define iki_read_long_whole_s      "whole"
+
+  enum {
+    iki_read_parameter_help_e,
+    iki_read_parameter_light_e,
+    iki_read_parameter_dark_e,
+    iki_read_parameter_no_color_e,
+    iki_read_parameter_verbosity_quiet_e,
+    iki_read_parameter_verbosity_normal_e,
+    iki_read_parameter_verbosity_verbose_e,
+    iki_read_parameter_verbosity_debug_e,
+    iki_read_parameter_version_e,
+
+    iki_read_parameter_at_e,
+    iki_read_parameter_content_e,
+    iki_read_parameter_line_e,
+    iki_read_parameter_literal_e,
+    iki_read_parameter_name_e,
+    iki_read_parameter_object_e,
+    iki_read_parameter_whole_e,
+    iki_read_parameter_substitute_e,
+    iki_read_parameter_total_e,
+  };
+
+  #define iki_read_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_at_s, iki_read_long_at_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_content_s, iki_read_long_content_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_line_s, iki_read_long_line_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_literal_s, iki_read_long_literal_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_name_s, iki_read_long_name_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_object_s, iki_read_long_object_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_whole_s, iki_read_long_whole_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_substitute_s, iki_read_long_substitute_s, 0, 3, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_read_short_total_s, iki_read_long_total_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define iki_read_total_parameters_d 18
+#endif // _di_iki_read_defines_
+
+#ifndef _di_iki_read_substitution_t_
+  #define iki_read_substitution_vocabulary_s "vocabulary"
+  #define iki_read_substitution_replace_s    "replace"
+  #define iki_read_substitution_with_s       "with"
+
+  typedef struct {
+    f_string_static_t replace;
+    f_string_static_t with;
+  } iki_read_substitution_t;
+
+  #define iki_read_substitution_t_initialize \
+    { \
+      f_string_static_t_initialize, \
+      f_string_static_t_initialize, \
+    }
+
+  #define macro_iki_read_substitution_t_initialize(replace, with) \
+    { \
+      macro_f_string_static_t_initialize2(replace), \
+      macro_f_string_static_t_initialize2(with), \
+    }
+#endif // _di_iki_read_substitution_t_
+
+#ifndef _di_iki_read_substitutions_t_
+  typedef struct {
+    iki_read_substitution_t *array;
+
+    f_array_length_t size;
+    f_array_length_t used;
+  } iki_read_substitutions_t;
+
+  #define iki_read_substitutions_t_initialize { 0, 0, 0 }
+
+  #define macro_iki_read_substitutions_t_clear(replacements) macro_f_memory_structure_clear(replacements)
+
+  #define macro_iki_read_substitutions_t_delete_simple(replacements)  macro_f_memory_structure_delete_simple(replacements, iki_read_substitution_t)
+  #define macro_iki_read_substitutions_t_destroy_simple(replacements) macro_f_memory_structure_destroy_simple(replacements, iki_read_substitution_t)
+
+  #define macro_iki_read_substitutions_t_resize(status, replacements, length) macro_f_memory_structure_resize(status, replacements, iki_read_substitution_t, length)
+  #define macro_iki_read_substitutions_t_adjust(status, replacements, length) macro_f_memory_structure_adjust(status, replacements, iki_read_substitution_t, length)
+#endif // _di_iki_read_substitutions_t_
+
+#ifndef _di_iki_read_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    uint8_t mode;
+
+    f_number_unsigned_t at;
+    f_number_unsigned_t line;
+
+    f_string_dynamic_t buffer;
+
+    iki_read_substitutions_t replacements;
+
+    f_color_context_t context;
+  } iki_read_main_t;
+
+  #define iki_read_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      0, \
+      0, \
+      0, \
+      f_string_dynamic_t_initialize, \
+      iki_read_substitutions_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_iki_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing iki_read_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see iki_read_main()
+ */
+#ifndef _di_iki_read_main_delete_
+  extern f_status_t iki_read_main_delete(iki_read_main_t * const main);
+#endif // _di_iki_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_read_common_h
index a3e8c77bb6bec94235ae68a9d5373127ef4c089b..b10e3941df6be153d8b099b53a8a0c60e751cd80 100644 (file)
@@ -526,20 +526,6 @@ extern "C" {
   }
 #endif // _di_iki_read_main_
 
-#ifndef _di_iki_read_main_delete_
-  f_status_t iki_read_main_delete(iki_read_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    f_string_dynamic_resize(0, &main->buffer);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_iki_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index ca7413aba431d7c7cdb563f0b138dfcb2caa443b..f848894f55b36baa87320645b427a495ac4425c6 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// IKI Read includes.
+#include <program/iki_read/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_iki_read_program_version_
-  #define IKI_READ_program_version_major_s F_string_ascii_0_s
-  #define IKI_READ_program_version_minor_s F_string_ascii_5_s
-  #define IKI_READ_program_version_micro_s F_string_ascii_8_s
-
-  #define IKI_READ_program_version_major_s_length F_string_ascii_0_s_length
-  #define IKI_READ_program_version_minor_s_length F_string_ascii_5_s_length
-  #define IKI_READ_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
-    #define IKI_READ_program_version_nano_prefix_s
-    #define IKI_READ_program_version_nano_prefix_s_length 0
-  #endif // !(defined(IKI_READ_program_version_nano_prefix_s) && defined(IKI_READ_program_version_nano_prefix_s_length))
-
-  #if !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
-    #define IKI_READ_program_version_nano_s
-    #define IKI_READ_program_version_nano_s_length 0
-  #endif // !(defined(IKI_READ_program_version_nano_s) && defined(IKI_READ_program_version_nano_s_length))
-
-  #define IKI_READ_program_version_s IKI_READ_program_version_major_s F_string_ascii_period_s IKI_READ_program_version_minor_s F_string_ascii_period_s IKI_READ_program_version_micro_s IKI_READ_program_version_nano_prefix_s IKI_READ_program_version_nano_s
-
-  #define IKI_READ_program_version_s_length iki_read_program_version_major_s_length + F_string_ascii_period_s iki_read_program_version_minor_s_length + F_string_ascii_period_s_length + iki_read_program_version_micro_s_length + iki_read_program_version_nano_prefix_s_length + iki_read_program_version_nano_s_length
-
-  extern const f_string_static_t iki_read_program_version_s;
-#endif // _di_iki_read_program_version_
-
-#ifndef _di_iki_read_program_name_
-  #define IKI_READ_program_name_s      "iki_read"
-  #define IKI_READ_program_name_long_s "IKI Read"
-
-  #define IKI_READ_program_name_s_length      9
-  #define IKI_READ_program_name_long_s_length 9
-
-  extern const f_string_static_t iki_read_program_name_s;
-  extern const f_string_static_t iki_read_program_name_long_s;
-#endif // _di_iki_read_program_name_
-
-#ifndef _di_iki_read_defines_
-  #define iki_read_signal_check_d 10000
-
-  enum {
-    iki_read_mode_content_e = 1,
-    iki_read_mode_literal_e,
-    iki_read_mode_object_e,
-    iki_read_mode_total_e,
-  };
-
-  #define iki_read_short_at_s         "a"
-  #define iki_read_short_content_s    "c"
-  #define iki_read_short_line_s       "l"
-  #define iki_read_short_literal_s    "L"
-  #define iki_read_short_name_s       "n"
-  #define iki_read_short_object_s     "o"
-  #define iki_read_short_substitute_s "s"
-  #define iki_read_short_total_s      "t"
-  #define iki_read_short_whole_s      "w"
-
-  #define iki_read_long_at_s         "at"
-  #define iki_read_long_content_s    "content"
-  #define iki_read_long_line_s       "line"
-  #define iki_read_long_literal_s    "literal"
-  #define iki_read_long_name_s       "name"
-  #define iki_read_long_object_s     "object"
-  #define iki_read_long_substitute_s "substitute"
-  #define iki_read_long_total_s      "total"
-  #define iki_read_long_whole_s      "whole"
-
-  enum {
-    iki_read_parameter_help_e,
-    iki_read_parameter_light_e,
-    iki_read_parameter_dark_e,
-    iki_read_parameter_no_color_e,
-    iki_read_parameter_verbosity_quiet_e,
-    iki_read_parameter_verbosity_normal_e,
-    iki_read_parameter_verbosity_verbose_e,
-    iki_read_parameter_verbosity_debug_e,
-    iki_read_parameter_version_e,
-
-    iki_read_parameter_at_e,
-    iki_read_parameter_content_e,
-    iki_read_parameter_line_e,
-    iki_read_parameter_literal_e,
-    iki_read_parameter_name_e,
-    iki_read_parameter_object_e,
-    iki_read_parameter_whole_e,
-    iki_read_parameter_substitute_e,
-    iki_read_parameter_total_e,
-  };
-
-  #define iki_read_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_at_s, iki_read_long_at_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_content_s, iki_read_long_content_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_line_s, iki_read_long_line_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_literal_s, iki_read_long_literal_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_name_s, iki_read_long_name_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_object_s, iki_read_long_object_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_whole_s, iki_read_long_whole_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_substitute_s, iki_read_long_substitute_s, 0, 3, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_read_short_total_s, iki_read_long_total_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define iki_read_total_parameters_d 18
-#endif // _di_iki_read_defines_
-
-#ifndef _di_iki_read_substitution_t_
-  #define iki_read_substitution_vocabulary_s "vocabulary"
-  #define iki_read_substitution_replace_s    "replace"
-  #define iki_read_substitution_with_s       "with"
-
-  typedef struct {
-    f_string_static_t replace;
-    f_string_static_t with;
-  } iki_read_substitution_t;
-
-  #define iki_read_substitution_t_initialize \
-    { \
-      f_string_static_t_initialize, \
-      f_string_static_t_initialize, \
-    }
-
-  #define macro_iki_read_substitution_t_initialize(replace, with) \
-    { \
-      macro_f_string_static_t_initialize2(replace), \
-      macro_f_string_static_t_initialize2(with), \
-    }
-#endif // _di_iki_read_substitution_t_
-
-#ifndef _di_iki_read_substitutions_t_
-  typedef struct {
-    iki_read_substitution_t *array;
-
-    f_array_length_t size;
-    f_array_length_t used;
-  } iki_read_substitutions_t;
-
-  #define iki_read_substitutions_t_initialize { 0, 0, 0 }
-
-  #define macro_iki_read_substitutions_t_clear(replacements) macro_f_memory_structure_clear(replacements)
-
-  #define macro_iki_read_substitutions_t_delete_simple(replacements)  macro_f_memory_structure_delete_simple(replacements, iki_read_substitution_t)
-  #define macro_iki_read_substitutions_t_destroy_simple(replacements) macro_f_memory_structure_destroy_simple(replacements, iki_read_substitution_t)
-
-  #define macro_iki_read_substitutions_t_resize(status, replacements, length) macro_f_memory_structure_resize(status, replacements, iki_read_substitution_t, length)
-  #define macro_iki_read_substitutions_t_adjust(status, replacements, length) macro_f_memory_structure_adjust(status, replacements, iki_read_substitution_t, length)
-#endif // _di_iki_read_substitutions_t_
-
-#ifndef _di_iki_read_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    uint8_t mode;
-
-    f_number_unsigned_t at;
-    f_number_unsigned_t line;
-
-    f_string_dynamic_t buffer;
-
-    iki_read_substitutions_t replacements;
-
-    f_color_context_t context;
-  } iki_read_main_t;
-
-  #define iki_read_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      0, \
-      0, \
-      0, \
-      f_string_dynamic_t_initialize, \
-      iki_read_substitutions_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_iki_read_main_t_
-
 /**
  * Print help.
  *
@@ -298,25 +102,6 @@ extern "C" {
   extern f_status_t iki_read_main(iki_read_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_iki_read_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing iki_read_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see iki_read_main()
- */
-#ifndef _di_iki_read_main_delete_
-  extern f_status_t iki_read_main_delete(iki_read_main_t * const main);
-#endif // _di_iki_read_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 731e775d22e6f2541cd3f04184bd76835d3d3903..33f27fa426b4666763bb627e3763ea980e5e7614 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library iki_read.c private-common.c private-print.c private-read.c
+build_sources_library iki_read.c common.c private-common.c private-print.c private-read.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers iki_read.h
+build_sources_headers iki_read.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/iki_write/c/common.c b/level_3/iki_write/c/common.c
new file mode 100644 (file)
index 0000000..1f1ba64
--- /dev/null
@@ -0,0 +1,32 @@
+#include "iki_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_iki_write_main_delete_
+  f_status_t iki_write_main_delete(iki_write_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+    f_string_dynamic_resize(0, &main->buffer);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_iki_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/iki_write/c/common.h b/level_3/iki_write/c/common.h
new file mode 100644 (file)
index 0000000..2042e13
--- /dev/null
@@ -0,0 +1,167 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Write
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_common_h
+#define _iki_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_iki_write_program_version_
+  #define IKI_WRITE_program_version_major_s F_string_ascii_0_s
+  #define IKI_WRITE_program_version_minor_s F_string_ascii_5_s
+  #define IKI_WRITE_program_version_micro_s F_string_ascii_8_s
+
+  #define IKI_WRITE_program_version_major_s_length F_string_ascii_0_s_length
+  #define IKI_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define IKI_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
+    #define IKI_WRITE_program_version_nano_prefix_s
+    #define IKI_WRITE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
+
+  #if !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
+    #define IKI_WRITE_program_version_nano_s
+    #define IKI_WRITE_program_version_nano_s_length 0
+  #endif // !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
+
+  #define IKI_WRITE_program_version_s IKI_WRITE_program_version_major_s F_string_ascii_period_s IKI_WRITE_program_version_minor_s F_string_ascii_period_s IKI_WRITE_program_version_micro_s IKI_WRITE_program_version_nano_prefix_s IKI_WRITE_program_version_nano_s
+
+  #define IKI_WRITE_program_version_s_length IKI_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_micro_s_length + IKI_WRITE_program_version_nano_prefix_s_length + IKI_WRITE_program_version_nano_s_length
+
+  extern const f_string_static_t iki_write_program_version_s;
+#endif // _di_iki_write_program_version_
+
+#ifndef _di_iki_write_program_name_
+  #define iki_write_program_name_s      "iki_write"
+  #define iki_write_program_name_long_s "IKI Write"
+
+  #define IKI_WRITE_program_name_s_length      9
+  #define IKI_WRITE_program_name_long_s_length 9
+
+  extern const f_string_static_t iki_write_program_name_s;
+  extern const f_string_static_t iki_write_program_name_long_s;
+#endif // _di_iki_write_program_name_
+
+#ifndef _di_iki_write_defines_
+  #define iki_write_signal_check_d 10000
+
+  #define iki_write_short_file_s    "f"
+  #define iki_write_short_content_s "c"
+  #define iki_write_short_double_s  "d"
+  #define iki_write_short_object_s  "o"
+  #define iki_write_short_single_s  "s"
+
+  #define iki_write_long_file_s    "file"
+  #define iki_write_long_content_s "content"
+  #define iki_write_long_double_s  "double"
+  #define iki_write_long_object_s  "object"
+  #define iki_write_long_single_s  "single"
+
+  enum {
+    iki_write_parameter_help_e,
+    iki_write_parameter_light_e,
+    iki_write_parameter_dark_e,
+    iki_write_parameter_no_color_e,
+    iki_write_parameter_verbosity_quiet_e,
+    iki_write_parameter_verbosity_normal_e,
+    iki_write_parameter_verbosity_verbose_e,
+    iki_write_parameter_verbosity_debug_e,
+    iki_write_parameter_version_e,
+
+    iki_write_parameter_file_e,
+    iki_write_parameter_content_e,
+    iki_write_parameter_double_e,
+    iki_write_parameter_object_e,
+    iki_write_parameter_single_e,
+  };
+
+  #define iki_write_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(iki_write_short_file_s, iki_write_long_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_write_short_content_s, iki_write_long_content_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_write_short_double_s, iki_write_long_double_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_write_short_object_s, iki_write_long_object_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(iki_write_short_single_s, iki_write_long_single_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define iki_write_total_parameters_d 14
+#endif // _di_iki_write_defines_
+
+#ifndef _di_iki_write_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_string_static_t quote;
+    f_string_dynamic_t buffer;
+
+    f_color_context_t context;
+  } iki_write_main_t;
+
+  #define iki_write_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_string_static_t_initialize, \
+      f_string_dynamic_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_iki_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing iki_write_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see iki_write_main()
+ */
+#ifndef _di_iki_write_main_delete_
+  extern f_status_t iki_write_main_delete(iki_write_main_t * const main);
+#endif // _di_iki_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_common_h
index 2ef52b5967e48015059e51ee2f63f21e5cfa8f52..fa14b47082e4aa0ab92183b124cb8bcd817fa561 100644 (file)
@@ -496,20 +496,6 @@ extern "C" {
   }
 #endif // _di_iki_write_main_
 
-#ifndef _di_iki_write_main_delete_
-  f_status_t iki_write_main_delete(iki_write_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-    f_string_dynamic_resize(0, &main->buffer);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_iki_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 64f9aeb1ddd47e7aa622ad4a316cb9c118ea38cd..e9ed4022a698b19e37d1fb8b9cf0385be71d1ccb 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// IKI Write includes.
+#include <program/iki_write/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_iki_write_program_version_
-  #define IKI_WRITE_program_version_major_s F_string_ascii_0_s
-  #define IKI_WRITE_program_version_minor_s F_string_ascii_5_s
-  #define IKI_WRITE_program_version_micro_s F_string_ascii_8_s
-
-  #define IKI_WRITE_program_version_major_s_length F_string_ascii_0_s_length
-  #define IKI_WRITE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define IKI_WRITE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
-    #define IKI_WRITE_program_version_nano_prefix_s
-    #define IKI_WRITE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(IKI_WRITE_program_version_nano_prefix_s) && defined(IKI_WRITE_program_version_nano_prefix_s_length))
-
-  #if !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
-    #define IKI_WRITE_program_version_nano_s
-    #define IKI_WRITE_program_version_nano_s_length 0
-  #endif // !(defined(IKI_WRITE_program_version_nano_s) && defined(IKI_WRITE_program_version_nano_s_length))
-
-  #define IKI_WRITE_program_version_s IKI_WRITE_program_version_major_s F_string_ascii_period_s IKI_WRITE_program_version_minor_s F_string_ascii_period_s IKI_WRITE_program_version_micro_s IKI_WRITE_program_version_nano_prefix_s IKI_WRITE_program_version_nano_s
-
-  #define IKI_WRITE_program_version_s_length IKI_WRITE_program_version_major_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_minor_s_length + F_string_ascii_period_s_length + IKI_WRITE_program_version_micro_s_length + IKI_WRITE_program_version_nano_prefix_s_length + IKI_WRITE_program_version_nano_s_length
-
-  extern const f_string_static_t iki_write_program_version_s;
-#endif // _di_iki_write_program_version_
-
-#ifndef _di_iki_write_program_name_
-  #define iki_write_program_name_s      "iki_write"
-  #define iki_write_program_name_long_s "IKI Write"
-
-  #define IKI_WRITE_program_name_s_length      9
-  #define IKI_WRITE_program_name_long_s_length 9
-
-  extern const f_string_static_t iki_write_program_name_s;
-  extern const f_string_static_t iki_write_program_name_long_s;
-#endif // _di_iki_write_program_name_
-
-#ifndef _di_iki_write_defines_
-  #define iki_write_signal_check_d 10000
-
-  #define iki_write_short_file_s    "f"
-  #define iki_write_short_content_s "c"
-  #define iki_write_short_double_s  "d"
-  #define iki_write_short_object_s  "o"
-  #define iki_write_short_single_s  "s"
-
-  #define iki_write_long_file_s    "file"
-  #define iki_write_long_content_s "content"
-  #define iki_write_long_double_s  "double"
-  #define iki_write_long_object_s  "object"
-  #define iki_write_long_single_s  "single"
-
-  enum {
-    iki_write_parameter_help_e,
-    iki_write_parameter_light_e,
-    iki_write_parameter_dark_e,
-    iki_write_parameter_no_color_e,
-    iki_write_parameter_verbosity_quiet_e,
-    iki_write_parameter_verbosity_normal_e,
-    iki_write_parameter_verbosity_verbose_e,
-    iki_write_parameter_verbosity_debug_e,
-    iki_write_parameter_version_e,
-
-    iki_write_parameter_file_e,
-    iki_write_parameter_content_e,
-    iki_write_parameter_double_e,
-    iki_write_parameter_object_e,
-    iki_write_parameter_single_e,
-  };
-
-  #define iki_write_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(iki_write_short_file_s, iki_write_long_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_write_short_content_s, iki_write_long_content_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_write_short_double_s, iki_write_long_double_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_write_short_object_s, iki_write_long_object_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(iki_write_short_single_s, iki_write_long_single_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define iki_write_total_parameters_d 14
-#endif // _di_iki_write_defines_
-
-#ifndef _di_iki_write_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_string_static_t quote;
-    f_string_dynamic_t buffer;
-
-    f_color_context_t context;
-  } iki_write_main_t;
-
-  #define iki_write_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_string_static_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_iki_write_main_t_
-
 /**
  * Print help.
  *
@@ -224,25 +102,6 @@ extern "C" {
   extern f_status_t iki_write_main(iki_write_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_iki_write_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing iki_write_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see iki_write_main()
- */
-#ifndef _di_iki_write_main_delete_
-  extern f_status_t iki_write_main_delete(iki_write_main_t * const main);
-#endif // _di_iki_write_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index f9f8e922fc0f404b1adb669141b2c75873d7a868..8ff5352886e7c32c37ee2b56001504bf894fab69 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library iki_write.c private-common.c private-write.c
+build_sources_library iki_write.c common.c private-common.c private-write.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers iki_write.h
+build_sources_headers iki_write.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/status_code/c/common.c b/level_3/status_code/c/common.c
new file mode 100644 (file)
index 0000000..3bcc73c
--- /dev/null
@@ -0,0 +1,31 @@
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_status_code_main_delete_
+  f_status_t status_code_main_delete(status_code_main_t * const main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/status_code/c/common.h b/level_3/status_code/c/common.h
new file mode 100644 (file)
index 0000000..ba5bd97
--- /dev/null
@@ -0,0 +1,158 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_common_h
+#define _status_code_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_program_version_
+  #define STATUS_CODE_program_version_major_s F_string_ascii_0_s
+  #define STATUS_CODE_program_version_minor_s F_string_ascii_5_s
+  #define STATUS_CODE_program_version_micro_s F_string_ascii_8_s
+
+  #define STATUS_CODE_program_version_major_s_length F_string_ascii_0_s_length
+  #define STATUS_CODE_program_version_minor_s_length F_string_ascii_5_s_length
+  #define STATUS_CODE_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
+    #define STATUS_CODE_program_version_nano_prefix_s
+    #define STATUS_CODE_program_version_nano_prefix_s_length 0
+  #endif // !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
+
+  #if !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
+    #define STATUS_CODE_program_version_nano_s
+    #define STATUS_CODE_program_version_nano_s_length 0
+  #endif // !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
+
+  #define STATUS_CODE_progam_version_s STATUS_CODE_program_version_major_s F_string_ascii_period_s STATUS_CODE_program_version_minor_s F_string_ascii_period_s STATUS_CODE_program_version_micro_s STATUS_CODE_progam_version_nano_prefix_s STATUS_CODE_progam_version_nano_s
+
+  #define STATUS_CODE_progam_version_s_length STATUS_CODE_program_version_major_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_minor_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_micro_s_length + STATUS_CODE_progam_version_nano_prefix_s_length + STATUS_CODE_progam_version_nano_s_length
+
+  extern const f_string_static_t status_code_program_version_s;
+#endif // _di_status_code_program_version_
+
+#ifndef _di_status_code_program_name_
+  #define STATUS_CODE_progam_name_s      "status_code"
+  #define STATUS_CODE_progam_name_long_s "FSS Status Code"
+
+  #define STATUS_CODE_program_name_s_length      11
+  #define STATUS_CODE_program_name_long_s_length 15
+
+  extern const f_string_static_t status_code_program_name_s;
+  extern const f_string_static_t status_code_program_name_long_s;
+#endif // _di_status_code_program_name_
+
+#ifndef _di_status_code_defines_
+  #define status_code_signal_check_d 10000
+
+  #define status_code_short_is_fine_s    "f"
+  #define status_code_short_is_warning_s "w"
+  #define status_code_short_is_error_s   "e"
+  #define status_code_short_number_s     "n"
+
+  #define status_code_long_is_fine_s    "is_fine"
+  #define status_code_long_is_warning_s "is_warning"
+  #define status_code_long_is_error_s   "is_error"
+  #define status_code_long_number_s     "number"
+
+  enum {
+    status_code_parameter_help_e,
+    status_code_parameter_light_e,
+    status_code_parameter_dark_e,
+    status_code_parameter_no_color_e,
+    status_code_parameter_verbosity_quiet_e,
+    status_code_parameter_verbosity_normal_e,
+    status_code_parameter_verbosity_verbose_e,
+    status_code_parameter_verbosity_debug_e,
+    status_code_parameter_version_e,
+
+    status_code_parameter_is_fine_e,
+    status_code_parameter_is_warning_e,
+    status_code_parameter_is_error_e,
+    status_code_parameter_number_e,
+  };
+
+  #define status_code_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(status_code_short_is_fine_s, status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(status_code_short_is_warning_s, status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(status_code_short_is_error_s, status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(status_code_short_number_s, status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define status_code_total_parameters_d 13
+#endif // _di_status_code_defines_
+
+#ifndef _di_status_code_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } status_code_main_t;
+
+  #define status_code_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_status_code_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing status_code_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see status_code_main()
+ */
+#ifndef _di_status_code_main_delete_
+  extern f_status_t status_code_main_delete(status_code_main_t * const main);
+#endif // _di_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_common_h
index f64092cff90169ec5e12168c0470ab656d0327f9..1ae1f9b001a956eb5025840e0971d1ef0e69d627 100644 (file)
@@ -310,19 +310,6 @@ extern "C" {
   }
 #endif // _di_status_code_main_
 
-#ifndef _di_status_code_main_delete_
-  f_status_t status_code_main_delete(status_code_main_t * const main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_status_code_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 59741f5f2cc69dd11c7630bcb78fd4fece37883c..c091bb74c4ea4b70520236978aff309fc90776e1 100644 (file)
 #include <fll/level_2/program.h>
 #include <fll/level_2/status_string.h>
 
+// Status Code includes.
+#include <program/status_code/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_status_code_program_version_
-  #define STATUS_CODE_program_version_major_s F_string_ascii_0_s
-  #define STATUS_CODE_program_version_minor_s F_string_ascii_5_s
-  #define STATUS_CODE_program_version_micro_s F_string_ascii_8_s
-
-  #define STATUS_CODE_program_version_major_s_length F_string_ascii_0_s_length
-  #define STATUS_CODE_program_version_minor_s_length F_string_ascii_5_s_length
-  #define STATUS_CODE_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
-    #define STATUS_CODE_program_version_nano_prefix_s
-    #define STATUS_CODE_program_version_nano_prefix_s_length 0
-  #endif // !(defined(STATUS_CODE_program_version_nano_prefix_s) && defined(STATUS_CODE_program_version_nano_prefix_s_length))
-
-  #if !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
-    #define STATUS_CODE_program_version_nano_s
-    #define STATUS_CODE_program_version_nano_s_length 0
-  #endif // !(defined(STATUS_CODE_program_version_nano_s) && defined(STATUS_CODE_program_version_nano_s_length))
-
-  #define STATUS_CODE_progam_version_s STATUS_CODE_program_version_major_s F_string_ascii_period_s STATUS_CODE_program_version_minor_s F_string_ascii_period_s STATUS_CODE_program_version_micro_s STATUS_CODE_progam_version_nano_prefix_s STATUS_CODE_progam_version_nano_s
-
-  #define STATUS_CODE_progam_version_s_length STATUS_CODE_program_version_major_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_minor_s_length + F_string_ascii_period_s_length + STATUS_CODE_program_version_micro_s_length + STATUS_CODE_progam_version_nano_prefix_s_length + STATUS_CODE_progam_version_nano_s_length
-
-  extern const f_string_static_t status_code_program_version_s;
-#endif // _di_status_code_program_version_
-
-#ifndef _di_status_code_program_name_
-  #define STATUS_CODE_progam_name_s      "status_code"
-  #define STATUS_CODE_progam_name_long_s "FSS Status Code"
-
-  #define STATUS_CODE_program_name_s_length      11
-  #define STATUS_CODE_program_name_long_s_length 15
-
-  extern const f_string_static_t status_code_program_name_s;
-  extern const f_string_static_t status_code_program_name_long_s;
-#endif // _di_status_code_program_name_
-
-#ifndef _di_status_code_defines_
-  #define status_code_signal_check_d 10000
-
-  #define status_code_short_is_fine_s    "f"
-  #define status_code_short_is_warning_s "w"
-  #define status_code_short_is_error_s   "e"
-  #define status_code_short_number_s     "n"
-
-  #define status_code_long_is_fine_s    "is_fine"
-  #define status_code_long_is_warning_s "is_warning"
-  #define status_code_long_is_error_s   "is_error"
-  #define status_code_long_number_s     "number"
-
-  enum {
-    status_code_parameter_help_e,
-    status_code_parameter_light_e,
-    status_code_parameter_dark_e,
-    status_code_parameter_no_color_e,
-    status_code_parameter_verbosity_quiet_e,
-    status_code_parameter_verbosity_normal_e,
-    status_code_parameter_verbosity_verbose_e,
-    status_code_parameter_verbosity_debug_e,
-    status_code_parameter_version_e,
-
-    status_code_parameter_is_fine_e,
-    status_code_parameter_is_warning_e,
-    status_code_parameter_is_error_e,
-    status_code_parameter_number_e,
-  };
-
-  #define status_code_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(status_code_short_is_fine_s, status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(status_code_short_is_warning_s, status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(status_code_short_is_error_s, status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(status_code_short_number_s, status_code_long_number_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define status_code_total_parameters_d 13
-#endif // _di_status_code_defines_
-
-#ifndef _di_status_code_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } status_code_main_t;
-
-  #define status_code_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_status_code_main_t_
-
 /**
  * Print help.
  *
@@ -206,25 +93,6 @@ extern "C" {
   extern f_status_t status_code_main(status_code_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_status_code_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing status_code_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see status_code_main()
- */
-#ifndef _di_status_code_main_delete_
-  extern f_status_t status_code_main_delete(status_code_main_t * const main);
-#endif // _di_status_code_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e1275a941913bb3c66f65062202cb2179be1b4dd..c9d81d44cb668e682e33b5ab2dd512826693d5f7 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library status_code.c private-common.c private-status_code.c
+build_sources_library status_code.c common.c private-common.c private-status_code.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers status_code.h
+build_sources_headers status_code.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script
diff --git a/level_3/utf8/c/common.c b/level_3/utf8/c/common.c
new file mode 100644 (file)
index 0000000..d1a892d
--- /dev/null
@@ -0,0 +1,31 @@
+#include "utf8.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+  const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_version_s_length);
+#endif // _di_firewall_program_version_
+
+#ifndef _di_firewall_program_name_
+  const f_string_static_t firewall_program_name_s = macro_f_string_static_t_initialize(FIREWALL_program_name_s, 0, FIREWALL_program_name_s_length);
+  const f_string_static_t firewall_program_name_long_s = macro_f_string_static_t_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_utf8_main_delete_
+  f_status_t utf8_main_delete(utf8_main_t *main) {
+
+    f_console_parameters_delete(&main->parameters);
+
+    f_type_array_lengths_resize(0, &main->remaining);
+
+    macro_f_color_context_t_delete_simple(main->context);
+
+    return F_none;
+  }
+#endif // _di_utf8_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/utf8/c/common.h b/level_3/utf8/c/common.h
new file mode 100644 (file)
index 0000000..934eb40
--- /dev/null
@@ -0,0 +1,268 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: UTF-8
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the common data structures.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _utf8_common_h
+#define _utf8_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_utf8_program_version_
+  #define UTF8_program_version_major_s F_string_ascii_0_s
+  #define UTF8_program_version_minor_s F_string_ascii_5_s
+  #define UTF8_program_version_micro_s F_string_ascii_8_s
+
+  #define UTF8_program_version_major_s_length F_string_ascii_0_s_length
+  #define UTF8_program_version_minor_s_length F_string_ascii_5_s_length
+  #define UTF8_program_version_micro_s_length F_string_ascii_8_s_length
+
+  #if !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
+    #define UTF8_program_version_nano_prefix_s
+    #define UTF8_program_version_nano_prefix_s_length 0
+  #endif // !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
+
+  #if !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
+    #define UTF8_program_version_nano_s
+    #define UTF8_program_version_nano_s_length 0
+  #endif // !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
+
+  #define UTF8_program_version_s UTF8_program_version_major_s F_string_ascii_period_s UTF8_program_version_minor_s F_string_ascii_period_s UTF8_program_version_micro_s UTF8_program_version_nano_prefix_s UTF8_program_version_nano_s
+
+  #define UTF8_program_version_s_length UTF8_program_version_major_s_length + F_string_ascii_period_s_length + UTF8_program_version_minor_s_length + F_string_ascii_period_s_length + UTF8_program_version_micro_s_length + UTF8_program_version_nano_prefix_s_length + UTF8_program_version_nano_s_length
+
+    extern const f_string_static_t utf8_program_version_s;
+#endif // _di_utf8_program_version_
+
+#ifndef _di_utf8_program_name_
+  #define UTF8_program_name_s      "utf8"
+  #define UTF8_program_name_long_s "UTF-8"
+
+  #define UTF8_program_name_s_length      4
+  #define UTF8_program_name_long_s_length 5
+
+  extern const f_string_static_t utf8_program_name_s;
+  extern const f_string_static_t utf8_program_name_long_s;
+#endif // _di_utf8_program_name_
+
+/**
+ * Set to at least 4 to provide a UTF-8 friendly allocation step.
+ */
+#ifndef _di_utf8_default_allocation_step_
+  #define utf8_default_allocation_step_d 16
+#endif // _di_utf8_default_allocation_step_
+
+#ifndef _di_utf8_defines_
+  #define utf8_signal_check_d 10000
+
+  #define utf8_string_from_s "from"
+  #define utf8_string_to_s   "to"
+
+  #define utf8_string_verified_valid_s     "Verified Valid"
+  #define utf8_string_verified_valid_not_s "Verified Invalid"
+
+  #define utf8_string_combining_is_s  "C"
+  #define utf8_string_combining_not_s "N"
+  #define utf8_string_unknown_s       "?"
+
+  #define utf8_string_width_0_s "0"
+  #define utf8_string_width_1_s "1"
+  #define utf8_string_width_2_s "2"
+
+  #define utf8_string_from_s_length 4
+  #define utf8_string_to_s_length   2
+
+  #define utf8_string_verified_valid_s_length     14
+  #define utf8_string_verified_valid_not_s_length 16
+
+  #define utf8_string_combining_is_s_length  1
+  #define utf8_string_combining_not_s_length 1
+  #define utf8_string_unknown_s_length       1
+
+  #define utf8_string_width_0_s_length 1
+  #define utf8_string_width_1_s_length 1
+  #define utf8_string_width_2_s_length 1
+
+  #define utf8_character_valid_not_s "�"
+
+  #define utf8_short_from_binary_s    "b"
+  #define utf8_short_from_codepoint_s "c"
+  #define utf8_short_from_file_s      "f"
+
+  #define utf8_short_headers_s       "H"
+  #define utf8_short_separate_s      "S"
+  #define utf8_short_strip_invalid_s "s"
+  #define utf8_short_verify_s        "v"
+
+  #define utf8_short_to_binary_s    "B"
+  #define utf8_short_to_codepoint_s "C"
+  #define utf8_short_to_combining_s "O"
+  #define utf8_short_to_file_s      "F"
+  #define utf8_short_to_width_s     "W"
+
+  #define utf8_long_from_binary_s    "from_binary"
+  #define utf8_long_from_codepoint_s "from_codepoint"
+  #define utf8_long_from_file_s      "from_file"
+
+  #define utf8_long_headers_s       "headers"
+  #define utf8_long_separate_s      "separate"
+  #define utf8_long_strip_invalid_s "strip_invalid"
+  #define utf8_long_verify_s        "verify"
+
+  #define utf8_long_to_binary_s    "to_binary"
+  #define utf8_long_to_codepoint_s "to_codepoint"
+  #define utf8_long_to_combining_s "to_combining"
+  #define utf8_long_to_file_s      "to_file"
+  #define utf8_long_to_width_s     "to_width"
+
+  enum {
+    utf8_parameter_help_e,
+    utf8_parameter_light_e,
+    utf8_parameter_dark_e,
+    utf8_parameter_no_color_e,
+    utf8_parameter_verbosity_quiet_e,
+    utf8_parameter_verbosity_normal_e,
+    utf8_parameter_verbosity_verbose_e,
+    utf8_parameter_verbosity_debug_e,
+    utf8_parameter_version_e,
+
+    utf8_parameter_from_binary_e,
+    utf8_parameter_from_codepoint_e,
+    utf8_parameter_from_file_e,
+
+    utf8_parameter_headers_e,
+    utf8_parameter_separate_e,
+    utf8_parameter_strip_invalid_e,
+
+    utf8_parameter_to_binary_e,
+    utf8_parameter_to_codepoint_e,
+    utf8_parameter_to_combining_e,
+    utf8_parameter_to_file_e,
+    utf8_parameter_to_width_e,
+
+    utf8_parameter_verify_e,
+  };
+
+  #define utf8_console_parameter_t_initialize \
+    { \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_from_binary_s, utf8_long_from_binary_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_from_file_s, utf8_long_from_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_headers_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_separate_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_to_binary_s, utf8_long_to_binary_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_to_combining_s, utf8_long_to_combining_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_to_file_s, utf8_long_to_file_s, 0, 1, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_to_width_s, utf8_long_to_width_s, 0, 0, f_console_type_normal_e), \
+      macro_f_console_parameter_t_initialize(utf8_short_verify_s, utf8_long_verify_s, 0, 0, f_console_type_normal_e), \
+    }
+
+  #define utf8_total_parameters_d 21
+#endif // _di_utf8_defines_
+
+/**
+ * Modes used to designate how to the input and output are to be processed.
+ *
+ * utf8_mode_from_*:
+ *   - binary:    The input format is binary.
+ *   - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX).
+ *
+ * utf8_mode_to_*:
+ *   - binary:    The outout format is binary.
+ *   - codepoint: The outout format is codepoint (U+XXXX or U+XXXXXX).
+ *   - combining: The outout format is whether or not character is combining (may be used with "width").
+ *   - width:     The outout format is how wide the character is (may be used with "combining").
+ */
+#ifndef _di_utf8_modes_
+  #define utf8_mode_from_binary_d    0x1
+  #define utf8_mode_from_codepoint_d 0x2
+  #define utf8_mode_to_binary_d      0x4
+  #define utf8_mode_to_codepoint_d   0x8
+  #define utf8_mode_to_combining_d   0x10
+  #define utf8_mode_to_width_d       0x20
+#endif // _di_utf8_modes_
+
+/**
+ * The main program data.
+ *
+ * parameters:   The state of pre-defined parameters passed to the program.
+ * remaining:    The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output:       The output file for general printing.
+ * error:        The output file for error printing.
+ * warning:      The output file for warning printing.
+ * signal:       The process signal management structure.
+ * context:      The color context.
+ */
+#ifndef _di_utf8_main_t_
+  typedef struct {
+    f_console_parameters_t parameters;
+
+    f_array_lengths_t remaining;
+    bool process_pipe;
+
+    fl_print_t output;
+    fl_print_t error;
+    fl_print_t warning;
+
+    f_signal_t signal;
+
+    f_color_context_t context;
+  } utf8_main_t;
+
+  #define utf8_main_t_initialize \
+    { \
+      f_console_parameters_t_initialize, \
+      f_array_lengths_t_initialize, \
+      F_false, \
+      fl_print_t_initialize, \
+      macro_fl_print_t_initialize_error(), \
+      macro_fl_print_t_initialize_warning(), \
+      f_signal_t_initialize, \
+      f_color_context_t_initialize, \
+    }
+#endif // _di_utf8_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing utf8_main().
+ *
+ * @param main
+ *   The main program data.
+ *
+ * @return
+ *   F_none on success.
+ *
+ *   Status codes (with error bit) are returned on any problem.
+ *
+ * @see utf8_main()
+ */
+#ifndef _di_utf8_main_delete_
+  extern f_status_t utf8_main_delete(utf8_main_t *main);
+#endif // _di_utf8_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _utf8_common_h
index 82c66c7c1f6d15be92cf2da4c84744751c4ed1c5..5f273347712e56a21c8f66f6951ba071b309e214 100644 (file)
@@ -517,19 +517,6 @@ extern "C" {
   }
 #endif // _di_utf8_main_
 
-#ifndef _di_utf8_main_delete_
-  f_status_t utf8_main_delete(utf8_main_t *main) {
-
-    f_console_parameters_delete(&main->parameters);
-
-    f_type_array_lengths_resize(0, &main->remaining);
-
-    macro_f_color_context_t_delete_simple(main->context);
-
-    return F_none;
-  }
-#endif // _di_utf8_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 674caebb1693e7b4045612748d29bdeffc2bdf1f..aa1f211ea1fcfe362ab9f4bd4b61cb1e565ddde5 100644 (file)
 #include <fll/level_2/print.h>
 #include <fll/level_2/program.h>
 
+// UTF-8 includes.
+#include <program/utf8/common.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_utf8_program_version_
-  #define UTF8_program_version_major_s F_string_ascii_0_s
-  #define UTF8_program_version_minor_s F_string_ascii_5_s
-  #define UTF8_program_version_micro_s F_string_ascii_8_s
-
-  #define UTF8_program_version_major_s_length F_string_ascii_0_s_length
-  #define UTF8_program_version_minor_s_length F_string_ascii_5_s_length
-  #define UTF8_program_version_micro_s_length F_string_ascii_8_s_length
-
-  #if !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
-    #define UTF8_program_version_nano_prefix_s
-    #define UTF8_program_version_nano_prefix_s_length 0
-  #endif // !(defined(UTF8_program_version_nano_prefix_s) && defined(UTF8_program_version_nano_prefix_s_length))
-
-  #if !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
-    #define UTF8_program_version_nano_s
-    #define UTF8_program_version_nano_s_length 0
-  #endif // !(defined(UTF8_program_version_nano_s) && defined(UTF8_program_version_nano_s_length))
-
-  #define UTF8_program_version_s UTF8_program_version_major_s F_string_ascii_period_s UTF8_program_version_minor_s F_string_ascii_period_s UTF8_program_version_micro_s UTF8_program_version_nano_prefix_s UTF8_program_version_nano_s
-
-  #define UTF8_program_version_s_length UTF8_program_version_major_s_length + F_string_ascii_period_s_length + UTF8_program_version_minor_s_length + F_string_ascii_period_s_length + UTF8_program_version_micro_s_length + UTF8_program_version_nano_prefix_s_length + UTF8_program_version_nano_s_length
-
-    extern const f_string_static_t utf8_program_version_s;
-#endif // _di_utf8_program_version_
-
-#ifndef _di_utf8_program_name_
-  #define UTF8_program_name_s      "utf8"
-  #define UTF8_program_name_long_s "UTF-8"
-
-  #define UTF8_program_name_s_length      4
-  #define UTF8_program_name_long_s_length 5
-
-  extern const f_string_static_t utf8_program_name_s;
-  extern const f_string_static_t utf8_program_name_long_s;
-#endif // _di_utf8_program_name_
-
-/**
- * Set to at least 4 to provide a UTF-8 friendly allocation step.
- */
-#ifndef _di_utf8_default_allocation_step_
-  #define utf8_default_allocation_step_d 16
-#endif // _di_utf8_default_allocation_step_
-
-#ifndef _di_utf8_defines_
-  #define utf8_signal_check_d 10000
-
-  #define utf8_string_from_s "from"
-  #define utf8_string_to_s   "to"
-
-  #define utf8_string_verified_valid_s     "Verified Valid"
-  #define utf8_string_verified_valid_not_s "Verified Invalid"
-
-  #define utf8_string_combining_is_s  "C"
-  #define utf8_string_combining_not_s "N"
-  #define utf8_string_unknown_s       "?"
-
-  #define utf8_string_width_0_s "0"
-  #define utf8_string_width_1_s "1"
-  #define utf8_string_width_2_s "2"
-
-  #define utf8_string_from_s_length 4
-  #define utf8_string_to_s_length   2
-
-  #define utf8_string_verified_valid_s_length     14
-  #define utf8_string_verified_valid_not_s_length 16
-
-  #define utf8_string_combining_is_s_length  1
-  #define utf8_string_combining_not_s_length 1
-  #define utf8_string_unknown_s_length       1
-
-  #define utf8_string_width_0_s_length 1
-  #define utf8_string_width_1_s_length 1
-  #define utf8_string_width_2_s_length 1
-
-  #define utf8_character_valid_not_s "�"
-
-  #define utf8_short_from_binary_s    "b"
-  #define utf8_short_from_codepoint_s "c"
-  #define utf8_short_from_file_s      "f"
-
-  #define utf8_short_headers_s       "H"
-  #define utf8_short_separate_s      "S"
-  #define utf8_short_strip_invalid_s "s"
-  #define utf8_short_verify_s        "v"
-
-  #define utf8_short_to_binary_s    "B"
-  #define utf8_short_to_codepoint_s "C"
-  #define utf8_short_to_combining_s "O"
-  #define utf8_short_to_file_s      "F"
-  #define utf8_short_to_width_s     "W"
-
-  #define utf8_long_from_binary_s    "from_binary"
-  #define utf8_long_from_codepoint_s "from_codepoint"
-  #define utf8_long_from_file_s      "from_file"
-
-  #define utf8_long_headers_s       "headers"
-  #define utf8_long_separate_s      "separate"
-  #define utf8_long_strip_invalid_s "strip_invalid"
-  #define utf8_long_verify_s        "verify"
-
-  #define utf8_long_to_binary_s    "to_binary"
-  #define utf8_long_to_codepoint_s "to_codepoint"
-  #define utf8_long_to_combining_s "to_combining"
-  #define utf8_long_to_file_s      "to_file"
-  #define utf8_long_to_width_s     "to_width"
-
-  enum {
-    utf8_parameter_help_e,
-    utf8_parameter_light_e,
-    utf8_parameter_dark_e,
-    utf8_parameter_no_color_e,
-    utf8_parameter_verbosity_quiet_e,
-    utf8_parameter_verbosity_normal_e,
-    utf8_parameter_verbosity_verbose_e,
-    utf8_parameter_verbosity_debug_e,
-    utf8_parameter_version_e,
-
-    utf8_parameter_from_binary_e,
-    utf8_parameter_from_codepoint_e,
-    utf8_parameter_from_file_e,
-
-    utf8_parameter_headers_e,
-    utf8_parameter_separate_e,
-    utf8_parameter_strip_invalid_e,
-
-    utf8_parameter_to_binary_e,
-    utf8_parameter_to_codepoint_e,
-    utf8_parameter_to_combining_e,
-    utf8_parameter_to_file_e,
-    utf8_parameter_to_width_e,
-
-    utf8_parameter_verify_e,
-  };
-
-  #define utf8_console_parameter_t_initialize \
-    { \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_help_s.string, f_console_standard_long_help_s.string, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_light_s.string, f_console_standard_long_light_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_dark_s.string, f_console_standard_long_dark_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_no_color_s.string, f_console_standard_long_no_color_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_quiet_s.string, f_console_standard_long_quiet_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_normal_s.string, f_console_standard_long_normal_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_from_binary_s, utf8_long_from_binary_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_from_file_s, utf8_long_from_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_headers_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_separate_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_to_binary_s, utf8_long_to_binary_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_to_combining_s, utf8_long_to_combining_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_to_file_s, utf8_long_to_file_s, 0, 1, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_to_width_s, utf8_long_to_width_s, 0, 0, f_console_type_normal_e), \
-      macro_f_console_parameter_t_initialize(utf8_short_verify_s, utf8_long_verify_s, 0, 0, f_console_type_normal_e), \
-    }
-
-  #define utf8_total_parameters_d 21
-#endif // _di_utf8_defines_
-
-/**
- * Modes used to designate how to the input and output are to be processed.
- *
- * utf8_mode_from_*:
- *   - binary:    The input format is binary.
- *   - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX).
- *
- * utf8_mode_to_*:
- *   - binary:    The outout format is binary.
- *   - codepoint: The outout format is codepoint (U+XXXX or U+XXXXXX).
- *   - combining: The outout format is whether or not character is combining (may be used with "width").
- *   - width:     The outout format is how wide the character is (may be used with "combining").
- */
-#ifndef _di_utf8_modes_
-  #define utf8_mode_from_binary_d    0x1
-  #define utf8_mode_from_codepoint_d 0x2
-  #define utf8_mode_to_binary_d      0x4
-  #define utf8_mode_to_codepoint_d   0x8
-  #define utf8_mode_to_combining_d   0x10
-  #define utf8_mode_to_width_d       0x20
-#endif // _di_utf8_modes_
-
-/**
- * The main program data.
- *
- * parameters:   The state of pre-defined parameters passed to the program.
- * remaining:    The remaining, non-pre-defined parameters, passed to the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * output:       The output file for general printing.
- * error:        The output file for error printing.
- * warning:      The output file for warning printing.
- * signal:       The process signal management structure.
- * context:      The color context.
- */
-#ifndef _di_utf8_main_t_
-  typedef struct {
-    f_console_parameters_t parameters;
-
-    f_array_lengths_t remaining;
-    bool process_pipe;
-
-    fl_print_t output;
-    fl_print_t error;
-    fl_print_t warning;
-
-    f_signal_t signal;
-
-    f_color_context_t context;
-  } utf8_main_t;
-
-  #define utf8_main_t_initialize \
-    { \
-      f_console_parameters_t_initialize, \
-      f_array_lengths_t_initialize, \
-      F_false, \
-      fl_print_t_initialize, \
-      macro_fl_print_t_initialize_error(), \
-      macro_fl_print_t_initialize_warning(), \
-      f_signal_t_initialize, \
-      f_color_context_t_initialize, \
-    }
-#endif // _di_utf8_main_t_
-
 /**
  * Print help.
  *
@@ -332,25 +109,6 @@ extern "C" {
   extern f_status_t utf8_main(utf8_main_t * const main, const f_console_arguments_t *arguments);
 #endif // _di_utf8_main_
 
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing utf8_main().
- *
- * @param main
- *   The main program data.
- *
- * @return
- *   F_none on success.
- *
- *   Status codes (with error bit) are returned on any problem.
- *
- * @see utf8_main()
- */
-#ifndef _di_utf8_main_delete_
-  extern f_status_t utf8_main_delete(utf8_main_t *main);
-#endif // _di_utf8_main_delete_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 2b4411f8cdff2a9201725e3c8b9b1950f5a895fd..0686e879629f54ac8f653c446f3708854cd4d363 100644 (file)
@@ -26,13 +26,13 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 build_libraries_shared
 build_libraries_static
-build_sources_library utf8.c private-common.c private-print.c private-utf8.c private-utf8_binary.c private-utf8_codepoint.c
+build_sources_library utf8.c common.c private-common.c private-print.c private-utf8.c private-utf8_binary.c private-utf8_codepoint.c
 build_sources_library_shared
 build_sources_library_static
 build_sources_program main.c
 build_sources_program_shared
 build_sources_program_static
-build_sources_headers utf8.h
+build_sources_headers utf8.h common.h
 build_sources_headers_shared
 build_sources_headers_static
 build_sources_script