]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work, focusing on
authorKevin Day <kevin@kevux.org>
Sat, 4 Mar 2023 06:12:11 +0000 (00:12 -0600)
committerKevin Day <kevin@kevux.org>
Sat, 4 Mar 2023 06:12:11 +0000 (00:12 -0600)
The interrupt function behavior changed and the ampersand should not be passed now.
This is causing a double reference bug.

Explicitly allocate a small amount of memory for console parameters for the default allocation step.

Rename fll_program_standard_signal_state() to fll_program_standard_signal_handle().
Update fll_program_standard_signal_handle() to follow the new handle structure.

Reduce the first and last line functions and function calls.
I've decided to make some more initial assumptions to simplify the code.
Always print the first and last line to message.
This is a behavioral change.
I do not think the first and last line should be printed to error anymore.
This change simplifies the logic significantly.

Add the first printed check flag.

Update print functions.

Update file structure.

Update file documentation comments.

The iki_read and fss_write have more work to do.
Once that is done I need to resume working on Featureless Make.

144 files changed:
level_0/f_iki/c/iki/common.h
level_1/fl_fss/c/fss/basic.c
level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/c/fss/embedded_list.c
level_1/fl_fss/c/fss/extended_list.c
level_1/fl_fss/c/private-fss.c
level_2/fll_fss/c/fss/payload.c
level_2/fll_program/c/private-program.c
level_2/fll_program/c/private-program.h
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_2/fll_program/c/program/print.c
level_3/byte_dump/c/byte_dump.c
level_3/byte_dump/c/common.c
level_3/byte_dump/c/common.h
level_3/control/c/common.c
level_3/control/c/common.h
level_3/control/c/control.c
level_3/control/c/private-control.c
level_3/controller/c/common.c
level_3/controller/c/common.h
level_3/controller/c/controller.c
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/fake/c/main/build/load.c
level_3/fake/c/main/common.c
level_3/fake/c/main/common/define.h
level_3/fake/c/main/main.c
level_3/fake/c/main/make/load_fakefile.c
level_3/fake/c/main/make/operate.c
level_3/fake/c/main/print-error.h
level_3/fake/c/main/print.c
level_3/fake/c/main/print.h
level_3/firewall/c/common.h
level_3/firewall/c/firewall.c
level_3/fss_basic_list_read/c/common.c
level_3/fss_basic_list_read/c/common.h
level_3/fss_basic_list_read/c/fss_basic_list_read.c
level_3/fss_basic_list_read/c/private-read.c
level_3/fss_basic_read/c/common.c
level_3/fss_basic_read/c/common.h
level_3/fss_basic_read/c/fss_basic_read.c
level_3/fss_basic_read/c/private-read.c
level_3/fss_embedded_list_read/c/common.c
level_3/fss_embedded_list_read/c/common.h
level_3/fss_embedded_list_read/c/fss_embedded_list_read.c
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_extended_list_read/c/common.c
level_3/fss_extended_list_read/c/common.h
level_3/fss_extended_list_read/c/fss_extended_list_read.c
level_3/fss_extended_list_read/c/private-read.c
level_3/fss_extended_read/c/common.c
level_3/fss_extended_read/c/common.h
level_3/fss_extended_read/c/fss_extended_read.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_identify/c/common.c
level_3/fss_identify/c/common.h
level_3/fss_identify/c/fss_identify.c
level_3/fss_payload_read/c/common.c
level_3/fss_payload_read/c/fss_payload_read.c
level_3/fss_payload_read/c/private-read.c
level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic/main.c
level_3/fss_write/c/basic/print.c
level_3/fss_write/c/basic/print.h
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/basic_list/print.c
level_3/fss_write/c/basic_list/print.h
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/embedded_list/print.c
level_3/fss_write/c/embedded_list/print.h
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended/print.c
level_3/fss_write/c/extended/print.h
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/extended_list/print.c
level_3/fss_write/c/extended_list/print.h
level_3/fss_write/c/main/common-type.h
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/main-print.c
level_3/fss_write/c/main/main.c
level_3/fss_write/c/main/print.c
level_3/fss_write/c/main/print.h
level_3/fss_write/c/payload/fss_write.c
level_3/fss_write/c/payload/main.c
level_3/fss_write/c/payload/print.c
level_3/fss_write/c/payload/print.h
level_3/iki_read/c/main/common-type.h
level_3/iki_read/c/main/common.c
level_3/iki_read/c/main/main.c
level_3/iki_read/c/main/private-read.c
level_3/iki_write/c/main/common.c
level_3/iki_write/c/main/common/print.c [moved from level_3/iki_write/c/main/common-print.c with 95% similarity]
level_3/iki_write/c/main/common/print.h [moved from level_3/iki_write/c/main/common-print.h with 100% similarity]
level_3/iki_write/c/main/common/string.c [moved from level_3/iki_write/c/main/common-string.c with 99% similarity]
level_3/iki_write/c/main/common/string.h [moved from level_3/iki_write/c/main/common-string.h with 100% similarity]
level_3/iki_write/c/main/common/type.c [moved from level_3/iki_write/c/main/common-type.c with 76% similarity]
level_3/iki_write/c/main/common/type.h [moved from level_3/iki_write/c/main/common-type.h with 81% similarity]
level_3/iki_write/c/main/iki_write.c
level_3/iki_write/c/main/iki_write.h
level_3/iki_write/c/main/main.c
level_3/iki_write/c/main/print-error.c [new file with mode: 0644]
level_3/iki_write/c/main/print-error.h [new file with mode: 0644]
level_3/iki_write/c/main/print.c
level_3/iki_write/c/main/print.h
level_3/iki_write/c/main/private-common.c [deleted file]
level_3/iki_write/c/main/private-common.h [deleted file]
level_3/iki_write/c/main/process.c [moved from level_3/iki_write/c/main/private-write.c with 81% similarity]
level_3/iki_write/c/main/process.h [moved from level_3/iki_write/c/main/private-write.h with 82% similarity]
level_3/iki_write/data/build/settings
level_3/status_code/c/fss/print.h
level_3/status_code/c/fss/status_code.h
level_3/status_code/c/main/common.c
level_3/status_code/c/main/common/type.h
level_3/status_code/c/main/convert.c
level_3/status_code/c/main/convert.h
level_3/status_code/c/main/print-data.c [new file with mode: 0644]
level_3/status_code/c/main/print-data.h [new file with mode: 0644]
level_3/status_code/c/main/print-error.c
level_3/status_code/c/main/print-error.h
level_3/status_code/c/main/print.c
level_3/status_code/c/main/print.h
level_3/status_code/c/main/process.c
level_3/status_code/c/main/process.h
level_3/status_code/c/main/status_code.c
level_3/status_code/c/main/status_code.h
level_3/status_code/data/build/settings
level_3/utf8/c/main/bytesequence.h
level_3/utf8/c/main/codepoint.h
level_3/utf8/c/main/common.c
level_3/utf8/c/main/common/type.h
level_3/utf8/c/main/print-data.c
level_3/utf8/c/main/print-data.h
level_3/utf8/c/main/print-error.c
level_3/utf8/c/main/print-error.h
level_3/utf8/c/main/print.c
level_3/utf8/c/main/print.h
level_3/utf8/c/main/process.h
level_3/utf8/c/main/utf8.c

index 35b62d78ef8c2ea6a4f87d61417719b417bd1595..15f4a0aa9d01754edef5fe65f24e7bba36fc3b28 100644 (file)
@@ -22,12 +22,14 @@ extern "C" {
  * For a UTF-8 friendly allocation step, set to at least 4.
  *
  * F_iki_default_allocation_*:
- *   - large: The large allocation size.
- *   - small: The small allocation size, in particular used for allocation iki strings.
+ *   - console: An allocation step used for small buffers specifically for console parameter.
+ *   - large:   The large allocation size.
+ *   - small:   The small allocation size, in particular used for allocation iki strings.
  */
 #ifndef _di_f_iki_default_d_
-  #define F_iki_default_allocation_large_d F_memory_default_allocation_large_d
-  #define F_iki_default_allocation_small_d 8
+  #define F_iki_default_allocation_console_d 8
+  #define F_iki_default_allocation_large_d   F_memory_default_allocation_large_d
+  #define F_iki_default_allocation_small_d   8
 #endif // _di_f_iki_default_d_
 
 /**
index b5821f96acb739b589dfb2e8d06eaec0e3d6baa4..cdcfd3cb11ed8535f9b14de4cdb35c9751bd4e25 100644 (file)
@@ -47,7 +47,7 @@ extern "C" {
     for (;; ++range->start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -106,7 +106,7 @@ extern "C" {
     for (; range->start <= range->stop && range->start < content.used; ++range->start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) return;
       }
 
index 8246829dd3c1180e78b816aab4300e1e7998a8c3..17d720da6100cb707aba5c886c8a15be1d1943f4 100644 (file)
@@ -56,7 +56,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -82,7 +82,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -101,7 +101,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -177,7 +177,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -341,7 +341,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < content.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -361,7 +361,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -614,7 +614,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -625,7 +625,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -660,7 +660,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -760,7 +760,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -892,7 +892,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -956,7 +956,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -966,7 +966,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
index 5705908631fd5783e5b625bd15dbc84dbdc1572e..817e8ad4967513def8d81fa432a578d81340021e 100644 (file)
@@ -82,7 +82,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -139,7 +139,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -218,7 +218,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -372,7 +372,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -480,7 +480,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -535,7 +535,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -661,7 +661,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -848,7 +848,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < content.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -870,7 +870,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) {
               destination->used = destination_used;
 
@@ -1175,7 +1175,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -1189,7 +1189,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -1223,7 +1223,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -1319,7 +1319,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -1385,7 +1385,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -1485,7 +1485,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -1549,7 +1549,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -1559,7 +1559,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
 
             if (F_status_set_fine(state->status) == F_interrupt) {
               destination->used = destination_used;
index 77302ea9bbaafecba1923234282c3ddba4f87e4f..f02e7b931930f35874c2ce78fb131734d1c6f8f6 100644 (file)
@@ -53,7 +53,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -75,7 +75,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -96,7 +96,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -142,7 +142,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -285,7 +285,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < content.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -311,7 +311,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) {
               destination->used = destination_used;
 
@@ -615,7 +615,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -629,7 +629,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_placeholder_s.string[0] || buffer.string[range->start] == f_fss_slash_s.string[0])) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -663,7 +663,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) break;
             }
 
@@ -758,7 +758,7 @@ extern "C" {
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -824,7 +824,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -925,7 +925,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -989,7 +989,7 @@ extern "C" {
     while (range->start <= range->stop && range->start < object.used) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -999,7 +999,7 @@ extern "C" {
         for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
 
             if (F_status_set_fine(state->status) == F_interrupt) {
               destination->used = destination_used;
index 5061d4cb4ac3b361351cb5a0f3da6e46d1605138..64e9ba146b466e1a7cb3bbdc80857e6e51ea7b18 100644 (file)
@@ -13,7 +13,7 @@ extern "C" {
     for (; range->start <= range->stop && range->start < buffer.used; ++range->start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) return;
       }
 
@@ -40,7 +40,7 @@ extern "C" {
     for (; destination_range.start < destination->used; ++destination_range.start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) return;
       }
 
@@ -66,7 +66,7 @@ extern "C" {
     for (destination_range.start = destination->used - 1; destination_range.start > 0; --destination_range.start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) return;
       }
 
@@ -147,7 +147,7 @@ extern "C" {
       while (buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
           if (F_status_set_fine(state->status) == F_interrupt) return;
         }
 
@@ -192,7 +192,7 @@ extern "C" {
       while (range->start <= range->stop && range->start < buffer.used) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
           if (F_status_set_fine(state->status) == F_interrupt) return;
         }
 
@@ -283,7 +283,7 @@ extern "C" {
       while (range->start <= range->stop && range->start < buffer.used) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
           if (F_status_set_fine(state->status) == F_interrupt) return;
         }
 
@@ -297,7 +297,7 @@ extern "C" {
           while (range->start <= range->stop && range->start < buffer.used) {
 
             if (state->interrupt) {
-              state->interrupt((void *) &state, 0);
+              state->interrupt((void *) state, 0);
               if (F_status_set_fine(state->status) == F_interrupt) return;
             }
 
@@ -396,7 +396,7 @@ extern "C" {
                 while (buffer.string[range->start] == f_fss_placeholder_s.string[0]) {
 
                   if (state->interrupt) {
-                    state->interrupt((void *) &state, 0);
+                    state->interrupt((void *) state, 0);
                     if (F_status_set_fine(state->status) == F_interrupt) return;
                   }
 
@@ -421,7 +421,7 @@ extern "C" {
                   while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
                     if (state->interrupt) {
-                      state->interrupt((void *) &state, 0);
+                      state->interrupt((void *) state, 0);
                       if (F_status_set_fine(state->status) == F_interrupt) return;
                     }
 
@@ -545,7 +545,7 @@ extern "C" {
             while (range->start <= range->stop && range->start < buffer.used) {
 
               if (state->interrupt) {
-                state->interrupt((void *) &state, 0);
+                state->interrupt((void *) state, 0);
                 if (F_status_set_fine(state->status) == F_interrupt) return;
               }
 
@@ -574,7 +574,7 @@ extern "C" {
                 while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
 
                   if (state->interrupt) {
-                    state->interrupt((void *) &state, 0);
+                    state->interrupt((void *) state, 0);
                     if (F_status_set_fine(state->status) == F_interrupt) return;
                   }
 
@@ -656,7 +656,7 @@ extern "C" {
       while (range->start <= range->stop && range->start < buffer.used) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
           if (F_status_set_fine(state->status) == F_interrupt) break;
         }
 
@@ -762,7 +762,7 @@ extern "C" {
     for (; range->start <= range->stop && range->start < object.used; ) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
         if (F_status_set_fine(state->status) == F_interrupt) break;
       }
 
@@ -773,7 +773,7 @@ extern "C" {
         for (; range->start <= range->stop && range->start < object.used; ++range->start) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) break;
           }
 
@@ -1053,7 +1053,7 @@ extern "C" {
         for (i = input_start + 1; i <= range->stop && i < object.used; ++i) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
 
             if (F_status_set_fine(state->status) == F_interrupt) {
               destination->used = used_start;
@@ -1114,7 +1114,7 @@ extern "C" {
     for (; destination_range.start < destination->used; ++destination_range.start) {
 
       if (state->interrupt) {
-        state->interrupt((void *) &state, 0);
+        state->interrupt((void *) state, 0);
 
         if (F_status_set_fine(state->status) == F_interrupt) {
           destination->used = used_start;
@@ -1132,7 +1132,7 @@ extern "C" {
       for (++destination_range.start; destination_range.start < destination->used; ++destination_range.start) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
 
           if (F_status_set_fine(state->status) == F_interrupt) {
             destination->used = used_start;
@@ -1164,7 +1164,7 @@ extern "C" {
       for (destination_range.start = destination->used - 1; destination_range.start > front; --destination_range.start) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
 
           if (F_status_set_fine(state->status) == F_interrupt) {
             destination->used = used_start;
@@ -1185,7 +1185,7 @@ extern "C" {
       for (; destination_range.start > front; --destination_range.start) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
 
           if (F_status_set_fine(state->status) == F_interrupt) {
             destination->used = used_start;
@@ -1221,7 +1221,7 @@ extern "C" {
       for (destination_range.start = front; destination_range.start < rear; ++destination_range.start) {
 
         if (state->interrupt) {
-          state->interrupt((void *) &state, 0);
+          state->interrupt((void *) state, 0);
 
           if (F_status_set_fine(state->status) == F_interrupt) {
             destination->used = used_start;
index c74738a7e07b06e6ad1ef9f80c039c793a4bef14..0f11149e1de4a62cd81d88cadb73ce9a8685ac07 100644 (file)
@@ -242,7 +242,7 @@ extern "C" {
         for (; i < content.used && i + F_fss_default_block_size_normal_d < content.used; i += F_fss_default_block_size_normal_d) {
 
           if (state->interrupt) {
-            state->interrupt((void *) &state, 0);
+            state->interrupt((void *) state, 0);
             if (F_status_set_fine(state->status) == F_interrupt) return;
           }
 
index 07444323409ffb300bdf938ebdc252fd01b49f3b..df4e53b428f67cd5e1a90b74d182a4fbf938a3bb 100644 (file)
@@ -15,7 +15,7 @@ extern "C" {
   }
 #endif // !defined(_di_fll_program_print_help_option_) || !defined(_di_fll_program_print_help_option_standard_)
 
-#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
   uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const main) {
 
     if (!main || main->signal.id == -1) return 0;
@@ -40,7 +40,7 @@ extern "C" {
 
     return 0;
   }
-#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
 
 #if !defined(_di_fll_program_parameter_process_context_) || !defined(_di_fll_program_parameter_process_empty_)
   void private_fll_program_parameter_process_empty(f_color_context_t * const context, f_color_set_t * const sets[]) {
index b433bfb3987cf0558bca1a718ad7327183ae10f5..30269849c874a44946a845df643fe7c1ec26e7ed 100644 (file)
@@ -61,11 +61,11 @@ extern "C" {
  * @see f_signal_read()
  *
  * @see fll_program_standard_signal_received()
- * @see fll_program_standard_signal_state()
+ * @see fll_program_standard_signal_handle()
  */
-#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#if !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
   uint32_t private_fll_program_standard_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_state_)
+#endif // !defined(_di_fll_program_standard_signal_received_) || !defined(_di_fll_program_standard_signal_handle_)
 
 /**
  * Private implementation of fll_program_parameter_process_empty().
index 856e5cba97e6c1005e9cd7def08736154955a6f7..f62b0c18d0a1b4be9cc15260593007f86007348b 100644 (file)
@@ -541,25 +541,32 @@ extern "C" {
   }
 #endif // _di_fll_program_standard_signal_received_
 
-#ifndef _di_fll_program_standard_signal_state_
-  f_status_t fll_program_standard_signal_state(void * const state, void * const internal) {
+#ifndef _di_fll_program_standard_signal_handle_
+  void fll_program_standard_signal_handle(void * const void_state, void * const internal) {
+    #ifndef _di_level_2_parameter_checking_
+      if (!void_state) return;
+    #endif // _di_level_2_parameter_checking_
 
-    if (!state) return F_interrupt_not;
+    f_state_t * const state = (f_state_t *) void_state;
 
-    f_state_t *state_ptr = (f_state_t *) state;
-    if (!state_ptr->custom) return F_interrupt_not;
+    if (!state->custom) {
+      state->status = F_interrupt_not;
 
-    fll_program_data_t *custom = (fll_program_data_t *) state_ptr->custom;
+      return;
+    }
 
-    custom->signal_received = private_fll_program_standard_signal_received(custom);
+    fll_program_data_t * const main = (fll_program_data_t *) state->custom;
 
-    if (custom->signal_received == F_signal_abort || custom->signal_received == F_signal_broken_pipe || custom->signal_received == F_signal_hangup || custom->signal_received == F_signal_interrupt || custom->signal_received == F_signal_quit || custom->signal_received == F_signal_termination) {
-      return F_status_set_error(F_interrupt);
-    }
+    main->signal_received = private_fll_program_standard_signal_received(main);
 
-    return F_interrupt_not;
+    if (main->signal_received == F_signal_abort || main->signal_received == F_signal_broken_pipe || main->signal_received == F_signal_hangup || main->signal_received == F_signal_interrupt || main->signal_received == F_signal_quit || main->signal_received == F_signal_termination) {
+      state->status = F_status_set_error(F_interrupt);
+    }
+    else {
+      state->status = F_interrupt_not;
+    }
   }
-#endif // _di_fll_program_standard_signal_state_
+#endif // _di_fll_program_standard_signal_handle_
 
 #ifdef __cplusplus
 } // extern "C"
index c53f57a80fd8dd4c0b1708e05060692a77fe0009..38f6f9bdf84a0f999252183a18043596cae7eb59 100644 (file)
@@ -349,19 +349,20 @@ extern "C" {
  *
  *   When constructing the f_state_t variable, a fll_program_data_t pointer must be passed into the f_state_t.custom variable.
  *   This requires the state.custom variable to be of type (fll_program_data_t *).
- * @param internal
- *   Not used.
+ *   This must not be NULL.
  *
- * @return
- *   F_interrupt_not if not interrupted.
+ *   This alters state.status:
+ *     F_interrupt_not if not interrupted.
  *
- *   F_interrupt (with error bit) if interrupted.
+ *     F_interrupt (with error bit) if interrupted.
+ * @param internal
+ *   Not used.
  *
  * @see fll_program_standard_signal_received()
  */
-#ifndef _di_fll_program_standard_signal_state_
-  extern f_status_t fll_program_standard_signal_state(void * const state, void * const internal);
-#endif // _di_fll_program_standard_signal_state_
+#ifndef _di_fll_program_standard_signal_handle_
+  extern void fll_program_standard_signal_handle(void * const state, void * const internal);
+#endif // _di_fll_program_standard_signal_handle_
 
 #ifdef __cplusplus
 } // extern "C"
index 945a2edb81844a7c78ed8f7d287c5a0d9d12c4b3..da0f7208970c6535ec87ca2bb7dd50d893d23031 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_missing_file_
   f_status_t fll_program_print_error_missing_file(const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -57,7 +57,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_missing_variable_not_zero_
   f_status_t fll_program_print_error_missing_variable_not_zero(const fl_print_t print, const f_string_static_t variable) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -76,7 +76,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_
   f_status_t fll_program_print_error_parameter_both_specified_same_amount(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t name_1, const f_string_static_t name_2) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -95,7 +95,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_both_specified_same_amount_without_
   f_status_t fll_program_print_error_parameter_both_specified_same_amount_without(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -116,7 +116,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_cannot_use_with_
   f_status_t fll_program_print_error_parameter_cannot_use_with(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t name_1, const f_string_static_t name_2) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -135,7 +135,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_cannot_use_with_without_
   f_status_t fll_program_print_error_parameter_cannot_use_with_without(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -156,7 +156,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_cannot_use_with_pipe_
   f_status_t fll_program_print_error_parameter_cannot_use_with_pipe(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t parameter) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -173,7 +173,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_cannot_use_with_xor_
   f_status_t fll_program_print_error_parameter_cannot_use_with_xor(const fl_print_t print, const f_string_static_t symbol_1, const f_string_static_t symbol_2, const f_string_static_t symbol_3, const f_string_static_t name_1, const f_string_static_t name_2, const f_string_static_t name_3) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -194,7 +194,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_integer_not_
   f_status_t fll_program_print_error_parameter_integer_not(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -213,7 +213,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_integer_not_negative_
   f_status_t fll_program_print_error_parameter_integer_not_negative(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -232,7 +232,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_integer_not_positive_
   f_status_t fll_program_print_error_parameter_integer_not_positive(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -251,7 +251,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_missing_value_
   f_status_t fll_program_print_error_parameter_missing_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -268,7 +268,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_missing_value_requires_amount_
   f_status_t fll_program_print_error_parameter_missing_value_requires_amount(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t amount) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -287,7 +287,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_must_specify_once_
   f_status_t fll_program_print_error_parameter_must_specify_once(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -304,7 +304,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_must_specify_once_value_
   f_status_t fll_program_print_error_parameter_must_specify_once_value(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -323,7 +323,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_process_
   f_status_t fll_program_print_error_parameter_process(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -340,7 +340,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_range_start_before_stop_
   f_status_t fll_program_print_error_parameter_range_start_before_stop(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value_start, const f_string_static_t value_stop) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -361,7 +361,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_parameter_value_too_long_
   f_status_t fll_program_print_error_parameter_value_too_long(const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -378,7 +378,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_pipe_invalid_form_feed_
   f_status_t fll_program_print_error_pipe_invalid_form_feed(const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -393,7 +393,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_pipe_missing_content_
   f_status_t fll_program_print_error_pipe_missing_content(const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -408,7 +408,7 @@ extern "C" {
 #ifndef _di_fll_program_print_error_pipe_object_without_content_
   f_status_t fll_program_print_error_pipe_object_without_content(const fl_print_t print) {
 
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
index e0cdc1caa228fe396f0f80591edb96e528732df1..12fe1bc893a20e82696442b1e874b17f5010d68c 100644 (file)
@@ -11,7 +11,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = byte_dump_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = byte_dump_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index bacafe1ae65179a1ba7e03d94e76d197b3ddc1cc..2b5b2540d2a479ecce4b2e047c65985c740ac47b 100644 (file)
@@ -81,10 +81,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = byte_dump_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = byte_dump_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       byte_dump_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 2022ea0c8af1c01e9dd934fd83f35a38b9a09a36..24170e8e71361d6a6657d854907f402061e60210 100644 (file)
@@ -60,6 +60,22 @@ extern "C" {
 #endif // _di_byte_dump_program_name_s_
 
 /**
+ * The program defines.
+ *
+ * byte_dump_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_byte_dump_d_
+  #define byte_dump_allocation_console_d 4
+  #define byte_dump_allocation_large_d   256
+  #define byte_dump_allocation_small_d   16
+  #define byte_dump_signal_check_d       20000
+#endif // _di_byte_dump_d_
+
+/**
  * The program strings for printing.
  */
 #ifndef _di_byte_dump_print_s_
index 60fdcee7e35422271213b97c5cefaf15317b5d2d..b94566811aa47a34c7bd2307d0555738a71e3a46 100644 (file)
@@ -184,10 +184,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = control_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = control_write_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       control_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 4bd5d6422b93b378e567b18543d0ca0c197570fc..7656bdb3d5bb50d352e7702413cb1f89e9895fd0 100644 (file)
@@ -60,6 +60,22 @@ extern "C" {
 #endif // _di_control_program_name_s_
 
 /**
+ * The program defines.
+ *
+ * control_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_control_d_
+  #define control_allocation_console_d 4
+  #define control_allocation_large_d   256
+  #define control_allocation_small_d   16
+  #define control_signal_check_d       20000
+#endif // _di_control_d_
+
+/**
  * The main program parameters.
  */
 #ifndef _di_control_parameter_d_
index 2f30e3a5f7813b5326ef5de4108d83aeca2a3fe6..24acb067ec8d82f83b54a5d3ca416c4f60180051 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = control_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = control_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 89a83f10508d9c7e07c9ddd459ac6f61b0dd7c5b..4cb5bcee9c235bb49c78f00c057c2affef974d72 100644 (file)
@@ -167,7 +167,7 @@ extern "C" {
       if (F_status_is_error(status)) return status;
     }
 
-    const f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    const f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
 
     f_string_static_t contents_array[main->parameters.remaining.used];
     f_string_statics_t contents = macro_f_string_statics_t_initialize(contents_array, 0, main->parameters.remaining.used);
@@ -318,7 +318,7 @@ extern "C" {
     }
 
     {
-      f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(control_allocation_large_d, control_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
       f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
 
       status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
index 3553ee1461e56c0afb44581ab86d3143d82e1825..865c2c0cbdec2d20196bea76bd4b618409295efd 100644 (file)
@@ -616,10 +616,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = controller_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = controller_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       controller_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 86df47a14c1948b44975e6b9f3d42b75822d586b..79dc8fd0d49870a4b0f93073bed01cd831033ce8 100644 (file)
@@ -46,6 +46,22 @@ extern "C" {
 #endif // _di_controller_program_version_s_
 
 /**
+ * The program defines.
+ *
+ * controller_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
+ */
+#ifndef _di_controller_d_
+  #define controller_allocation_console_d 4
+  #define controller_allocation_large_d   256
+  #define controller_allocation_small_d   16
+  #define controller_signal_check_d       20000
+#endif // _di_controller_d_
+
+/**
  * The main program parameters.
  */
 #ifndef _di_controller_parameter_d_
index cf3db5ec73e28c61a604d736b6bca744f21c504b..2858a83d1e95343fb0752283c6d84516f94a130d 100644 (file)
@@ -17,7 +17,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = controller_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = controller_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 8fb55c9fa5b4dbacbd3665339dead9e13be09f30..47be22db6e0546248ecd0a4190d845b6af05d129 100644 (file)
@@ -95,7 +95,7 @@ extern "C" {
 
     {
       controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-      f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
       f_string_range_t range = content_range;
 
       status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
@@ -1577,7 +1577,7 @@ extern "C" {
     if (F_status_is_error_not(status)) {
       if (cache->buffer_file.used) {
         controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-        f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
         f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
 
         status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
@@ -1876,7 +1876,7 @@ extern "C" {
 
     {
       controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_entry, global.thread);
-      f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+      f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
       f_string_range_t range = content_range;
 
       status = fll_fss_extended_read(cache->buffer_file, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
index 0194fd30d1aeff45e4373d04187b24134052a08c..04481f562efa762f02cfe4b7b015b9ac83e2545a 100644 (file)
@@ -222,7 +222,7 @@ extern "C" {
     f_status_t status = F_none;
 
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
 
     f_array_length_t i = 0;
 
@@ -2360,7 +2360,7 @@ extern "C" {
 
     f_status_t status = F_none;
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
     f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_item.used);
     f_array_length_t last = 0;
 
@@ -3785,7 +3785,7 @@ extern "C" {
 
       if (cache->buffer_file.used) {
         controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-        f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+        f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
         f_string_range_t range = macro_f_string_range_t_initialize2(cache->buffer_file.used);
 
         status = fll_fss_basic_list_read(cache->buffer_file, state, &range, &cache->object_items, &cache->content_items, &cache->delimits, 0, &cache->comments);
@@ -3951,7 +3951,7 @@ extern "C" {
     f_string_range_t range2 = f_string_range_t_initialize;
 
     controller_state_interrupt_t custom = macro_controller_state_interrupt_t_initialize(is_normal, global.thread);
-    f_state_t state = macro_f_state_t_initialize(controller_common_allocation_large_d, controller_common_allocation_small_d, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
+    f_state_t state = macro_f_state_t_initialize_1(controller_common_allocation_large_d, controller_common_allocation_small_d, F_none, 0, 0, &controller_thread_signal_state_fss, 0, (void *) &custom, 0);
 
     status = fll_fss_extended_read(cache->buffer_item, state, &range, &cache->object_actions, &cache->content_actions, 0, 0, &cache->delimits, 0);
 
index e16da258116ebe7c92840697c18d085ea2f31ec1..0a726642f1558c2963af85ba3017f766736428cf 100644 (file)
@@ -146,7 +146,7 @@ extern "C" {
       if (F_status_is_error_not(*status)) {
         f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used);
         f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
-        f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
+        f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
 
         *status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0);
 
index bb9a99f9ae81a4fff1ed0fea764e583f364b2b77..82b77fdc84257505a462aec68128060586a8f480 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
       data.main = main;
       data.setting = setting;
 
-      f_console_parameter_process(arguments, &main->parameters, &setting->state, (void *) &data);
+      f_console_parameter_process(arguments, &main->parameters, &setting->state.status, (void *) &data);
     }
 
     if (F_status_is_error(setting->state.status)) {
index f308b4500344de327401695b1a481ee0f99ca181..e27f346344ff4a6ee7a62db6973255050140f68a 100644 (file)
 extern "C" {
 #endif
 
-/***
- * Default allocations.
- *
- * Set to at least 4 to provide a UTF-8 friendly allocation step.
+/**
+ * The program defines.
  *
- * fake_default_allocation_*_d:
- *   - large: A buffer size used for large allocations.
- *   - pipe:  A buffer size used for processing piped data.
- *   - small: A buffer size used for small allocations.
+ * fake_*_d:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_pipe:    A buffer size used for processing piped data.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
-#ifndef _di_fake_default_d_
-  #define fake_default_allocation_large_d 64
-  #define fake_default_allocation_pipe_d  16384
-  #define fake_default_allocation_small_d 8
-#endif // _di_fake_default_d_
+#ifndef _di_fake_d_
+  #define fake_allocation_console_d 4
+  #define fake_allocation_large_d   256
+  #define fake_allocation_pipe_d    16384
+  #define fake_allocation_small_d   16
+  #define fake_signal_check_d       20000
+#endif // _di_fake_d_
 
 /**
  * The program defines.
index 358c1bdf10de4c1a5412a91f452ce531129deb7e..9525042ba75414fa5d355b273ba138f16e10d0b9 100644 (file)
@@ -40,5 +40,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     exit(data.child);
   }
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 61d5e4a1f0882a913316163060b5bbc3d8b6474f..e60b380aa0e689f0b9cf3b13f2fe7084e3f89d0c 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
     {
       f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used);
       f_fss_comments_t comments = f_fss_comments_t_initialize;
-      f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
 
       *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments);
 
@@ -87,7 +87,7 @@ extern "C" {
       bool missing_settings = F_true;
 
       f_fss_set_t settings = f_fss_set_t_initialize;
-      f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
 
       if (list_objects.used > data_make->fakefile.size) {
         macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
index b310f114be7f3bd3716ca000c47c87eec4b95fcb..25b78e476b362c5a7088f39c51e33765e4ab9227 100644 (file)
@@ -231,7 +231,7 @@ extern "C" {
 
     f_iki_data_t *iki_data = &data_make->cache_iki;
 
-    f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0);
 
     f_string_range_t range = f_string_range_t_initialize;
     f_string_map_multis_t *parameter = &data_make->setting_make.parameter;
index fdd22e8c80bd7b902d5c00545b0c4133e5290d7b..e12966b7c789e5ccefde104808cb36fc4ba26983 100644 (file)
@@ -78,7 +78,7 @@ extern "C" {
  *   Designates the how and where to print.
  * @param status
  *   The status to use.
- *   This is provided, ignoring data.setting->status, for thread-safety reasons.
+ *   This is provided, ignoring setting->state.status, for thread-safety reasons.
  * @param function
  *   The name of the function where the error happened.
  * @param operation
index f0d10b1dddc2a9d5adefd3e02a2cd756fdfce736..54ebd14cb0886d24e6ded061592e55b4981634b1 100644 (file)
@@ -141,7 +141,7 @@ extern "C" {
 #ifndef _di_fake_print_help_
   f_status_t fake_print_help(fake_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     f_file_stream_lock(print.to);
 
@@ -230,7 +230,7 @@ extern "C" {
 #ifndef _di_fake_print_line_first_locked_
   f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     if (setting->flag & fake_main_flag_print_first_e) {
       fll_print_dynamic_raw(setting->line_first, print.to);
@@ -248,7 +248,7 @@ extern "C" {
 #ifndef _di_fake_print_line_first_unlocked_
   f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     if (setting->flag & fake_main_flag_print_first_e) {
       fll_print_dynamic_raw(setting->line_first, print.to);
@@ -266,7 +266,7 @@ extern "C" {
 #ifndef _di_fake_print_line_last_locked_
   f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     fll_print_dynamic_raw(setting->line_last, print.to);
 
@@ -277,7 +277,7 @@ extern "C" {
 #ifndef _di_fake_print_line_last_unlocked_
   f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     f_print_dynamic_raw(setting->line_last, print.to);
 
index c82cb5de71374b46b4494949926a5d3cd327d8b0..fcaa42c74deddd372946a749fe73fffe429a6790 100644 (file)
@@ -307,6 +307,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_help_
   extern f_status_t fake_print_help(fake_setting_t * const setting, const fl_print_t print);
@@ -353,6 +355,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_line_first_locked_
   extern f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print);
@@ -377,6 +381,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_line_first_unlocked_
   extern f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print);
@@ -399,6 +405,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_line_last_locked_
   extern f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print);
@@ -421,6 +429,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_line_last_unlocked_
   extern f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print);
@@ -439,6 +449,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_operation_all_complete_
   extern f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print);
@@ -459,6 +471,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fake_print_operation_cancelled_
   extern f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation);
index e7e351b47a64ed5ce0c1602d0eac402f3c89cfdf..0f01382e3365b1bc1d5e1ffe4be595aea8785fe9 100644 (file)
@@ -99,17 +99,19 @@ extern "C" {
 #endif // _di_firewall_path_s_
 
 /**
- * Default allocations.
- */
-#ifndef _di_firewall_default_d_
-  #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
-#endif // _di_firewall_default_d_
-
-/**
  * The program defines.
+ *
+ * firewall_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_firewall_d_
-  #define firewall_signal_check_d 20000
+  #define firewall_allocation_console_d 4
+  #define firewall_allocation_large_d   256
+  #define firewall_allocation_small_d   16
+  #define firewall_signal_check_d       20000
 #endif // _di_firewall_d_
 
 /**
index 916da214e95b8f7c22ef130b0293fa0be5071e98..7539695e113f43972eb49214d8313686da8351f7 100644 (file)
@@ -17,9 +17,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
-    main->child = 0;
+    setting->state.step_small = firewall_allocation_console_d;
 
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = firewall_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index fbb4899699ada6370b27a7f3a1ddba86b5d85a81..c7afffcab9ff49672eb79b1cd8efb6127f51b580 100644 (file)
@@ -75,10 +75,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_basic_list_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_basic_list_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_basic_list_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index dfb9ade7a7989daf9c360b4a68f509d330010f6e..72b985a73a36536fb5c4623e8c794452d706bb9c 100644 (file)
@@ -60,10 +60,19 @@ extern "C" {
 #endif // _di_fss_basic_list_read_program_name_s_
 
 /**
- * The program signal defines.
+ * The program defines.
+ *
+ * fss_basic_list_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_basic_list_read_d_
-  #define fss_basic_list_read_signal_check_d 20000
+  #define fss_basic_list_read_allocation_console_d 4
+  #define fss_basic_list_read_allocation_large_d   256
+  #define fss_basic_list_read_allocation_small_d   16
+  #define fss_basic_list_read_signal_check_d       20000
 #endif // _di_fss_basic_list_read_d_
 
 /**
index 901ae71db41832863de7e04b23615cb1ba1aeb26..0e188ee6552c79a7d0689c022f349bac75f4d8bc 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_basic_list_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_basic_list_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 2a0cd42affb9efc15c32c9196ec6412ba9afe5bc..eda38493589ad1ad5fd289f2b9dff04fab15e6de 100644 (file)
@@ -246,7 +246,7 @@ extern "C" {
 #ifndef _di_fss_basic_list_read_load_
   f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index aacee2841b6d6f735500090875091990401464ea..c59e8f5c293bbd1d75b1bf57f7fd4f832140a76d 100644 (file)
@@ -74,10 +74,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_basic_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_basic_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_basic_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index f74d5ecbf855df7ffff4c0c5b8e0bf41f3d65709..e2ce16b29e20ba8b0340b217155282bd61c48bd8 100644 (file)
@@ -61,9 +61,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fss_basic_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_basic_read_d_
-  #define fss_basic_read_signal_check_d 20000
+  #define fss_basic_read_allocation_console_d 4
+  #define fss_basic_read_allocation_large_d   256
+  #define fss_basic_read_allocation_small_d   16
+  #define fss_basic_read_signal_check_d       20000
 #endif // _di_fss_basic_read_d_
 
 /**
index ce5c2224160e89b1b81f53ceb322ca8db73c6daf..a29afdc23e6f67fa474e70cbda595c4617c29d96 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_basic_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_basic_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 7768c96854d275b8949b301ddbe3ee8d21574ceb..e4f29c78e6cc9e03bd4b37575895f3560ef4e77f 100644 (file)
@@ -223,7 +223,7 @@ extern "C" {
 #ifndef _di_fss_basic_read_load_
   f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits.used = 0;
index 0fc4351052f5da20420b150dc22669cdea81717a..77f89e86cbf7078c9ade7e2b1de2e8839897c0e5 100644 (file)
@@ -73,10 +73,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_embedded_list_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_embedded_list_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_embedded_list_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 4784a6e31c004fa47884e6ba250dab480e297e4b..2a05bf614750f8c2666a7f8f61d9a969c387579d 100644 (file)
@@ -61,9 +61,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fss_embedded_list_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_embedded_list_read_d_
-  #define fss_embedded_list_read_signal_check_d 20000
+  #define fss_embedded_list_read_allocation_console_d 4
+  #define fss_embedded_list_read_allocation_large_d   256
+  #define fss_embedded_list_read_allocation_small_d   16
+  #define fss_embedded_list_read_signal_check_d       20000
 #endif // _di_fss_embedded_list_read_d_
 
 /**
index f7015aa2f0dee5df001ea3ff554316444c6a10ca..0b4fb0cb3c39fb2d23a057f90a6311335be88ca4 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_embedded_list_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_embedded_list_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 17b95a1371b1f1b65abbdb4097b1c2440751720d..922c602eebb8ed5571d52ac1dd6171d099d77d4a 100644 (file)
@@ -245,7 +245,7 @@ extern "C" {
     f_status_t status = F_none;
 
     {
-      f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
+      f_state_t state = macro_f_state_t_initialize_1(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0);
       f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
       objects_delimits->used = 0;
index 1daf721ca7bcaefa4ecc305605acff830a0c1611..d38141891d1baf8b6074f1cc2358d8000d32db5d 100644 (file)
@@ -81,10 +81,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_extended_list_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_extended_list_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_extended_list_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 2a237d959c7de518538047af65ef80a94f891e0e..92a2a5c1c69b8b8079f6290d992f6f01b62d0486 100644 (file)
@@ -67,9 +67,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fss_extended_list_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_extended_list_read_d_
-  #define fss_extended_list_read_signal_check_d 20000
+  #define fss_extended_list_read_allocation_console_d 4
+  #define fss_extended_list_read_allocation_large_d   256
+  #define fss_extended_list_read_allocation_small_d   16
+  #define fss_extended_list_read_signal_check_d       20000
 #endif // _di_fss_extended_list_read_d_
 
 /**
index 777871f9764c8473cb44e6aebe225091c8408322..0360b15eaa5361fe230898c6b1e998bf00549d89 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_extended_list_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_extended_list_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 8b89c9ae723165a6dd746f2188931d0b1cc3da13..50c718411151795c7849794e08adb7214a1aa894 100644 (file)
@@ -245,7 +245,7 @@ extern "C" {
 #ifndef _di_fss_extended_list_read_load_
   f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index 82679db033961b1f86258c4f15b946ff103ed010..eb9e46687b1e2cc02dbe73ad60fad41998b1834f 100644 (file)
@@ -74,10 +74,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_extended_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_extended_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_extended_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 7ed7d3513d89ea865c5b27a9e620fcd90e7bada3..23becfa9d53f5e00c0b096a722185692e42f9158 100644 (file)
@@ -61,9 +61,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fss_extended_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_extended_read_d_
-  #define fss_extended_read_signal_check_d 20000
+  #define fss_extended_read_allocation_console_d 4
+  #define fss_extended_read_allocation_large_d   256
+  #define fss_extended_read_allocation_small_d   16
+  #define fss_extended_read_signal_check_d       20000
 #endif // _di_fss_extended_read_d_
 
 /**
index 356e26f0c46f18a12f7841c0ff4f6e542e4d560c..65a4d24a396199aa5de0004635edc31cd0d331a0 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_extended_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_extended_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 0575072db5274aeee9916305a577f87e8a037d50..557bf74d225d81ec782a2b9f26780c08293704ae 100644 (file)
@@ -249,7 +249,7 @@ extern "C" {
 #ifndef _di_fss_extended_read_load_
   f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index 6578bb8c4bdfc4bac720a7890a51a444aad9e4f7..b4a66b5fd716829e56899e0f2ef02276d04d27eb 100644 (file)
@@ -41,10 +41,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_identify_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_identify_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_identify_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 599739a28811c2ba2fc05b190a03655636213512..b2db552d329f7088d5b47da14c9b6c92e5d513c4 100644 (file)
@@ -61,9 +61,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * fss_identify_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_fss_identify_d_
-  #define fss_identify_signal_check_d 20000
+  #define fss_identify_allocation_console_d 4
+  #define fss_identify_allocation_large_d   256
+  #define fss_identify_allocation_small_d   16
+  #define fss_identify_signal_check_d       20000
 #endif // _di_fss_identify_d_
 
 /**
index 051b14a734993048256bc0635bd9577372d85930..c731f7e12374698f087756ce4dc4d5c78b4696af 100644 (file)
@@ -11,7 +11,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_identify_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_identify_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 753d519b57681eda0555c0b4b6a9a5ad7f38e124..1d5af67d817ba293a30f4c91ab7aadf6d82203b1 100644 (file)
@@ -75,10 +75,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = fss_payload_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_payload_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_payload_read_print_line_first_locked(setting, main->error);
       fll_error_print(main->error, F_status_set_fine(setting->state.status), "f_console_parameter_process", fll_error_file_flag_fallback_e);
index 9fac94122223a80b737241dcf09d3beec12fd50f..45b38017a8f8f628ac04d396f28c36339fb10d30 100644 (file)
@@ -12,7 +12,12 @@ extern "C" {
 
     f_status_t status = F_none;
 
+    setting->state.step_small = fss_payload_read_allocation_console_d;
+
     status = f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
+
+    setting->state.step_small = fss_payload_read_allocation_small_d;
+
     if (F_status_is_error(status)) return;
 
     {
index 401289b68a158bd1006392616a7c0e03e1fed22e..8b7b4d372775b3001ecfe25dd3f9369548d98e70 100644 (file)
@@ -239,7 +239,7 @@ extern "C" {
 #ifndef _di_fss_payload_read_load_
   f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
 
-    f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
+    f_state_t state = macro_f_state_t_initialize_1(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_handle, 0, (void *) main, 0);
     f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
 
     data->delimits_object.used = 0;
index e60e6275bad445d11d27f01a6450077975d92c86..3502557ddaab1f3e174ca064c564cd05f058cb08 100644 (file)
@@ -12,21 +12,24 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
+
     if (setting->content) {
-      setting->state.status = fl_fss_basic_content_write(
+      fl_fss_basic_content_write(
         *setting->content,
-        (setting->flag & fss_write_flag_partial_e)
+        (setting->flag & fss_write_main_flag_partial_e)
           ? f_fss_complete_partial_e
           : f_fss_complete_full_e,
         &setting->range,
         &setting->buffer,
-        setting->state
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -39,8 +42,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_content_end_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_content_end_e) {
         setting->state.status = f_string_dynamic_append(f_fss_basic_close_s, &setting->buffer);
 
         if (F_status_is_error(setting->state.status)) {
@@ -48,6 +51,10 @@ extern "C" {
         }
       }
     }
+
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_last(setting, main->message);
+    }
   }
 #endif // _di_fss_write_basic_process_content_
 
@@ -68,27 +75,26 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->state.status = fl_fss_basic_object_write(
+      fl_fss_basic_object_write(
         *setting->object,
         setting->quote.used
           ? setting->quote.string[0]
           : f_fss_quote_double_s.string[0],
-        (setting->flag & fss_write_flag_partial_e)
-          ? (setting->flag & fss_write_flag_trim_e)
+        (setting->flag & fss_write_main_flag_partial_e)
+          ? (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_trim_e
             : f_fss_complete_none_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -101,8 +107,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_object_open_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_object_open_e) {
         setting->state.status = f_string_dynamic_append(f_fss_basic_open_s, &setting->buffer);
 
         if (F_status_is_error(setting->state.status)) {
index 362b7d5fb609a0b36248ae62e297aab30a35da68..1dbaaac7c9bb84a3326f2b4555f6fc60d2f752ed 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_basic_standard_s;
   setting.process_content = &fss_write_basic_process_content;
   setting.process_help = &fss_write_basic_process_help;
@@ -40,5 +40,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index aea1076d2cbefa4518e70949ed11467fb3284682..e7dd5625eeb28051d747cbde5ddbef80d82c534e 100644 (file)
@@ -7,6 +7,8 @@ extern "C" {
 #ifndef _di_fss_write_basic_print_help_
   f_status_t fss_write_basic_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index cd80df2fc5475fbc779a8c0a192de2469656b349..611e19d04ccf88107eaa3c1338a603d09c4cf18c 100644 (file)
@@ -25,6 +25,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_basic_print_help_
   extern f_status_t fss_write_basic_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 44fb4155fb98d9a1a0b9339e3d28ef06c94289bd..976ce18b628251b929b5e9c65b352b7f38373fa7 100644 (file)
@@ -12,24 +12,27 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
+
     if (setting->content) {
-      setting->state.status = fl_fss_basic_list_content_write(
+      fl_fss_basic_list_content_write(
         *setting->content,
-        (setting->flag & fss_write_flag_partial_e)
+        (setting->flag & fss_write_main_flag_partial_e)
           ? f_fss_complete_partial_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
         &setting->prepend,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -42,8 +45,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_content_end_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_content_end_e) {
         setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
 
         if (F_status_is_error(setting->state.status)) {
@@ -51,6 +54,10 @@ extern "C" {
         }
       }
     }
+
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_last(setting, main->message);
+    }
   }
 #endif // _di_fss_write_basic_list_process_content_
 
@@ -71,24 +78,23 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->state.status = fl_fss_basic_list_object_write(
+      fl_fss_basic_list_object_write(
         *setting->object,
-        (setting->flag & fss_write_flag_partial_e)
-          ? (setting->flag & fss_write_flag_trim_e)
+        (setting->flag & fss_write_main_flag_partial_e)
+          ? (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_trim_e
             : f_fss_complete_none_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -101,8 +107,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_object_open_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_object_open_e) {
         setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
 
         if (F_status_is_error_not(setting->state.status)) {
index 9b44e607b54ff67e74575ac3a8b9b5c038357e4a..dea594ba0a5cd3b788aacecef992d8d42b88b8bf 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_basic_list_standard_s;
   setting.process_content = &fss_write_basic_list_process_content;
   setting.process_help = &fss_write_basic_list_process_help;
@@ -29,7 +29,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, 0);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_main(&data, &setting);
@@ -40,5 +40,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 3baec35ac6c7cec818bc60020e46d4321479a560..c77d009a33450a82507a4603b17021c0705aad4f 100644 (file)
@@ -7,6 +7,8 @@ extern "C" {
 #ifndef _di_fss_write_basic_list_print_help_
   f_status_t fss_write_basic_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index 7d7c5d3b05a0199be948b71f101c962c3ad6ec5e..30538c1e960f8e79303ae19da5229ccaecc80962 100644 (file)
@@ -25,6 +25,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_basic_list_print_help_
   extern f_status_t fss_write_basic_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 81dc2baae72166de992b985e607ba9acf615b3b2..1d884fc87f9d14cb994cec508b1a6e176f608b7f 100644 (file)
@@ -12,25 +12,28 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
+
     if (setting->content) {
-      setting->state.status = fl_fss_embedded_list_content_write(
+      fl_fss_embedded_list_content_write(
         *setting->content,
-        (setting->flag & fss_write_flag_partial_e)
+        (setting->flag & fss_write_main_flag_partial_e)
           ? f_fss_complete_partial_e
           : last
             ? f_fss_complete_end_e
             : f_fss_complete_next_e,
         &setting->prepend,
         setting->ignores,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -43,8 +46,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_content_end_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_content_end_e) {
         setting->state.status = f_string_dynamic_append(f_fss_embedded_list_close_s, &setting->buffer);
 
         if (F_status_is_error_not(setting->state.status)) {
@@ -56,6 +59,10 @@ extern "C" {
         }
       }
     }
+
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_last(setting, main->message);
+    }
   }
 #endif // _di_fss_write_embedded_list_process_content_
 
@@ -76,24 +83,23 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->state.status = fl_fss_embedded_list_object_write(
+      fl_fss_embedded_list_object_write(
         *setting->object,
-        (setting->flag & fss_write_flag_partial_e)
-          ? (setting->flag & fss_write_flag_trim_e)
+        (setting->flag & fss_write_main_flag_partial_e)
+          ? (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_trim_e
             : f_fss_complete_none_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -106,8 +112,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_object_open_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_object_open_e) {
         setting->state.status = f_string_dynamic_append(f_fss_embedded_list_open_s, &setting->buffer);
 
         if (F_status_is_error_not(setting->state.status)) {
index 7e5733bdabec2c722eef7903c1e3566a9b67a459..04181a674cd429f11b89d0ecb0fd1acdb87ea9b8 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_embedded_list_standard_s;
   setting.process_content = &fss_write_embedded_list_process_content;
   setting.process_help = &fss_write_embedded_list_process_help;
@@ -13,8 +13,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_object = &fss_write_embedded_list_process_object;
   setting.process_pipe = &fss_write_process_pipe;
   setting.process_set = &fss_write_process_set;
-  setting.flag |= fss_write_flag_ignore_e;
-  setting.flag |= fss_write_flag_content_multiple_e;
+  setting.flag |= fss_write_main_flag_ignore_e;
+  setting.flag |= fss_write_main_flag_content_multiple_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -31,7 +31,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, 0);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_main(&data, &setting);
@@ -42,5 +42,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 752add9218995f183abcf4b15b69bc6ed7faccca..c5c3a2777529279ff8971b0768d05fb909bed353 100644 (file)
@@ -7,6 +7,8 @@ extern "C" {
 #ifndef _di_fss_write_embedded_list_print_help_
   f_status_t fss_write_embedded_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index 955e24e53c8f7c731f5472fc4422a52ab7a14267..292849db41ed2dbed34087fa5f44336011811fb5 100644 (file)
@@ -25,6 +25,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_embedded_list_print_help_
   extern f_status_t fss_write_embedded_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 3ef64f77de1e767d10aceeb0c2fc5badb785068e..bef2e2defa051747307d2795c02a734348381307 100644 (file)
@@ -12,26 +12,29 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
+
     if (setting->content) {
-      setting->state.status = fl_fss_extended_content_write(
+      fl_fss_extended_content_write(
         *setting->content,
         setting->quote.used
           ? setting->quote.string[0]
           : f_fss_quote_double_s.string[0],
-        (setting->flag & fss_write_flag_partial_e)
+        (setting->flag & fss_write_main_flag_partial_e)
           ? f_fss_complete_partial_e
           : last
             ? f_fss_complete_end_e
             : f_fss_complete_next_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -44,15 +47,15 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_content_end_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_content_end_e) {
         setting->state.status = f_string_dynamic_append(f_fss_extended_close_s, &setting->buffer);
 
         if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
         }
       }
-      else if (setting->flag & fss_write_flag_content_next_e) {
+      else if (setting->flag & fss_write_main_flag_content_next_e) {
         setting->state.status = f_string_dynamic_append(f_fss_extended_next_s, &setting->buffer);
 
         if (F_status_is_error(setting->state.status)) {
@@ -60,6 +63,10 @@ extern "C" {
         }
       }
     }
+
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_last(setting, main->message);
+    }
   }
 #endif // _di_fss_write_extended_process_content_
 
@@ -80,27 +87,26 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->state.status = fl_fss_extended_object_write(
+      fl_fss_extended_object_write(
         *setting->object,
         setting->quote.used
           ? setting->quote.string[0]
           : f_fss_quote_double_s.string[0],
-        (setting->flag & fss_write_flag_partial_e)
-          ? (setting->flag & fss_write_flag_trim_e)
+        (setting->flag & fss_write_main_flag_partial_e)
+          ? (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_trim_e
             : f_fss_complete_none_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -113,8 +119,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_object_open_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_object_open_e) {
         setting->state.status = f_string_dynamic_append(f_fss_extended_open_s, &setting->buffer);
         if (F_status_is_error(setting->state.status)) {
           fss_write_print_error(setting, main->error, macro_fss_write_f(f_string_dynamic_append));
index 34ded57ce1f435c056cd4cd9f104524149e56237..22080f3f79876547d4765c9fdb64c889caa40405 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_extended_standard_s;
   setting.process_content = &fss_write_extended_process_content;
   setting.process_help = &fss_write_extended_process_help;
@@ -13,7 +13,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_object = &fss_write_extended_process_object;
   setting.process_pipe = &fss_write_process_pipe;
   setting.process_set = &fss_write_process_set;
-  setting.flag |= fss_write_flag_content_multiple_e;
+  setting.flag |= fss_write_main_flag_content_multiple_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -30,7 +30,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, 0);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_main(&data, &setting);
@@ -41,5 +41,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index c202009812c1f7ff93672872e6ec95bc092ff9e1..b16339e51a17b19df9ae84a43aa83e3a22be6e29 100644 (file)
@@ -7,6 +7,8 @@ extern "C" {
 #ifndef _di_fss_write_extended_print_help_
   f_status_t fss_write_extended_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index 5af54d90e73d09f2a7f422aed39e28850852edeb..195d03c2565ab089aa744eb57906f61b3a6c13ec 100644 (file)
@@ -25,6 +25,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_extended_print_help_
   extern f_status_t fss_write_extended_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 983f42aca9c47898b643a2192c2f98d174174053..61710367ac9f6d935c2f0cfd4eda495b939c4457 100644 (file)
@@ -12,25 +12,28 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
+
     if (setting->content) {
-      setting->state.status = fl_fss_extended_list_content_write(
+      fl_fss_extended_list_content_write(
         *setting->content,
-        (setting->flag & fss_write_flag_partial_e)
+        (setting->flag & fss_write_main_flag_partial_e)
           ? last
             ? f_fss_complete_none_e
             : f_fss_complete_partial_e
           : f_fss_complete_full_e,
         &setting->prepend,
         setting->ignores,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
       if (F_status_set_fine(setting->state.status) == F_none_eol) {
         setting->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(setting, main->error);
         fss_write_print_error_unsupported_eol(setting, main->error);
 
         return;
@@ -43,8 +46,8 @@ extern "C" {
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_content_end_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_content_end_e) {
         setting->state.status = f_string_dynamic_append(f_fss_extended_list_close_s, &setting->buffer);
 
         if (F_status_is_error_not(setting->state.status)) {
@@ -56,6 +59,10 @@ extern "C" {
         }
       }
     }
+
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_last(setting, main->message);
+    }
   }
 #endif // _di_fss_write_extended_list_process_content_
 
@@ -76,38 +83,37 @@ extern "C" {
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
-      setting->state.status = fl_fss_extended_list_object_write(
+      fl_fss_extended_list_object_write(
         *setting->object,
-        (setting->flag & fss_write_flag_partial_e)
-          ? (setting->flag & fss_write_flag_trim_e)
+        (setting->flag & fss_write_main_flag_partial_e)
+          ? (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_trim_e
             : f_fss_complete_none_e
-          : (setting->flag & fss_write_flag_trim_e)
+          : (setting->flag & fss_write_main_flag_trim_e)
             ? f_fss_complete_full_trim_e
             : f_fss_complete_full_e,
-        setting->state,
         &setting->range,
-        &setting->buffer
+        &setting->buffer,
+        &setting->state
       );
 
-      if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-        macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
+      if (F_status_set_fine(macro_fss_write_setting(setting)->state.status) == F_none_eol) {
+        macro_fss_write_setting(setting)->state.status = F_status_set_error(F_support_not);
 
-        fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
         fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
 
         return;
       }
 
-      if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
+      if (F_status_is_error(macro_fss_write_setting(setting)->state.status)) {
         fss_write_print_error(macro_fss_write_setting(setting), main->error, macro_fss_write_f(fl_fss_extended_list_object_write));
 
         return;
       }
     }
 
-    if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-      if (setting->flag & fss_write_flag_object_open_e) {
+    if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+      if (setting->flag & fss_write_main_flag_object_open_e) {
         setting->state.status = f_string_dynamic_append(f_fss_extended_list_open_s, &setting->buffer);
 
         if (F_status_is_error_not(setting->state.status)) {
index a88557d3596b68bdbe459322c46e323e915a7ebd..a268d123e0f72291fa9bb1a106ddc72a461d38eb 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_extended_list_standard_s;
   setting.process_content = &fss_write_extended_list_process_content;
   setting.process_help = &fss_write_extended_list_process_help;
@@ -13,7 +13,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.process_object = &fss_write_extended_list_process_object;
   setting.process_pipe = &fss_write_process_pipe;
   setting.process_set = &fss_write_process_set;
-  setting.flag |= fss_write_flag_ignore_e;
+  setting.flag |= fss_write_main_flag_ignore_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -30,7 +30,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, 0);
+    fss_write_setting_load(arguments, &data, &setting, 0);
   }
 
   fss_write_main(&data, &setting);
@@ -41,5 +41,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 3a6d26a942f7a3a173edf4f8f304cdfa8c616328..be6b9f107b984d0bd1a054223e91971534c5102f 100644 (file)
@@ -7,6 +7,8 @@ extern "C" {
 #ifndef _di_fss_write_extended_list_print_help_
   f_status_t fss_write_extended_list_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index 824636f3d4d0660eed0784c759e9d9f276f52356..009c449b0632190cff75ed44d057033f1f157a64 100644 (file)
@@ -25,6 +25,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_extended_list_print_help_
   extern f_status_t fss_write_extended_list_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 64f6cc59f89c1796b6eb8af8ab480e77b0bb9da9..db77ecfffe890230f9899382652866cbc9d0251e 100644 (file)
@@ -19,14 +19,18 @@ extern "C" {
 /**
  * The program default defines.
  *
- * fss_write_default_allocation_*:
- *   - large: An allocation step used for buffers that are anticipated to have large buffers.
- *   - small: An allocation step used for buffers that are anticipated to have small buffers.
+ * fss_write_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
-#ifndef _di_fss_write_default_d_
-  #define fss_write_default_allocation_large_d 2048
-  #define fss_write_default_allocation_small_d 128
-#endif // _di_fss_write_default_d_
+#ifndef _di_fss_write_d_
+  #define fss_write_allocation_console_d 4
+  #define fss_write_allocation_large_d   2048
+  #define fss_write_allocation_small_d   128
+  #define iki_write_signal_check_d       20000
+#endif // _di_fss_write_d_
 
 /**
  * The program defines.
@@ -45,7 +49,7 @@ extern "C" {
 /**
  * Flags passed to the main function or program.
  *
- * fss_write_flag_*_e:
+ * fss_write_main_flag_*_e:
  *   - none:             No flags set.
  *   - content:          The Content being written is specified.
  *   - content_end:      The Content end characters are to be printed.
@@ -58,29 +62,30 @@ extern "C" {
  *   - object:           The Object being written is specified.
  *   - object_open:      The Object open characters are to be printed.
  *   - partial:          Do not write end of Object/Content character.
- *   - prepend:          Prepend the given white space characters to the start of each multi-line Content.
+ *   - print_first:      When set, the first character printing logic is to be processed (this is usually automatic).
  *   - trim:             Trim Object names.
  *   - version:          Print version.
  */
-#ifndef _di_fss_write_flag_e_
+#ifndef _di_fss_write_main_flag_e_
   enum {
-    fss_write_flag_none_e             = 0x0,
-    fss_write_flag_content_e          = 0x1,
-    fss_write_flag_content_end_e      = 0x2,
-    fss_write_flag_content_multiple_e = 0x4,
-    fss_write_flag_content_next_e     = 0x8,
-    fss_write_flag_copyright_e        = 0x10,
-    fss_write_flag_file_to_e          = 0x20,
-    fss_write_flag_help_e             = 0x40,
-    fss_write_flag_ignore_e           = 0x80,
-    fss_write_flag_object_e           = 0x100,
-    fss_write_flag_object_open_e      = 0x200,
-    fss_write_flag_partial_e          = 0x400,
-    fss_write_flag_prepend_e          = 0x800,
-    fss_write_flag_trim_e             = 0x1000,
-    fss_write_flag_version_e          = 0x2000,
+    fss_write_main_flag_none_e             = 0x0,
+    fss_write_main_flag_content_e          = 0x1,
+    fss_write_main_flag_content_end_e      = 0x2,
+    fss_write_main_flag_content_multiple_e = 0x4,
+    fss_write_main_flag_content_next_e     = 0x8,
+    fss_write_main_flag_copyright_e        = 0x10,
+    fss_write_main_flag_file_to_e          = 0x20,
+    fss_write_main_flag_help_e             = 0x40,
+    fss_write_main_flag_ignore_e           = 0x80,
+    fss_write_main_flag_object_e           = 0x100,
+    fss_write_main_flag_object_open_e      = 0x200,
+    fss_write_main_flag_partial_e          = 0x400,
+    fss_write_main_flag_prepend_e          = 0x800,
+    fss_write_main_flag_print_first_e      = 0x1000,
+    fss_write_main_flag_trim_e             = 0x2000,
+    fss_write_main_flag_version_e          = 0x4000,
   }; // enum
-#endif // _di_fss_write_flag_e_
+#endif // _di_fss_write_main_flag_e_
 
 /**
  * The main program parameters.
@@ -226,8 +231,8 @@ extern "C" {
 
   #define fss_write_setting_t_initialize \
     { \
-      fss_write_flag_none_e, \
-      macro_f_state_t_initialize(fss_write_default_allocation_large_d, fss_write_default_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, 0, 0), \
+      fss_write_main_flag_none_e, \
+      macro_f_state_t_initialize_1(fss_write_allocation_large_d, fss_write_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0), \
       f_string_range_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
index 21316a86b25771e3321dd4eac991f5c374db67b3..3b42aa3fbfd20a6f33e1518fe1d6c34946e87cc0 100644 (file)
@@ -27,8 +27,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
+    setting->state.step_small = fss_write_allocation_console_d;
+
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = fss_write_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       fss_write_print_error(setting, main->error, macro_fss_write_f(f_console_parameter_process));
 
@@ -92,15 +96,15 @@ extern "C" {
     main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
 
     if (main->parameters.array[fss_write_parameter_help_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_flag_help_e;
+      setting->flag |= fss_write_main_flag_help_e;
     }
 
     if (main->parameters.array[fss_write_parameter_version_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_flag_version_e;
+      setting->flag |= fss_write_main_flag_version_e;
     }
 
     if (main->parameters.array[fss_write_parameter_copyright_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_flag_copyright_e;
+      setting->flag |= fss_write_main_flag_copyright_e;
     }
 
     if (callback) {
@@ -121,7 +125,7 @@ extern "C" {
       if (main->parameters.array[fss_write_parameter_file_e].values.used > 1) {
         setting->state.status = F_status_set_error(F_parameter);
 
-        fss_write_print_line_first_locked(setting, main->error);
+        fss_write_print_line_first(setting, main->message);
         fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
 
         return;
@@ -140,12 +144,12 @@ extern "C" {
         return;
       }
 
-      setting->flag |= fss_write_flag_file_to_e;
+      setting->flag |= fss_write_main_flag_file_to_e;
     }
     else if (main->parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_file_s);
 
       return;
@@ -174,12 +178,12 @@ extern "C" {
         setting->objects.array[setting->objects.used++].size = 0;
       } // for
 
-      setting->flag |= fss_write_flag_object_e;
+      setting->flag |= fss_write_main_flag_object_e;
     }
     else if (main->parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_object_s);
 
       return;
@@ -187,11 +191,12 @@ extern "C" {
 
     if ((main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_content_e].values.used) {
 
-      if (setting->flag & fss_write_flag_object_e) {
-        if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+      if (setting->flag & fss_write_main_flag_object_e) {
+        if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
             setting->state.status = F_status_set_error(F_support_not);
 
+            fss_write_print_line_first(setting, main->message);
             fss_write_print_error_one_content_only(setting, main->error);
 
             return;
@@ -262,12 +267,12 @@ extern "C" {
         ++setting->contentss.used;
       }
 
-      setting->flag |= fss_write_flag_content_e;
+      setting->flag |= fss_write_main_flag_content_e;
     }
     else if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_content_s);
 
       return;
@@ -288,34 +293,30 @@ extern "C" {
 
       if (main->parameters.arguments.array[index].used) {
         f_string_range_t range = macro_f_string_range_t_initialize2(main->parameters.arguments.array[index].used);
-        f_state_t state = f_state_t_initialize;
 
         for (; range.start < main->parameters.arguments.array[index].used; range.start++) {
 
-          setting->state.status = f_fss_is_space(main->parameters.arguments.array[index], range, state);
-
-          if (F_status_is_error(setting->state.status)) {
-            fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
-
-            return;
-          }
-
-          if (setting->state.status == F_false) {
-            setting->state.status = F_status_set_error(F_parameter);
+          if (f_fss_is_space(main->parameters.arguments.array[index], range, &setting->state) == F_false) {
+            if (F_status_is_error(setting->state.status)) {
+              fss_write_print_error(setting, main->error, macro_fss_write_f(f_fss_is_space));
+            }
+            else {
+              setting->state.status = F_status_set_error(F_parameter);
 
-            fss_write_print_error_prepend_only_whitespace(setting, main->error);
+              fss_write_print_error_prepend_only_whitespace(setting, main->error);
+            }
 
             return;
           }
         } // for
       }
 
-      setting->flag |= fss_write_flag_prepend_e;
+      setting->flag |= fss_write_main_flag_prepend_e;
     }
     else if (main->parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
 
       return;
@@ -325,14 +326,14 @@ extern "C" {
       if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
         setting->state.status = F_status_set_error(F_parameter);
 
-        fss_write_print_line_first_locked(setting, main->error);
+        fss_write_print_line_first(setting, main->message);
         fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, fss_write_string_two_s);
 
         return;
       }
 
       // Only process if the standard designates that the ingore is supported.
-      if (setting->flag & fss_write_flag_ignore_e) {
+      if (setting->flag & fss_write_main_flag_ignore_e) {
         f_array_length_t stub_data_array[1] = { 0 };
         f_array_lengths_t stub_data = macro_f_array_lengths_t_initialize(stub_data_array, 0, 1);
 
@@ -390,7 +391,7 @@ extern "C" {
             setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
 
             if (F_status_is_error(setting->state.status)) {
-              fss_write_print_line_first_locked(setting, main->error);
+              fss_write_print_line_first(setting, main->message);
               fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
               return;
@@ -401,7 +402,7 @@ extern "C" {
             setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
 
             if (F_status_is_error(setting->state.status)) {
-              fss_write_print_line_first_locked(setting, main->error);
+              fss_write_print_line_first(setting, main->message);
               fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
               return;
@@ -410,7 +411,7 @@ extern "C" {
             if (setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop > setting->ignoress.array[j].array[setting->ignoress.array[j].used].start) {
               setting->state.status = F_status_set_error(F_parameter);
 
-              fss_write_print_line_first_locked(setting, main->error);
+              fss_write_print_line_first(setting, main->message);
               fll_program_print_error_parameter_range_start_before_stop(
                 main->error,
                 f_console_symbol_long_normal_s,
@@ -444,7 +445,7 @@ extern "C" {
           setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
 
           if (F_status_is_error(setting->state.status)) {
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
             return;
@@ -455,7 +456,7 @@ extern "C" {
           setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
 
           if (F_status_is_error(setting->state.status)) {
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
 
             return;
@@ -464,7 +465,7 @@ extern "C" {
           if (number.start > number.stop) {
             setting->state.status = F_status_set_error(F_parameter);
 
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_range_start_before_stop(
               main->error,
               f_console_symbol_long_normal_s,
@@ -481,7 +482,7 @@ extern "C" {
     else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s);
 
       return;
@@ -489,13 +490,13 @@ extern "C" {
     else {
 
       // There is no Object or Content, so remove ignores if set.
-      if (setting->flag & fss_write_flag_ignore_e) {
-        setting->flag -= fss_write_flag_ignore_e;
+      if (setting->flag & fss_write_main_flag_ignore_e) {
+        setting->flag -= fss_write_main_flag_ignore_e;
       }
     }
 
     if (main->parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_flag_partial_e;
+      setting->flag |= fss_write_main_flag_partial_e;
     }
 
     {
@@ -506,9 +507,9 @@ extern "C" {
       };
 
       const uint16_t has_flag[] = {
-        fss_write_flag_content_end_e,
-        fss_write_flag_content_next_e,
-        fss_write_flag_object_open_e,
+        fss_write_main_flag_content_end_e,
+        fss_write_main_flag_content_next_e,
+        fss_write_main_flag_object_open_e,
       };
 
       const f_string_static_t has_string[] = {
@@ -532,11 +533,11 @@ extern "C" {
       for (uint8_t i = 0; i < 3; ++i) {
 
         if (main->parameters.array[has[i]].result & f_console_result_found_e) {
-          if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
-            if (!(setting->flag & fss_write_flag_partial_e)) {
+          if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
+            if (!(setting->flag & fss_write_main_flag_partial_e)) {
               setting->state.status = F_status_set_error(F_parameter);
 
-              fss_write_print_line_first_locked(setting, main->error);
+              fss_write_print_line_first(setting, main->message);
 
               fll_program_print_error_parameter_cannot_use_with_without(
                 main->error,
@@ -544,7 +545,7 @@ extern "C" {
                 f_console_symbol_long_normal_s,
                 f_console_symbol_long_normal_s,
                 has_string[i],
-                (setting->flag & fss_write_flag_object_e)
+                (setting->flag & fss_write_main_flag_object_e)
                   ? fss_write_long_object_s
                   : fss_write_long_content_s,
                 fss_write_long_partial_s
@@ -557,7 +558,7 @@ extern "C" {
           if (main->parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
             setting->state.status = F_status_set_error(F_parameter);
 
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
 
             return;
@@ -566,7 +567,7 @@ extern "C" {
           if (main->parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
             setting->state.status = F_status_set_error(F_parameter);
 
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
 
             return;
@@ -577,23 +578,24 @@ extern "C" {
       } // for
     }
 
-    if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e)) {
-      if (setting->flag & fss_write_flag_object_e) {
-        if (setting->flag & fss_write_flag_content_multiple_e) {
-          if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_flag_partial_e)) {
+    if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) {
+      if (setting->flag & fss_write_main_flag_object_e) {
+        if (setting->flag & fss_write_main_flag_content_multiple_e) {
+          if (main->parameters.array[fss_write_parameter_object_e].locations_sub.used > main->parameters.array[fss_write_parameter_content_e].locations_sub.used && !(setting->flag & fss_write_main_flag_partial_e)) {
             setting->state.status = F_status_set_error(F_parameter);
 
+            fss_write_print_line_first(setting, main->message);
             fss_write_print_error_parameter_same_times_at_least(setting, main->error);
 
             return;
           }
         }
 
-        if ((setting->flag & fss_write_flag_content_e) && (setting->flag & fss_write_flag_partial_e)) {
+        if ((setting->flag & fss_write_main_flag_content_e) && (setting->flag & fss_write_main_flag_partial_e)) {
           if (main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
             setting->state.status = F_status_set_error(F_parameter);
 
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fll_program_print_error_parameter_cannot_use_with_xor(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_partial_s, fss_write_long_object_s, fss_write_long_content_s);
 
             return;
@@ -641,10 +643,10 @@ extern "C" {
     }
 
     if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
-      setting->flag |= fss_write_flag_trim_e;
+      setting->flag |= fss_write_main_flag_trim_e;
     }
 
-    if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_flag_content_e | fss_write_parameter_object_e))) {
+    if (!(setting->flag & (fll_program_data_pipe_input_e | fss_write_main_flag_content_e | fss_write_parameter_object_e))) {
       setting->state.status = F_data_not;
     }
   }
index 7188d295b7aee9b38c74f6e7f8af2dfe9dc71ebd..89deacdda71c82eaef7b26b2e95b6fd6c8ce5560 100644 (file)
@@ -10,14 +10,14 @@ extern "C" {
     if (!main || !setting) return;
 
     if (F_status_is_error(setting->state.status)) {
-      fss_write_print_line_last_locked(setting, main->error);
+      fss_write_print_line_last(setting, main->error);
 
       return;
     }
 
     setting->state.status = F_none;
 
-    if (setting->flag & fss_write_flag_help_e) {
+    if (setting->flag & fss_write_main_flag_help_e) {
       if (setting->process_help) {
         setting->process_help(main, (void *) setting);
       }
@@ -25,13 +25,13 @@ extern "C" {
       return;
     }
 
-    if (setting->flag & fss_write_flag_version_e) {
+    if (setting->flag & fss_write_main_flag_version_e) {
       fll_program_print_version(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0), fss_write_program_version_s);
 
       return;
     }
 
-    if (setting->flag & fss_write_flag_copyright_e) {
+    if (setting->flag & fss_write_main_flag_copyright_e) {
       fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0));
 
       return;
@@ -46,26 +46,24 @@ extern "C" {
     }
 
     if (F_status_is_error_not(setting->state.status)) {
-      if (setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e | fss_write_flag_object_open_e | fss_write_flag_content_next_e | fss_write_flag_content_end_e)) {
+      if (setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) {
         if (setting->process_normal) {
           setting->process_normal(main, (void *) setting);
         }
       }
     }
-
-    if (F_status_is_error(setting->state.status)) {
-      fss_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
-    }
   }
 #endif // _di_fss_write_main_
 
 #ifndef _di_fss_write_process_normal_
   void fss_write_process_normal(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_process_normal_data(
       main,
       macro_fss_write_setting(void_setting),
-      (macro_fss_write_setting(void_setting)->flag & fss_write_flag_object_e)
+      (macro_fss_write_setting(void_setting)->flag & fss_write_main_flag_object_e)
         ? macro_fss_write_setting(void_setting)->objects.used
         : macro_fss_write_setting(void_setting)->contentss.used
     );
@@ -75,7 +73,7 @@ extern "C" {
 #ifndef _di_fss_write_process_normal_data_
   void fss_write_process_normal_data(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_array_length_t length) {
 
-    if (!setting->process_set) return;
+    if (!main || !setting || !setting->process_set) return;
 
     setting->ignores = 0;
     setting->object = 0;
@@ -113,7 +111,7 @@ extern "C" {
       } // for
     }
     else {
-      if (setting->flag & (fss_write_flag_object_open_e | fss_write_flag_content_next_e | fss_write_flag_content_end_e)) {
+      if (setting->flag & (fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) {
         setting->object = 0;
         setting->contents = 0;
         setting->ignores = 0;
@@ -127,18 +125,15 @@ extern "C" {
 #ifndef _di_fss_write_process_pipe_
   void fss_write_process_pipe(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (!setting->process_set) return;
 
-    f_status_t status_pipe = F_none;
-    f_file_t input = f_file_t_initialize;
-    input.id = F_type_descriptor_input_d;
-    input.size_read = setting->state.step_large;
-
-    f_array_length_t total = 0;
-    f_array_length_t ignore = 0;
-    f_string_range_t range = f_string_range_t_initialize;
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      fss_write_print_line_first(setting, main->message);
+    }
 
     const f_array_length_t used_objects = setting->objects.used;
     const f_array_length_t used_contentss = setting->contentss.used;
@@ -189,6 +184,16 @@ extern "C" {
       return;
     }
 
+    f_status_t status_pipe = F_none;
+
+    f_file_t input = f_file_t_initialize;
+    input.id = F_type_descriptor_input_d;
+    input.size_read = setting->state.step_large;
+
+    f_array_length_t total = 0;
+    f_array_length_t ignore = 0;
+    f_string_range_t range = f_string_range_t_initialize;
+
     // Reset all of the used data before starting the loop.
     setting->object->used = 0;
     setting->contents->used = 0;
@@ -299,7 +304,7 @@ extern "C" {
 
         // Check to see if the Content supports multiple Content per Object.
         if (flag & 0x4) {
-          if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+          if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
             setting->state.status = F_status_set_error(F_support_not);
 
             fss_write_print_error_one_content_only(setting, main->error);
@@ -337,7 +342,7 @@ extern "C" {
             // Do not handle start/end while inside an ignore set.
             if (!(flag & 0x2)) {
               if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-                if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+                if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
                   setting->state.status = F_status_set_error(F_support_not);
 
                   fss_write_print_error_one_content_only(setting, main->error);
@@ -429,17 +434,28 @@ extern "C" {
     if (F_status_is_error_not(setting->state.status)) {
       setting->state.status = (flag & 0x1) ? F_none : F_data_not;
     }
+
+    if (F_status_is_error(setting->state.status)) {
+      fss_write_print_line_last(setting, main->message);
+    }
+    else if (!(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) {
+      if (main->message.verbosity > f_console_verbosity_error_e) {
+        fss_write_print_line_last(setting, main->message);
+      }
+    }
   }
 #endif // _di_fss_write_process_pipe_
 
 #ifndef _di_fss_write_process_set_
   void fss_write_process_set(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     setting->buffer.used = 0;
 
-    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object || (setting->flag & fss_write_flag_object_open_e)) {
+    if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_object_e)) && setting->object || (setting->flag & fss_write_main_flag_object_open_e)) {
 
       if (setting->object) {
         if (setting->object->used) {
@@ -458,7 +474,7 @@ extern "C" {
       }
     }
 
-    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_content_e)) && setting->contents || (setting->flag & (fss_write_flag_content_next_e | fss_write_flag_content_end_e))) {
+    if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_content_e)) && setting->contents || (setting->flag & (fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) {
 
       if (setting->process_content) {
         if (setting->contents && setting->contents->used) {
index 29e94d7309026adb746a1de7937ef5c1c3d4de93..bbf94f760850cee377cc822152b749993595e31b 100644 (file)
@@ -33,6 +33,8 @@ extern "C" {
 #ifndef _di_fss_write_main_print_help_
   f_status_t fss_write_main_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index bc4cad8a166e4ad9f33ab2d69fef012081311031..389bcb4b676cad9e6977a7262d9cc60ba97801f3 100644 (file)
@@ -12,7 +12,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -28,7 +28,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, &fss_write_main_setting_load_as);
+    fss_write_setting_load(arguments, &data, &setting, &fss_write_main_setting_load_as);
   }
 
   fss_write_main(&data, &setting);
@@ -39,7 +39,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
 
 #ifndef _di_fss_write_main_process_help_
@@ -52,9 +52,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 #endif // _di_fss_write_main_process_help_
 
 #ifndef _di_fss_write_main_setting_load_as_
-  void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state) {
+  void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
 
-    if (!main || !setting || F_status_is_error(setting->state.status) || (setting->flag & fss_write_flag_version_e)) return;
+    if (!main || !setting || F_status_is_error(setting->state.status) || (setting->flag & fss_write_main_flag_version_e)) return;
 
     setting->standard = fss_write_basic_standard_s;
     setting->process_content = &fss_write_basic_process_content;
@@ -84,8 +84,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_pipe = &fss_write_process_pipe;
           setting->process_normal = &fss_write_process_normal;
           setting->process_set = &fss_write_process_set;
-          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic.
-          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by basic.
+          setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by basic.
+          setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by basic.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
@@ -98,8 +98,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_pipe = &fss_write_process_pipe;
           setting->process_normal = &fss_write_process_normal;
           setting->process_set = &fss_write_process_set;
-          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by extended.
-          setting->flag |= fss_write_flag_content_multiple_e;
+          setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by extended.
+          setting->flag |= fss_write_main_flag_content_multiple_e;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
@@ -112,8 +112,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_pipe = &fss_write_process_pipe;
           setting->process_normal = &fss_write_process_normal;
           setting->process_set = &fss_write_process_set;
-          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic list.
-          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by basic list.
+          setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by basic list.
+          setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by basic list.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
@@ -126,8 +126,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_pipe = &fss_write_process_pipe;
           setting->process_normal = &fss_write_process_normal;
           setting->process_set = &fss_write_process_set;
-          setting->flag |= fss_write_flag_ignore_e;
-          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by extended list.
+          setting->flag |= fss_write_main_flag_ignore_e;
+          setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by extended list.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
@@ -140,8 +140,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_pipe = &fss_write_process_pipe;
           setting->process_normal = &fss_write_process_normal;
           setting->process_set = &fss_write_process_set;
-          setting->flag |= fss_write_flag_ignore_e;
-          setting->flag |= fss_write_flag_content_multiple_e;
+          setting->flag |= fss_write_main_flag_ignore_e;
+          setting->flag |= fss_write_main_flag_content_multiple_e;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
@@ -154,18 +154,18 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
           setting->process_object = 0; // Not used by payload.
           setting->process_pipe = &fss_write_payload_process_pipe;
           setting->process_set = &fss_write_payload_process_set;
-          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by payload.
-          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by payload.
+          setting->flag -= setting->flag & fss_write_main_flag_ignore_e; // Not supported by payload.
+          setting->flag -= setting->flag & fss_write_main_flag_content_multiple_e; // Not supported by payload.
         }
         else {
-          if (setting->flag & fss_write_flag_help_e) {
+          if (setting->flag & fss_write_main_flag_help_e) {
             setting->state.status = F_status_set_error(F_parameter);
 
             break;
           }
 
           if (setting->state.status != F_status_set_error(F_parameter)) {
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
           }
 
           setting->state.status = F_status_set_error(F_parameter);
@@ -175,7 +175,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
       } // for
 
       if (F_status_is_error(setting->state.status)) {
-        if (setting->flag & fss_write_flag_help_e) {
+        if (setting->flag & fss_write_main_flag_help_e) {
           fss_write_main_process_help(main, setting);
         }
 
@@ -185,13 +185,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     else if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      if (setting->flag & fss_write_flag_help_e) {
+      if (setting->flag & fss_write_main_flag_help_e) {
         fss_write_main_process_help(main, setting);
 
         return;
       }
 
-      fss_write_print_line_first_locked(setting, main->error);
+      fss_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, fss_write_long_as_s);
 
       return;
index 48958224859beba5962484268514c19d65c9cf7e..74468153c60618336f6d2f31002a568bfbf21e51 100644 (file)
@@ -7,9 +7,9 @@ extern "C" {
 #ifndef _di_fss_write_print_error_
   f_status_t fss_write_print_error(fss_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-    fss_write_print_line_first_locked(setting, print);
     fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
 
     return F_none;
@@ -19,9 +19,9 @@ extern "C" {
 #ifndef _di_fss_write_print_error_file_
   f_status_t fss_write_print_error_file(fss_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-    fss_write_print_line_first_locked(setting, print);
     fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
 
     return F_none;
@@ -31,11 +31,11 @@ extern "C" {
 #ifndef _di_fss_write_print_error_parameter_same_times_at_least_
   f_status_t fss_write_print_error_parameter_same_times_at_least(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
-    fss_write_print_line_first_unlocked(setting, print);
     fl_print_format("%[%QMust specify the '%]", print.to, print.context, print.prefix, print.context);
     fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.notable);
     fl_print_format("%[' parameter at least the same number of times as the '%]", print.to, print.context, print.context);
@@ -53,11 +53,11 @@ extern "C" {
 #ifndef _di_fss_write_print_error_one_content_only_
   f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
-    fss_write_print_line_first_unlocked(setting, print);
     fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
     fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
     fl_print_format(" %[standard only supports one Content per Object.%]%r", print.to, print.context, print.context, f_string_eol_s);
@@ -71,7 +71,8 @@ extern "C" {
 #ifndef _fss_write_print_error_prepend_only_whitespace_
   f_status_t fss_write_print_error_prepend_only_whitespace(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
@@ -88,11 +89,11 @@ extern "C" {
 #ifndef _di_fss_write_print_error_unsupported_eol_
   f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
-    fss_write_print_line_first_unlocked(setting, print);
     fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
     fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
     fl_print_format(" %[standard does not support end of line character '%]", print.to, print.context, print.context);
@@ -110,6 +111,8 @@ extern "C" {
 #ifndef _di_fss_write_print_help_
   void fss_write_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return;
+
     fll_program_print_help_option_standard(print);
 
     f_print_dynamic_raw(f_string_eol_s, print.to);
@@ -135,6 +138,8 @@ extern "C" {
 #ifndef _di_fss_write_print_help_end_next_
   void fss_write_print_help_end_next(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting);
+
     fl_print_format("%r  The '%[%r%r%]',", print.to, f_string_eol_s, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_object_open_s, print.set->notable);
     fl_print_format(" '%[%r%r%]', and", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_next_s, print.set->notable);
     fl_print_format(" '%[%r%r%]' help facilitate writing the designated data for when using", print.to, print.set->notable, f_console_symbol_long_normal_s, fss_write_long_content_end_s, print.set->notable);
@@ -148,6 +153,8 @@ extern "C" {
 #ifndef _di_fss_write_print_help_pipe_
   void fss_write_print_help_pipe(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return;
+
     fl_print_format("%r  The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%r", print.to, f_string_eol_s, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
     fl_print_format("  The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
     fl_print_format("  The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%r", print.to, print.set->notable, print.set->notable, print.set->notable, print.set->notable, f_string_eol_s);
@@ -157,69 +164,43 @@ extern "C" {
   }
 #endif // _di_fss_write_print_help_pipe_
 
-#ifndef _di_fss_write_print_line_first_locked_
-  f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_line_first_
+  f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+      if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
     }
 
-    f_print_dynamic_raw(setting->line_first, print.to);
-
-    return F_none;
-  }
-#endif // _di_fss_write_print_line_first_locked_
+    if (setting->flag & fss_write_main_flag_print_first_e) {
+      fll_print_dynamic_raw(setting->line_first, print.to);
 
-#ifndef _di_fss_write_print_line_first_unlocked_
-  f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    if (F_status_is_error_not(setting->state.status)) {
-      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+      setting->flag -= fss_write_main_flag_print_first_e;
     }
 
-    fll_print_dynamic_raw(setting->line_first, print.to);
-
     return F_none;
   }
-#endif // _di_fss_write_print_line_first_unlocked_
+#endif // _di_fss_write_print_line_first_
 
-#ifndef _di_fss_write_print_line_last_locked_
-  f_status_t fss_write_print_line_last_locked(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_line_last_
+  f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
+      if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not;
     }
 
     fll_print_dynamic_raw(setting->line_last, print.to);
 
     return F_none;
   }
-#endif // _di_fss_write_print_line_last_locked_
-
-#ifndef _di_fss_write_print_line_last_unlocked_
-  f_status_t fss_write_print_line_last_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    if (F_status_is_error_not(setting->state.status)) {
-      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
-    }
-
-    f_print_dynamic_raw(setting->line_last, print.to);
-
-    return F_none;
-  }
-#endif // _di_fss_write_print_line_last_unlocked_
+#endif // _di_fss_write_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
index 3ab0bd19b2d194c6ef5fb46929166c3822688951..75bdfae13fd0150030cee65066aff53a331cfbd6 100644 (file)
@@ -201,31 +201,9 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_fss_write_print_line_first_locked_
-  extern f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_fss_write_print_line_first_unlocked_
-  extern f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_first_unlocked_
+#ifndef _di_fss_write_print_line_first_
+  extern f_status_t fss_write_print_line_first(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_line_first_
 
 /**
  * Print last new line when the main is complete, unless verbosity says otherwise.
@@ -245,31 +223,9 @@ extern "C" {
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
-#ifndef _di_fss_write_print_line_last_locked_
-  extern f_status_t fss_write_print_line_last_locked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_fss_write_print_line_last_unlocked_
-  extern f_status_t fss_write_print_line_last_unlocked(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_line_last_unlocked_
+#ifndef _di_fss_write_print_line_last_
+  extern f_status_t fss_write_print_line_last(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
index 4f93986d2f655d0d2a8b00cba656b207ab278968..3b857884bfdf6a27e9a8fb0ae36c065f97a9e569 100644 (file)
@@ -22,7 +22,7 @@ extern "C" {
     f_status_t status_pipe = F_none;
     f_file_t input = f_file_t_initialize;
     input.id = F_type_descriptor_input_d;
-    input.size_read = fss_write_default_allocation_large_d;
+    input.size_read = fss_write_allocation_large_d;
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
@@ -190,9 +190,10 @@ extern "C" {
 
         // Check to see if the Content supports multiple Content per Object.
         if (flag & 0x4) {
-          if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+          if (!(setting->flag & fss_write_main_flag_content_multiple_e)) {
             setting->state.status = F_status_set_error(F_support_not);
 
+            fss_write_print_line_first(setting, main->message);
             fss_write_print_error_one_content_only(setting, main->error);
 
             break;
@@ -256,6 +257,7 @@ extern "C" {
               if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
                 setting->state.status = F_status_set_error(F_support_not);
 
+                fss_write_print_line_first(setting, main->message);
                 fss_write_print_error_one_content_only(setting, main->error);
 
                 break;
@@ -385,8 +387,8 @@ extern "C" {
 
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
-    if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e))) {
-      if (setting->object && !(setting->flag & fss_write_flag_partial_e) && setting->contents && setting->contents->used) {
+    if ((!(setting->flag & fss_write_main_flag_partial_e) || (setting->flag & fss_write_main_flag_partial_e) && (setting->flag & fss_write_main_flag_object_e))) {
+      if (setting->object && !(setting->flag & fss_write_main_flag_partial_e) && setting->contents && setting->contents->used) {
         if (setting->object->used) {
           setting->range.start = 0;
           setting->range.stop = setting->object->used - 1;
@@ -396,21 +398,21 @@ extern "C" {
           setting->range.stop = 0;
         }
 
-        setting->state.status = fll_fss_payload_write(
+        fll_fss_payload_write(
           *setting->object,
           setting->contents->array[0],
-          (setting->flag & fss_write_flag_trim_e),
-          (setting->flag & fss_write_flag_prepend_e)
+          (setting->flag & fss_write_main_flag_trim_e),
+          (setting->flag & fss_write_main_flag_prepend_e)
             ? &setting->prepend
             : 0,
-          setting->state,
-          &setting->buffer
+          &setting->buffer,
+          &setting->state
         );
 
         if (F_status_set_fine(setting->state.status) == F_none_eol) {
           setting->state.status = F_status_set_error(F_support_not);
 
-          fss_write_print_line_first_locked(setting, main->error);
+          fss_write_print_line_first(setting, main->message);
           fss_write_print_error_unsupported_eol(setting, main->error);
 
           return;
@@ -433,24 +435,24 @@ extern "C" {
             setting->range.stop = 0;
           }
 
-          setting->state.status = fl_fss_basic_list_object_write(
+          fl_fss_basic_list_object_write(
             *setting->object,
-            (setting->flag & fss_write_flag_partial_e)
-              ? (setting->flag & fss_write_flag_trim_e)
+            (setting->flag & fss_write_main_flag_partial_e)
+              ? (setting->flag & fss_write_main_flag_trim_e)
                 ? f_fss_complete_trim_e
                 : f_fss_complete_none_e
-              : (setting->flag & fss_write_flag_trim_e)
+              : (setting->flag & fss_write_main_flag_trim_e)
                 ? f_fss_complete_full_trim_e
                 : f_fss_complete_full_e,
-            setting->state,
             &setting->range,
-            &setting->buffer
+            &setting->buffer,
+            &setting->state
           );
 
           if (F_status_set_fine(setting->state.status) == F_none_eol) {
             setting->state.status = F_status_set_error(F_support_not);
 
-            fss_write_print_line_first_locked(setting, main->error);
+            fss_write_print_line_first(setting, main->message);
             fss_write_print_error_unsupported_eol(setting, main->error);
 
             return;
@@ -463,8 +465,8 @@ extern "C" {
           }
         }
 
-        if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_content_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-          if (setting->flag & fss_write_flag_object_open_e) {
+        if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_content_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+          if (setting->flag & fss_write_main_flag_object_open_e) {
             setting->state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &setting->buffer);
 
             if (F_status_is_error_not(setting->state.status)) {
@@ -487,21 +489,21 @@ extern "C" {
 
         const f_string_static_t *prepend = 0;
 
-        if (setting->flag & fss_write_flag_prepend_e) {
+        if (setting->flag & fss_write_main_flag_prepend_e) {
           const f_array_length_t index = main->parameters.array[fss_write_parameter_prepend_e].values.array[main->parameters.array[fss_write_parameter_prepend_e].values.used - 1];
 
           prepend = &main->parameters.arguments.array[index];
         }
 
-        setting->state.status = fl_fss_basic_list_content_write(
+        fl_fss_basic_list_content_write(
           setting->contents->array[0],
           setting->object
             ? f_fss_complete_full_e
             : f_fss_complete_none_e,
           prepend,
-          setting->state,
           &setting->range,
-          &setting->buffer
+          &setting->buffer,
+          &setting->state
         );
 
         if (F_status_is_error(setting->state.status)) {
@@ -511,8 +513,8 @@ extern "C" {
         }
       }
 
-      if ((setting->flag & fss_write_flag_partial_e) && !(setting->flag & fss_write_flag_object_e) || !(setting->flag & (fss_write_flag_object_e | fss_write_flag_content_e))) {
-        if (setting->flag & fss_write_flag_content_end_e) {
+      if ((setting->flag & fss_write_main_flag_partial_e) && !(setting->flag & fss_write_main_flag_object_e) || !(setting->flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) {
+        if (setting->flag & fss_write_main_flag_content_end_e) {
           setting->state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &setting->buffer);
 
           if (F_status_is_error(setting->state.status)) {
@@ -542,7 +544,7 @@ extern "C" {
 #endif // _di_fss_write_payload_process_set_
 
 #ifndef _di_fss_write_payload_setting_load_
-  void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting, f_state_t * const state) {
+  void fss_write_payload_setting_load(const f_console_arguments_t arguments, fll_program_data_t * const main, fss_write_setting_t * const setting) {
 
     if (!main || !setting) return;
 
@@ -556,6 +558,7 @@ extern "C" {
         if (fl_string_dynamic_compare(argv[values->array[i]], fss_write_payload_s) == F_equal_to && i + 1 < values->used) {
           setting->state.status = F_status_set_error(F_parameter);
 
+          fss_write_print_line_first(setting, main->message);
           fss_write_payload_print_error_payload_not_last(setting, main->error);
 
           return;
index 153ddb7975f4f9576d18b572bcdb9566c36d1eba..2ce46c591023600578e242dc75c32ab58b5a26cf 100644 (file)
@@ -5,7 +5,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   fss_write_setting_t setting = fss_write_setting_t_initialize;
-  setting.state.data = (void *) &data;
+  setting.state.custom = (void *) &data;
   setting.standard = fss_write_payload_standard_s;
   setting.process_content = 0; // Not used by payload.
   setting.process_help = &fss_write_payload_process_help;
@@ -29,7 +29,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   {
     const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
 
-    fss_write_setting_load(arguments, state, &data, &setting, &fss_write_payload_setting_load);
+    fss_write_setting_load(arguments, &data, &setting, &fss_write_payload_setting_load);
   }
 
   fss_write_main(&data, &setting);
@@ -40,5 +40,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 6a62739ef1dcf33a538c3d56919b41f96abed620..f1b3d65f80722e0c39120fdf61245b3b0f17cd64 100644 (file)
@@ -11,7 +11,6 @@ extern "C" {
 
     f_file_stream_lock(print.to);
 
-    fss_write_print_line_first_unlocked(setting, print);
     fl_print_format("%[%QThe payload may only be specified last.%]%r", print.to, print.set->error, print.prefix, print.set->error, f_string_eol_s);
 
     f_file_stream_unlock(print.to);
@@ -23,6 +22,8 @@ extern "C" {
 #ifndef _di_fss_write_payload_print_help_
   f_status_t fss_write_payload_print_help(fss_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
index a54ab96056a2f1b31330dca7778511b138208e71..1d003416411106c8cef34bc3d428e14d166dce00 100644 (file)
@@ -45,6 +45,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_fss_write_payload_print_help_
   extern f_status_t fss_write_payload_print_help(fss_write_setting_t * const setting, const fl_print_t print);
index 419b107d1629a46911a232d5f6976495096056f2..4f6e7e703b6f867565304ce70c0aa85070c4bca6 100644 (file)
@@ -18,9 +18,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * iki_read_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_iki_read_d_
-  #define iki_read_signal_check_d 20000
+  #define iki_read_allocation_console_d 4
+  #define iki_read_allocation_large_d   256
+  #define iki_read_allocation_small_d   16
+  #define iki_read_signal_check_d       20000
 #endif // _di_iki_read_d_
 
 /**
@@ -191,7 +200,7 @@ extern "C" {
   #define iki_read_setting_t_initialize \
     { \
       iki_read_main_flag_none_e, \
-      f_state_t_initialize, \
+      macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_none, 0, 0, 0, 0, 0, 0), \
       0, \
       0, \
       f_string_static_t_initialize, \
index 9bc426e426358cba03e21db7fc8b3e581be67739..dfe2b3eaf0fd41901acd509cc79a3c78f2325a76 100644 (file)
@@ -29,10 +29,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = iki_read_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = iki_read_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(f_console_parameter_process));
 
index 36132a1dc78ed724d69842f8fadd9b39e31fa128..43452200a0783ee0b215681a4636a906a1a644f6 100644 (file)
@@ -4,6 +4,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_data_t data = fll_program_data_t_initialize;
   iki_read_setting_t setting = iki_read_setting_t_initialize;
+  setting.state.custom = (void *) &data;
+  setting.state.handle = &fll_program_standard_signal_handle;
 
   f_console_parameter_t parameters[] = iki_read_console_parameter_t_initialize;
   data.parameters.array = parameters;
@@ -30,5 +32,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
index 29145c7cfc487bcc4bad93094672607bd0daac10..59e38d1eed9b3997b5530ded4cd7cb38ca9a31c6 100644 (file)
@@ -162,11 +162,7 @@ extern "C" {
 #ifndef _di_iki_read_process_buffer_ranges_
   void iki_read_process_buffer_ranges(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *buffer_range) {
 
-    {
-      const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
-      setting->state.status = fl_iki_read(&setting->buffer, buffer_range, &setting->data, state);
-    }
+    fl_iki_read(&setting->buffer, buffer_range, &setting->data, &setting->state);
 
     if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
@@ -275,11 +271,7 @@ extern "C" {
 
     f_string_range_t range = buffer_range;
 
-    {
-      const f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
-      setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
-    }
+    fl_iki_read(&setting->buffer, &range, &setting->data, &setting->state);
 
     if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
@@ -389,11 +381,7 @@ extern "C" {
       return;
     }
 
-    {
-      f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
-
-      setting->state.status = fl_iki_read(&setting->buffer, &range, &setting->data, state);
-    }
+    fl_iki_read(&setting->buffer, &range, &setting->data, &setting->state);
 
     if (F_status_is_error(setting->state.status)) {
       iki_read_print_error(setting, main->error, macro_iki_read_f(fl_iki_read));
index b3d9a4dd1dabd3783f06246c9fdd4fb41bd51926..5facea56e389ddf71bdc80ff6e0d79296f6765ba 100644 (file)
@@ -26,11 +26,14 @@ extern "C" {
 
     if (!main || !setting) return;
 
-    setting->flag = 0;
+    setting->state.step_small = iki_write_allocation_console_d;
 
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = iki_write_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
+      iki_write_print_line_first(setting, main->message);
       iki_write_print_error(setting, main->error, macro_iki_write_f(f_console_parameter_process));
 
       return;
@@ -50,6 +53,7 @@ extern "C" {
         setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main);
 
         if (F_status_is_error(setting->state.status)) {
+          iki_write_print_line_first(setting, main->message);
           iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_context));
 
           return;
@@ -81,6 +85,7 @@ extern "C" {
         setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main);
 
         if (F_status_is_error(setting->state.status)) {
+          iki_write_print_line_first(setting, main->message);
           iki_write_print_error(setting, main->error, macro_iki_write_f(fll_program_parameter_process_verbosity));
 
           return;
@@ -114,7 +119,7 @@ extern "C" {
       if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) {
         setting->state.status = F_status_set_error(F_parameter);
 
-        iki_write_print_line_first_locked(setting, main->error);
+        iki_write_print_line_first(setting, main->message);
         fll_program_print_error_parameter_must_specify_once(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
 
         return;
@@ -128,7 +133,7 @@ extern "C" {
       setting->state.status = f_file_stream_open(main->parameters.arguments.array[index], f_string_empty_s, &main->output.to);
 
       if (F_status_is_error(setting->state.status)) {
-        iki_write_print_line_first_locked(setting, main->error);
+        iki_write_print_line_first(setting, main->message);
         fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_stream_open", fll_error_file_flag_fallback_e, main->parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
 
         return;
@@ -139,7 +144,7 @@ extern "C" {
     else if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      iki_write_print_line_first_locked(setting, main->error);
+      iki_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_file_s);
 
       return;
@@ -153,6 +158,7 @@ extern "C" {
       setting->state.status = f_string_dynamics_resize(values->used, &setting->objects);
 
       if (F_status_is_error(setting->state.status)) {
+        iki_write_print_line_first(setting, main->message);
         iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
 
         return;
@@ -173,7 +179,7 @@ extern "C" {
     else if (main->parameters.array[iki_write_parameter_object_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      iki_write_print_line_first_locked(setting, main->error);
+      iki_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_object_s);
 
       return;
@@ -187,6 +193,7 @@ extern "C" {
       setting->state.status = f_string_dynamics_resize(values->used, &setting->contents);
 
       if (F_status_is_error(setting->state.status)) {
+        iki_write_print_line_first(setting, main->message);
         iki_write_print_error(setting, main->error, macro_iki_write_f(f_string_dynamics_resize));
 
         return;
@@ -207,7 +214,7 @@ extern "C" {
     else if (main->parameters.array[iki_write_parameter_content_e].result & f_console_result_found_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      iki_write_print_line_first_locked(setting, main->error);
+      iki_write_print_line_first(setting, main->message);
       fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_write_long_content_s);
 
       return;
@@ -216,7 +223,7 @@ extern "C" {
     if (!(main->pipe & fll_program_data_pipe_input_e) && !(setting->flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      iki_write_print_line_first_locked(setting, main->error);
+      iki_write_print_line_first(setting, main->message);
       iki_write_print_error_main_missing(setting, main->error);
 
       return;
similarity index 95%
rename from level_3/iki_write/c/main/common-print.c
rename to level_3/iki_write/c/main/common/print.c
index 1c97f364c48fecf008dbc85aa7316da50f747e35..1a7d323ff9043126440cda2ad921025b03c5a76b 100644 (file)
@@ -1,4 +1,4 @@
-#include "iki_write.h"
+#include "../iki_write.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 99%
rename from level_3/iki_write/c/main/common-string.c
rename to level_3/iki_write/c/main/common/string.c
index f728f0596434f943d0c140894bd5d5544c9be787..28d8e0aad648b47b9afde2983843b14e55de1245 100644 (file)
@@ -1,4 +1,4 @@
-#include "iki_write.h"
+#include "../iki_write.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 76%
rename from level_3/iki_write/c/main/common-type.c
rename to level_3/iki_write/c/main/common/type.c
index 4bd708c8342cff4c47f82f503f1e281e84f8dc7e..192b52858ac331efc681624e6540625b821ba22f 100644 (file)
@@ -1,4 +1,4 @@
-#include "iki_write.h"
+#include "../iki_write.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 81%
rename from level_3/iki_write/c/main/common-type.h
rename to level_3/iki_write/c/main/common/type.h
index 7bcac47e30c598874935e7e7eb15844167d9e0e3..03efbb0a510fd8ae067cf76a7da355df97794fd7 100644 (file)
@@ -18,33 +18,44 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * iki_write_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_iki_write_d_
-  #define iki_write_signal_check_d 20000
+  #define iki_write_allocation_console_d 4
+  #define iki_write_allocation_large_d   256
+  #define iki_write_allocation_small_d   16
+  #define iki_write_signal_check_d       20000
 #endif // _di_iki_write_d_
 
 /**
  * Flags passed to the main function or program.
  *
  * iki_write_main_flag_*_e:
- *   - none:       No flags set.
- *   - content:    The Content being written is specified.
- *   - copyright:  Print copyright.
- *   - file_to:    Using a specified destination file.
- *   - help:       Print help.
- *   - object:     The Object being written is specified.
- *   - version:    Print version.
+ *   - none:        No flags set.
+ *   - content:     The Content being written is specified.
+ *   - copyright:   Print copyright.
+ *   - file_to:     Using a specified destination file.
+ *   - help:        Print help.
+ *   - object:      The Object being written is specified.
+ *   - print_first: When set, the first character printing logic is to be processed (this is usually automatic).
+ *   - version:     Print version.
  */
 #ifndef _di_iki_write_main_flag_e_
   enum {
-    iki_write_main_flag_none_e      = 0x0,
-    iki_write_main_flag_content_e   = 0x1,
-    iki_write_main_flag_copyright_e = 0x2,
-    iki_write_main_flag_file_to_e   = 0x4,
-    iki_write_main_flag_help_e      = 0x8,
-    iki_write_main_flag_object_e    = 0x10,
-    iki_write_main_flag_version_e   = 0x20,
-  };
+    iki_write_main_flag_none_e        = 0x0,
+    iki_write_main_flag_content_e     = 0x1,
+    iki_write_main_flag_copyright_e   = 0x2,
+    iki_write_main_flag_file_to_e     = 0x4,
+    iki_write_main_flag_help_e        = 0x8,
+    iki_write_main_flag_object_e      = 0x10,
+    iki_write_main_flag_print_first_e = 0x20,
+    iki_write_main_flag_version_e     = 0x40,
+  }; // enum
 #endif // _di_iki_write_main_flag_e_
 
 /**
@@ -146,7 +157,7 @@ extern "C" {
 
   #define iki_write_setting_t_initialize \
     { \
-      iki_write_main_flag_none_e, \
+      iki_write_main_flag_print_first_e, \
       f_state_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
index 77fc5a4631c5d68a887b67eb7c6254310a02557e..7db81cff9f1f0fe4912912aa518deccc866d8c39 100644 (file)
@@ -1,6 +1,4 @@
 #include "iki_write.h"
-#include "private-common.h"
-#include "private-write.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -12,7 +10,7 @@ extern "C" {
     if (!main || !setting) return;
 
     if (F_status_is_error(setting->state.status)) {
-      iki_write_print_line_last_locked(setting, main->error);
+      iki_write_print_line_last(setting, main->message);
 
       return;
     }
@@ -37,6 +35,10 @@ extern "C" {
       return;
     }
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      iki_write_print_line_first(setting, main->message);
+    }
+
     setting->escaped.used = 0;
 
     if (main->pipe & fll_program_data_pipe_input_e) {
@@ -74,6 +76,7 @@ extern "C" {
             setting->state.status = F_status_set_error(F_pipe);
 
             iki_write_print_error_file(setting, main->error, macro_iki_write_f(f_file_read), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
+            iki_write_print_line_last(setting, main->message);
 
             return;
           }
@@ -81,9 +84,8 @@ extern "C" {
           if (!setting->buffer.used) {
             setting->state.status = F_status_set_error(F_parameter);
 
-            iki_write_print_line_first_locked(setting, main->error);
             fll_program_print_error_pipe_missing_content(main->error);
-            iki_write_print_line_last_locked(setting, main->error);
+            iki_write_print_line_last(setting, main->message);
 
             return;
           }
@@ -107,9 +109,8 @@ extern "C" {
         if (object_ended && previous == range.start) {
           setting->state.status = F_status_set_error(F_parameter);
 
-          iki_write_print_line_first_locked(setting, main->error);
           fll_program_print_error_pipe_invalid_form_feed(main->error);
-          iki_write_print_line_last_locked(setting, main->error);
+          iki_write_print_line_last(setting, main->message);
 
           return;
         }
@@ -166,9 +167,8 @@ extern "C" {
       if (object_ended) {
         setting->state.status = F_status_set_error(F_parameter);
 
-        iki_write_print_line_first_locked(setting, main->error);
         fll_program_print_error_pipe_object_without_content(main->error);
-        iki_write_print_line_last_locked(setting, main->error);
+        iki_write_print_line_last(setting, main->message);
 
         return;
       }
@@ -192,8 +192,8 @@ extern "C" {
       fll_print_dynamic_raw(f_string_eol_s, main->output.to);
     } // for
 
-    if (F_status_is_error(setting->state.status)) {
-      iki_write_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      iki_write_print_line_last(setting, main->message);
     }
   }
 #endif // _di_iki_write_main_
index 68e4f63088f3edfae3dbf4a9f926ce86e16f9d36..c92613a5f8b2d9dbdd50ea508c6b30a237afd6b3 100644 (file)
 #include <fll/level_2/program.h>
 
 // IKI Write includes.
-#include <program/iki_write/main/common-print.h>
-#include <program/iki_write/main/common-string.h>
-#include <program/iki_write/main/common-type.h>
+#include <program/iki_write/main/common/print.h>
+#include <program/iki_write/main/common/string.h>
+#include <program/iki_write/main/common/type.h>
 #include <program/iki_write/main/common.h>
 #include <program/iki_write/main/print.h>
+#include <program/iki_write/main/print-error.h>
+#include <program/iki_write/main/process.h>
 
 #ifdef __cplusplus
 extern "C" {
index b4dfcf8e85a0552dd3ee25beee8c3a87d0628b27..bb004577048d757a033eee373664390e9836e282 100644 (file)
@@ -30,5 +30,5 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   fll_program_standard_set_down(&data);
 
-  return F_status_is_error(setting.status) ? 1 : 0;
+  return F_status_is_error(setting.state.status) ? 1 : 0;
 }
diff --git a/level_3/iki_write/c/main/print-error.c b/level_3/iki_write/c/main/print-error.c
new file mode 100644 (file)
index 0000000..9df61bf
--- /dev/null
@@ -0,0 +1,72 @@
+#include "iki_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_iki_write_print_error_
+  f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_
+
+#ifndef _di_iki_write_print_error_file_
+  f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    iki_write_print_line_first(setting, print);
+    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_file_
+
+#ifndef _di_iki_write_print_error_main_missing_
+  f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_object_s, print.set->notable);
+    fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
+    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_content_s, print.set->notable);
+    fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_main_missing_
+
+#ifndef _di_iki_write_print_error_object_not_valid_
+  f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
+    fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
+    fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_iki_write_print_error_object_not_valid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/iki_write/c/main/print-error.h b/level_3/iki_write/c/main/print-error.h
new file mode 100644 (file)
index 0000000..1cf70b1
--- /dev/null
@@ -0,0 +1,118 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: UTF8
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _iki_write_print_error_h
+#define _iki_write_print_error_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_print()
+ */
+#ifndef _di_iki_write_print_error_
+  extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_iki_write_print_error_
+
+/**
+ * Print file related error or warning messages.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates how printing is to be performed.
+ * @param function
+ *   The name of the function where the error happened.
+ *   Set to 0 to disable.
+ * @param name
+ *   The name of the file or directory.
+ * @param operation
+ *   The operation that fails, such as 'create' or 'access'.
+ * @param type
+ *   A valid file type code from the fll_error_file_type enum.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_file_print()
+ */
+#ifndef _di_iki_write_print_error_file_
+  extern f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
+#endif // _di_iki_write_print_error_file_
+
+/**
+ * Print error message about "main" Object being missing.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ */
+#ifndef _di_iki_write_print_error_main_missing_
+  extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_error_main_missing_
+
+/**
+ * Print error message about an Object not being valid.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param object
+ *   The a string representing the object that is missing.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ */
+#ifndef _di_iki_write_print_error_object_not_valid_
+  extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
+#endif // _di_iki_write_print_error_object_not_valid_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_print_error_h
index 6cfc8eaf0d443a1072e95316747542c6fefb488b..3af6e4df7a69a5e7514c5304650816cc5626f482 100644 (file)
@@ -1,75 +1,14 @@
 #include "iki_write.h"
-#include "private-common.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _di_iki_write_print_error_
-  f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function) {
-
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    iki_write_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_
-
-#ifndef _di_iki_write_print_error_file_
-  f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) {
-
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    iki_write_print_line_first_locked(setting, print);
-    fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_file_
-
-#ifndef _di_iki_write_print_error_main_missing_
-  f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print) {
-
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QNo main provided, either pipe the main data or use the '%]", print.to, print.set->error, print.prefix, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_object_s, print.set->notable);
-    fl_print_format("%[' and the '%]", print.to, print.set->error, print.set->error);
-    fl_print_format("%[%r%r%]", print.to, print.set->notable, f_console_symbol_long_normal_s, iki_write_long_content_s, print.set->notable);
-    fl_print_format("%[' parameters.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_main_missing_
-
-#ifndef _di_iki_write_print_error_object_not_valid_
-  f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object) {
-
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    iki_write_print_line_first_unlocked(setting, print);
-
-    fl_print_format("%[%QThe object '%]", print.to, print.set->error, print.prefix, print.set->error);
-    fl_print_format("%[%Q%]", print.to, print.set->notable, object, print.set->notable);
-    fl_print_format("%[' is not a valid IKI Object.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_error_object_not_valid_
-
 #ifndef _di_iki_write_print_help_
   f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print) {
 
+    if (!setting) return F_status_set_error(F_output_not);
+
     f_file_stream_lock(print.to);
 
     f_print_dynamic_raw(setting->line_first, print.to);
@@ -120,40 +59,31 @@ extern "C" {
   }
 #endif // _di_iki_write_print_help_
 
-#ifndef _di_iki_write_print_line_first_locked_
-  f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_iki_write_print_line_first_
+  f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
-    f_print_dynamic_raw(setting->line_first, print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_line_first_locked_
-
-#ifndef _di_iki_write_print_line_first_unlocked_
-  f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (setting->flag & iki_write_main_flag_print_first_e) {
+      fll_print_dynamic_raw(setting->line_first, print.to);
 
-    if (F_status_is_error_not(setting->state.status)) {
-      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+      setting->flag -= iki_write_main_flag_print_first_e;
     }
 
-    fll_print_dynamic_raw(setting->line_first, print.to);
-
     return F_none;
   }
-#endif // _di_iki_write_print_line_first_unlocked_
+#endif // _di_iki_write_print_line_first_
 
-#ifndef _di_iki_write_print_line_last_locked_
-  f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_iki_write_print_line_last_
+  f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
     if (F_status_is_error_not(setting->state.status)) {
       if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
@@ -163,22 +93,7 @@ extern "C" {
 
     return F_none;
   }
-#endif // _di_iki_write_print_line_last_locked_
-
-#ifndef _di_iki_write_print_line_last_unlocked_
-  f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    if (F_status_is_error_not(setting->state.status)) {
-      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-    }
-
-    f_print_dynamic_raw(setting->line_last, print.to);
-
-    return F_none;
-  }
-#endif // _di_iki_write_print_line_last_unlocked_
+#endif // _di_iki_write_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
index 27937067909d00c5e6d25f610112945e0e081e39..2b1c3c3b9d6c2ac1372886d48061df8e6cdbc748 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _iki_write_print_h
 #define _iki_write_print_h
@@ -13,93 +17,6 @@ extern "C" {
 #endif
 
 /**
- * Print generic error message regarding a function failing in some way.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- * @see fll_error_print()
- */
-#ifndef _di_iki_write_print_error_
-  extern f_status_t iki_write_print_error(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function);
-#endif // _di_iki_write_print_error_
-
-/**
- * Print file related error or warning messages.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates how printing is to be performed.
- * @param function
- *   The name of the function where the error happened.
- *   Set to 0 to disable.
- * @param name
- *   The name of the file or directory.
- * @param operation
- *   The operation that fails, such as 'create' or 'access'.
- * @param type
- *   A valid file type code from the fll_error_file_type enum.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- * @see fll_error_file_print()
- */
-#ifndef _di_iki_write_print_error_file_
-  extern f_status_t iki_write_print_error_file(iki_write_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type);
-#endif // _di_iki_write_print_error_file_
-
-/**
- * Print error message about "main" Object being missing.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_error_main_missing_
-  extern f_status_t iki_write_print_error_main_missing(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_error_main_missing_
-
-/**
- * Print error message about an Object not being valid.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- * @param object
- *   The a string representing the object that is missing.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_error_object_not_valid_
-  extern f_status_t iki_write_print_error_object_not_valid(iki_write_setting_t * const setting, const fl_print_t print, const f_string_static_t object);
-#endif // _di_iki_write_print_error_object_not_valid_
-
-/**
  * Print help.
  *
  * @param setting
@@ -112,6 +29,8 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_iki_write_print_help_
   extern f_status_t iki_write_print_help(iki_write_setting_t * const setting, const fl_print_t print);
@@ -134,32 +53,12 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_line_first_locked_
-  extern f_status_t iki_write_print_line_first_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
  *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_iki_write_print_line_first_unlocked_
-  extern f_status_t iki_write_print_line_first_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_first_unlocked_
+#ifndef _di_iki_write_print_line_first_
+  extern f_status_t iki_write_print_line_first(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_first_
 
 /**
  * Print last new line when the main is complete, unless verbosity says otherwise.
@@ -178,32 +77,12 @@ extern "C" {
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
- */
-#ifndef _di_iki_write_print_line_last_locked_
-  extern f_status_t iki_write_print_line_last_locked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
  *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_iki_write_print_line_last_unlocked_
-  extern f_status_t iki_write_print_line_last_unlocked(iki_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_iki_write_print_line_last_unlocked_
+#ifndef _di_iki_write_print_line_last_
+  extern f_status_t iki_write_print_line_last(iki_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_iki_write_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
diff --git a/level_3/iki_write/c/main/private-common.c b/level_3/iki_write/c/main/private-common.c
deleted file mode 100644 (file)
index f860d81..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "iki_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
diff --git a/level_3/iki_write/c/main/private-common.h b/level_3/iki_write/c/main/private-common.h
deleted file mode 100644 (file)
index b84006a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * FLL - Level 3
- *
- * Project: IKI Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_common_h
-#define _PRIVATE_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Provide common/generic definitions.
- *
- * iki_write_common_allocation_*:
- *   - large: An allocation step used for buffers that are anticipated to have large buffers.
- *   - small: An allocation step used for buffers that are anticipated to have small buffers.
- */
-#ifndef _di_iki_write_common_
-  #define iki_write_common_allocation_large_d 256
-  #define iki_write_common_allocation_small_d 16
-#endif // _di_iki_write_common_
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_common_h
similarity index 81%
rename from level_3/iki_write/c/main/private-write.c
rename to level_3/iki_write/c/main/process.c
index 9c77471d7e91629d267546d3755262eb19fcc5e3..ef7d6b805be93326a1b0dae862a021a0537af2cb 100644 (file)
@@ -1,6 +1,4 @@
 #include "iki_write.h"
-#include "private-common.h"
-#include "private-write.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -12,10 +10,7 @@ extern "C" {
     if (!object.used) {
       setting->state.status = F_status_set_error(F_failure);
 
-      if (main->error.verbosity != f_console_verbosity_quiet_e) {
-        iki_write_print_line_first_locked(setting, main->error);
-        fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
-      }
+      fll_program_print_error_missing_variable_not_zero(main->error, iki_write_object_s);
 
       return;
     }
@@ -25,12 +20,14 @@ extern "C" {
     if (setting->state.status == F_false) {
       setting->state.status = F_status_set_error(F_failure);
 
+      iki_write_print_line_first(setting, main->message);
       iki_write_print_error_object_not_valid(setting, main->error, object);
 
       return;
     }
 
     if (F_status_is_error(setting->state.status)) {
+      iki_write_print_line_first(setting, main->message);
       iki_write_print_error(setting, main->error, macro_iki_write_f(f_iki_object_is));
 
       return;
@@ -41,6 +38,7 @@ extern "C" {
     setting->state.status = fll_iki_content_escape(content, setting->quote, &setting->escaped);
 
     if (F_status_is_error(setting->state.status)) {
+      iki_write_print_line_first(setting, main->message);
       iki_write_print_error(setting, main->error, macro_iki_write_f(fll_iki_content_escape));
 
       return;
similarity index 82%
rename from level_3/iki_write/c/main/private-write.h
rename to level_3/iki_write/c/main/process.h
index ee23ec1abd4348c3be8ca23f6c3c131bc2e10de9..0c04d4bd17dbda749867ba415008727e8399c681 100644 (file)
@@ -4,9 +4,13 @@
  * Project: IKI
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
-#ifndef _PRIVATE_write_h
-#define _PRIVATE_write_h
+#ifndef _PRIVATE_write_process_h
+#define _PRIVATE_write_process_h
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,4 +47,4 @@ extern "C" {
 } // extern "C"
 #endif
 
-#endif // _PRIVATE_write_h
+#endif // _PRIVATE_write_process_h
index 9e31df89e2fbaab5c896f6f8ed5e5a959a35396e..785ea5d67cf3ccfdbe74f5f3da34aac91b3df13f 100644 (file)
@@ -21,11 +21,11 @@ build_libraries-individual -lfll_error -lfll_iki -lfll_print -lfll_program -lfl_
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library main/iki_write.c main/common.c main/common-print.c main/common-string.c main/common-type.c main/print.c main/private-common.c main/private-write.c
+build_sources_library main/iki_write.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print-error.c main/process.c
 
 build_sources_program main/main.c
 
-build_sources_headers main/iki_write.h main/common.h main/common-print.h main/common-string.h main/common-type.h main/print.h
+build_sources_headers main/iki_write.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print-error.h main/process.h
 
 build_sources_documentation man
 
index e017c11adf57e2cb24c07cc5a7a3ab89cc07e2e2..8f525500c50542fdc98cc56bfcafacef499a0cd9 100644 (file)
@@ -4,6 +4,10 @@
  * Project: Status Code
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _status_code_fss_print_h
 #define _status_code_fss_print_h
index d49be4ec04ed8997be748712edf00c265792e883..48ae7f0d9591e481d8b2114bd293afc8121a315c 100644 (file)
@@ -49,6 +49,7 @@
 #include <program/status_code/fss/common.h>
 #include <program/status_code/main/convert.h>
 #include <program/status_code/main/print.h>
+#include <program/status_code/main/print-data.h>
 #include <program/status_code/main/print-error.h>
 #include <program/status_code/main/process.h>
 
index 6fcb6ee3de7b5c3212a9e3841d2249c7aef9b0d8..151417d129a816743af82a0cdb602f46b4329d46 100644 (file)
@@ -18,8 +18,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
+    setting->state.step_small = status_code_allocation_console_d;
+
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = status_code_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       status_code_print_error(setting, main->error, macro_status_code_f(f_console_parameter_process));
 
@@ -117,7 +121,7 @@ extern "C" {
         if (!(setting->flag & status_code_main_flag_number_e)) {
           setting->state.status = F_status_set_error(F_parameter);
 
-          status_code_print_line_first_locked(setting, main->error);
+          status_code_print_line_first(setting, main->message);
           status_code_print_error_cannot_error_warning_number(setting, main->error);
 
           return;
@@ -127,7 +131,7 @@ extern "C" {
       if (setting->flag & status_code_main_flag_fine_e) {
         setting->state.status = F_status_set_error(F_parameter);
 
-        status_code_print_line_first_locked(setting, main->error);
+        status_code_print_line_first(setting, main->message);
         fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_error_s, status_code_long_fine_s);
 
         return;
@@ -136,7 +140,7 @@ extern "C" {
     else if (setting->flag & status_code_main_flag_warning_e && setting->flag & status_code_main_flag_fine_e) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      status_code_print_line_first_locked(setting, main->error);
+      status_code_print_line_first(setting, main->message);
       fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_warning_s, status_code_long_fine_s);
 
       return;
@@ -145,7 +149,7 @@ extern "C" {
     if (main->parameters.remaining.used == 0 && !(main->pipe & fll_program_data_pipe_input_e)) {
       setting->state.status = F_status_set_error(F_parameter);
 
-      status_code_print_line_first_locked(setting, main->error);
+      status_code_print_line_first(setting, main->message);
       status_code_print_error_no_status_codes(setting, main->error);
 
       return;
index 5f7778d676e5dd0ea40a937d58e0d3714e0e76ec..cae46195bb1cef28d4edde0a92a02ba97f59b6dc 100644 (file)
@@ -19,13 +19,22 @@ extern "C" {
 /**
  * The program defines.
  *
+ * status_code_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
+ *
  * macro_status_code_setting:
  *   - Used to represent a cast to ((status_code_setting_t *) setting).
  *   - Simplifies the number of parenthesis used to make code slightly cleaner.
  *   - Is wrapped in a parenthesis and not a block.
  */
 #ifndef _di_status_code_d_
-  #define status_code_signal_check_d 20000
+  #define status_code_allocation_console_d 4
+  #define status_code_allocation_large_d   256
+  #define status_code_allocation_small_d   16
+  #define status_code_signal_check_d       20000
 
   #define macro_status_code_setting(setting) ((status_code_setting_t *) setting)
 #endif // _di_status_code_d_
index 07060866609aa70bb4c639854a1c0f6cdb043ede..2a45068f94f8262ec7a1961e45228c139b2275fd 100644 (file)
@@ -12,9 +12,7 @@ extern "C" {
     setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, number);
 
     if (*number > F_status_size_max_with_bits_d) {
-      status_code_print_line_first_data(setting, main->message);
-
-      status_code_print_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+      status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
 
       setting->state.status = F_status_set_error(F_number_overflow);
 
@@ -22,13 +20,11 @@ extern "C" {
     }
 
     if (F_status_is_error(setting->state.status)) {
-      status_code_print_line_first_data(setting, main->message);
-
       if (F_status_set_fine(setting->state.status) == F_number_negative) {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_out_of_range_s);
       }
       else {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_number_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_number_s);
       }
     }
     else {
index b11219b00a89f34d96ab12717b7cc956983e0a52..51a1428ed6fa045195eee35aa88146ff3a49d44b 100644 (file)
@@ -4,6 +4,10 @@
  * Project: Status Code
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the convert functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _PRIVATE_status_code_convert_h
 #define _PRIVATE_status_code_convert_h
diff --git a/level_3/status_code/c/main/print-data.c b/level_3/status_code/c/main/print-data.c
new file mode 100644 (file)
index 0000000..1e95f30
--- /dev/null
@@ -0,0 +1,33 @@
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_print_data_code_
+  f_status_t status_code_print_data_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+    fll_print_format("%ui%r", print.to, code, f_string_eol_s);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_data_code_
+
+#ifndef _di_status_code_print_data_context_value_
+  f_status_t status_code_print_data_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+
+    fll_print_format("%[%Q%]%r", print.to, context, value, context, f_string_eol_s);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_data_context_value_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
diff --git a/level_3/status_code/c/main/print-data.h b/level_3/status_code/c/main/print-data.h
new file mode 100644 (file)
index 0000000..4f3cae3
--- /dev/null
@@ -0,0 +1,73 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print data functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_print_data_h
+#define _status_code_print_data_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic code.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param code
+ *   The code to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_data_code_
+  extern f_status_t status_code_print_data_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code);
+#endif // _di_status_code_print_data_code_
+
+/**
+ * Print generic context wrapped value.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param context
+ *   The context string to wrap the variable with.
+ * @param value
+ *   The value string.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_data_context_value_
+  extern f_status_t status_code_print_data_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value);
+#endif // _di_status_code_print_data_context_value_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_print_data_h
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8421d7819714499460e4214ff7343239cbc9be09 100644 (file)
@@ -0,0 +1,74 @@
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_status_code_print_error_
+  f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    status_code_print_line_first(setting, print);
+    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_error_
+
+#ifndef _di_status_code_print_error_cannot_error_warning_number_
+  f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QCannot specify the '%]", print.to, print.context, print.prefix, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_error_s, print.notable);
+    fl_print_format("%[' parameter with the '%]", print.to, print.context, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_warning_s, print.notable);
+    fl_print_format("%[' parameter when not also specifying the '%]", print.to, print.context, print.context);
+    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_number_s, print.notable);
+    fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_error_cannot_error_warning_number_
+
+#ifndef _di_status_code_print_error_no_status_codes_
+  f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    fll_print_format("%[No status code is specified.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_error_no_status_codes_
+
+#ifndef _di_status_code_print_error_invalid_callback_
+  f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name) {
+
+    if (!setting) return F_status_set_error(F_output_not);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
+
+    f_file_stream_lock(print.to);
+
+    fl_print_format("%[%QInvalid callback specified for '%]", print.to, print.context, print.prefix, print.context);
+    fl_print_format("%[%s%]", print.to, print.notable, name, print.notable);
+    fl_print_format("%[' internal setting.%]%r", print.to, print.context, print.context, f_string_eol_s);
+
+    f_file_stream_unlock(print.to);
+
+    return F_none;
+  }
+#endif // _di_status_code_print_error_invalid_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b3af5a50b50bfdcb0ded7b92897e884225646e89 100644 (file)
@@ -0,0 +1,120 @@
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * API Version: 0.7
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
+ */
+#ifndef _status_code_print_error_h
+#define _status_code_print_error_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Print generic error message regarding a function failing in some way.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_error_print()
+ *
+ * @see status_code_print_line_first()
+ */
+#ifndef _di_status_code_print_error_
+  extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
+#endif // _di_status_code_print_error_
+
+/**
+ * Print an error message when error parameter and warning parameter are specified without number parameter.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_status_code_print_error_cannot_error_warning_number_
+  extern f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_error_cannot_error_warning_number_
+
+/**
+ * Print an error message when no status codes are provided.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see fll_print_format()
+ */
+#ifndef _di_status_code_print_error_no_status_codes_
+  extern f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_error_no_status_codes_
+
+/**
+ * Print an error message when a callback from status_code_setting_t is invalid.
+ *
+ * @param setting
+ *   The main program settings.
+ *
+ *   This does not alter setting.state.status.
+ * @param print
+ *   Designates the how and where to print.
+ * @param name
+ *   The name of the callback setting that is invalid.
+ *   This should either be 'status_string_from' or 'status_string_to'.
+ *
+ * @return
+ *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see fl_print_format()
+ */
+#ifndef _di_status_code_print_error_invalid_callback_
+  extern f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name);
+#endif // _di_status_code_print_error_invalid_callback_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_print_error_h
index abf1ce0bb6bb668496db6e2a46487b4c1a7dcca3..828f248b52ecf61882fce2fb48b3190c45f0a738 100644 (file)
@@ -4,95 +4,6 @@
 extern "C" {
 #endif
 
-#ifndef _di_status_code_print_code_
-  f_status_t status_code_print_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
-    fll_print_format("%ui%r", print.to, code, f_string_eol_s);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_code_
-
-#ifndef _di_status_code_print_context_value_
-  f_status_t status_code_print_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
-    fll_print_format("%[%Q%]%r", print.to, context, value, context, f_string_eol_s);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_context_value_
-
-#ifndef _di_status_code_print_error_
-  f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    status_code_print_line_first_locked(setting, print);
-    fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_error_
-
-#ifndef _di_status_code_print_error_cannot_error_warning_number_
-  f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QCannot specify the '%]", print.to, print.context, print.prefix, print.context);
-    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_error_s, print.notable);
-    fl_print_format("%[' parameter with the '%]", print.to, print.context, print.context);
-    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_warning_s, print.notable);
-    fl_print_format("%[' parameter when not also specifying the '%]", print.to, print.context, print.context);
-    fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, status_code_long_number_s, print.notable);
-    fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_error_cannot_error_warning_number_
-
-#ifndef _di_status_code_print_error_no_status_codes_
-  f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    fll_print_format("%[No status code is specified.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_error_no_status_codes_
-
-#ifndef _di_status_code_print_error_invalid_callback_
-  f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    f_file_stream_lock(print.to);
-
-    fl_print_format("%[%QInvalid callback specified for '%]", print.to, print.context, print.prefix, print.context);
-    fl_print_format("%[%s%]", print.to, print.notable, name, print.notable);
-    fl_print_format("%[' internal setting.%]%r", print.to, print.context, print.context, f_string_eol_s);
-
-    f_file_stream_unlock(print.to);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_error_invalid_callback_
-
 #ifndef _di_status_code_print_help_
   f_status_t status_code_print_help(status_code_setting_t * const setting, const fl_print_t print) {
 
@@ -166,83 +77,41 @@ extern "C" {
   }
 #endif // _di_status_code_print_help_detail_
 
-#ifndef _di_status_code_print_line_first_data_
-  f_status_t status_code_print_line_first_data(status_code_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_status_code_print_line_first_
+  f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print) {
 
     if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
-
-    if (setting->flag & status_code_main_flag_print_first_e) {
-      fll_print_dynamic_raw(setting->line_first, print.to);
+    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-      setting->flag -= status_code_main_flag_print_first_e;
+    if (F_status_is_error_not(setting->state.status)) {
+      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
-    return F_none;
-  }
-#endif // _di_status_code_print_line_first_data_
-
-#ifndef _di_status_code_print_line_first_locked_
-  f_status_t status_code_print_line_first_locked(status_code_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
     if (setting->flag & status_code_main_flag_print_first_e) {
       fll_print_dynamic_raw(setting->line_first, print.to);
 
       setting->flag -= status_code_main_flag_print_first_e;
     }
-    else {
-      fll_print_dynamic_raw(f_string_eol_s, print.to);
-    }
 
     return F_none;
   }
-#endif // _di_status_code_print_line_first_locked_
+#endif // _di_status_code_print_line_first_
 
-#ifndef _di_status_code_print_line_first_unlocked_
-  f_status_t status_code_print_line_first_unlocked(status_code_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_status_code_print_line_last_
+  f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print) {
 
     if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    if (setting->flag & status_code_main_flag_print_first_e) {
-      fll_print_dynamic_raw(setting->line_first, print.to);
-
-      setting->flag -= status_code_main_flag_print_first_e;
-    }
-    else {
-      fll_print_dynamic_raw(f_string_eol_s, print.to);
+    if (F_status_is_error_not(setting->state.status)) {
+      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
     }
 
-    return F_none;
-  }
-#endif // _di_status_code_print_line_first_unlocked_
-
-#ifndef _di_status_code_print_line_last_locked_
-  f_status_t status_code_print_line_last_locked(status_code_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
     fll_print_dynamic_raw(setting->line_last, print.to);
 
     return F_none;
   }
-#endif // _di_status_code_print_line_last_locked_
-
-#ifndef _di_status_code_print_line_last_unlocked_
-  f_status_t status_code_print_line_last_unlocked(status_code_setting_t * const setting, const fl_print_t print) {
-
-    if (!setting) return F_status_set_error(F_output_not);
-    if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
-
-    f_print_dynamic_raw(setting->line_last, print.to);
-
-    return F_none;
-  }
-#endif // _di_status_code_print_line_last_unlocked_
+#endif // _di_status_code_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
index a746aa88214b7e733a89a5e1fd37d60e817831d1..5a5a72807ebc09e2b8381ccf47a59aed50bfa3b5 100644 (file)
@@ -4,6 +4,10 @@
  * Project: Status Code
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _status_code_print_h
 #define _status_code_print_h
@@ -13,153 +17,6 @@ extern "C" {
 #endif
 
 /**
- * Print generic code.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- * @param code
- *   The code to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_code_
-  f_status_t status_code_print_code(status_code_setting_t * const setting, const fl_print_t print, const uint16_t code);
-#endif // _di_status_code_print_code_
-
-/**
- * Print generic context wrapped value.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- * @param context
- *   The context string to wrap the variable with.
- * @param value
- *   The value string.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_context_value_
-  f_status_t status_code_print_context_value(status_code_setting_t * const setting, const fl_print_t print, const f_color_set_t context, const f_string_static_t value);
-#endif // _di_status_code_print_context_value_
-
-/**
- * Print generic error message regarding a function failing in some way.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_error_print()
- *
- * @see status_code_print_line_first_locked()
- */
-#ifndef _di_status_code_print_error_
-  extern f_status_t status_code_print_error(status_code_setting_t * const setting, const fl_print_t print, const f_string_t function);
-#endif // _di_status_code_print_error_
-
-/**
- * Print an error message when error parameter and warning parameter are specified without number parameter.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see fl_print_format()
- */
-#ifndef _di_status_code_print_error_cannot_error_warning_number_
-  extern f_status_t status_code_print_error_cannot_error_warning_number(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_error_cannot_error_warning_number_
-
-/**
- * Print an error message when no status codes are provided.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_format()
- */
-#ifndef _di_status_code_print_error_no_status_codes_
-  extern f_status_t status_code_print_error_no_status_codes(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_error_no_status_codes_
-
-/**
- * Print an error message when a callback from status_code_setting_t is invalid.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- * @param name
- *   The name of the callback setting that is invalid.
- *   This should either be 'status_string_from' or 'status_string_to'.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see fl_print_format()
- */
-#ifndef _di_status_code_print_error_invalid_callback_
-  extern f_status_t status_code_print_error_invalid_callback(status_code_setting_t * const setting, const fl_print_t print, const f_string_t name);
-#endif // _di_status_code_print_error_invalid_callback_
-
-/**
  * Print help.
  *
  * @param setting
@@ -222,7 +79,6 @@ extern "C" {
  * Print first new line, if applicable, otherwise nothing.
  *
  * This is generally intended to be used before data prints.
- * This should probably be printed to setting.message while data goes to setting.output.
  *
  * This ensures a first line is printed if the data is the first output to be performed.
  *
@@ -241,61 +97,9 @@ extern "C" {
  *
  * @see fll_print_dynamic_raw()
  */
-#ifndef _di_status_code_print_line_first_data_
-  extern f_status_t status_code_print_line_first_data(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_data_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function locks and then unlocks the input stream when printing.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_first_locked_
-  extern f_status_t status_code_print_line_first_locked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_locked_
-
-/**
- * Print first new line, unless verbosity says otherwise.
- *
- * This is generally either the first line in the program or the first line printed before an error message.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_first_unlocked_
-  extern f_status_t status_code_print_line_first_unlocked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_first_unlocked_
+#ifndef _di_status_code_print_line_first_
+  extern f_status_t status_code_print_line_first(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_line_first_
 
 /**
  * Print last new line when the main is complete, unless verbosity says otherwise.
@@ -319,34 +123,9 @@ extern "C" {
  *
  * @see fll_print_dynamic_raw()
  */
-#ifndef _di_status_code_print_line_last_locked_
-  extern f_status_t status_code_print_line_last_locked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_last_locked_
-
-/**
- * Print last new line when the main is complete, unless verbosity says otherwise.
- *
- * This is generally the very last line printed in the program.
- *
- * This function neither locks nor unlocks the input stream.
- *
- * @param setting
- *   The main program settings.
- *   This does not alter setting.state.status.
- * @param print
- *   Designates the how and where to print.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- *   F_output_not (with error bit) if setting is NULL.
- *
- * @see f_print_dynamic_raw()
- */
-#ifndef _di_status_code_print_line_last_unlocked_
-  extern f_status_t status_code_print_line_last_unlocked(status_code_setting_t * const setting, const fl_print_t print);
-#endif // _di_status_code_print_line_last_unlocked_
+#ifndef _di_status_code_print_line_last_
+  extern f_status_t status_code_print_line_last(status_code_setting_t * const setting, const fl_print_t print);
+#endif // _di_status_code_print_line_last_
 
 #ifdef __cplusplus
 } // extern "C"
index 1ee810e886c1b5bdfe7ab7b5bf623eb3728a19e6..9ec32694adfe53f1ffc6b49daccbdde56a648226 100644 (file)
@@ -18,8 +18,6 @@ extern "C" {
 
     f_file_stream_lock(main->output.to);
 
-    status_code_print_line_first_unlocked(setting, main->output);
-
     if ((setting->flag & status_code_main_flag_error_e) && F_status_is_error(number) || (setting->flag & status_code_main_flag_warning_e) && F_status_is_warning(number) || (setting->flag & status_code_main_flag_fine_e) && F_status_is_fine(number)) {
       f_print_dynamic_raw(f_status_true_s, main->output.to);
     }
@@ -46,9 +44,7 @@ extern "C" {
       setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, value, &number);
 
       if (setting->state.status == F_none) {
-        status_code_print_line_first_data(setting, main->message);
-
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_name_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_name_s);
 
         setting->state.status = F_status_set_error(F_parameter);
 
@@ -56,9 +52,7 @@ extern "C" {
       }
 
       if (setting->state.status == F_data_not || F_status_set_fine(setting->state.status) == F_parameter) {
-        status_code_print_line_first_data(setting, main->message);
-
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_invalid_main_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_invalid_main_s);
 
         return;
       }
@@ -69,22 +63,18 @@ extern "C" {
     setting->state.status = setting->status_string_from(value, &code);
 
     if (F_status_is_error(setting->state.status)) {
-      status_code_print_line_first_data(setting, main->message);
-
       if (F_status_set_fine(setting->state.status) == F_data) {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_name_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_name_s);
       }
       else {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
       }
 
       return;
     }
 
     if (setting->state.status == F_data) {
-      status_code_print_line_first_data(setting, main->message);
-
-      status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+      status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
 
       setting->state.status = F_none;
 
@@ -99,9 +89,7 @@ extern "C" {
       code = F_status_set_warning(code);
     }
 
-    status_code_print_line_first_data(setting, main->message);
-
-    status_code_print_code(setting, main->output, code);
+    status_code_print_data_code(setting, main->output, code);
 
     setting->state.status = F_none;
   }
@@ -123,20 +111,18 @@ extern "C" {
       setting->state.status = setting->status_string_to((f_status_t) number, &name);
     }
 
-    status_code_print_line_first_data(setting, main->message);
-
     if (F_status_is_error(setting->state.status)) {
       if (F_status_set_fine(setting->state.status) == F_data) {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_unknown_code_s);
       }
       else {
-        status_code_print_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
+        status_code_print_data_context_value(setting, main->output, main->context.set.error, status_code_failed_to_convert_s);
       }
 
       return;
     }
 
-    status_code_print_context_value(setting, main->output, f_color_set_empty_s, name);
+    status_code_print_data_context_value(setting, main->output, f_color_set_empty_s, name);
 
     setting->state.status = F_none;
   }
index daf2f9ec318278987ec93ee939bd24c70ac3ac0a..170895ff7a17e018b4956821034837e3d84d9979 100644 (file)
@@ -4,6 +4,10 @@
  * Project: Status Code
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _PRIVATE_status_code_process_h
 #define _PRIVATE_status_code_process_h
index e49f984d85c598a25b7e43ebbda2a8a7b7204930..8a3785770e5bf2178b3509338ae7459f96aaef09 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
     if (!main || !setting) return;
 
     if (F_status_is_error(setting->state.status)) {
-      status_code_print_line_last_locked(setting, main->error);
+      status_code_print_line_last(setting, main->message);
 
       return;
     }
@@ -50,6 +50,10 @@ extern "C" {
       return;
     }
 
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      status_code_print_line_first(setting, main->message);
+    }
+
     f_status_t status = F_none;
 
     if (setting->flag & status_code_main_flag_number_e) {
@@ -161,8 +165,8 @@ extern "C" {
       }
     }
 
-    if (F_status_is_error(setting->state.status)) {
-      status_code_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error);
+    if (F_status_is_error(setting->state.status) || main->message.verbosity > f_console_verbosity_error_e) {
+      status_code_print_line_last(setting, main->message);
     }
   }
 #endif // _di_status_code_main_
index 4271006c98c17bb47bb5be00910317b61578233b..c5fb7d12297ad431866d713d272144a53ce9f9f3 100644 (file)
@@ -48,6 +48,7 @@
 #include <program/status_code/main/common.h>
 #include <program/status_code/main/convert.h>
 #include <program/status_code/main/print.h>
+#include <program/status_code/main/print-data.h>
 #include <program/status_code/main/print-error.h>
 #include <program/status_code/main/process.h>
 
index 784ee63b76178d8d4eb61452ee0186a01a378b35..a661c6c57cd50faed5ca0b2f5533889a834b9b5a 100644 (file)
@@ -25,10 +25,10 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_st
 build_libraries-level -lfll_2 -lfll_1 -lfll_0
 build_libraries-monolithic -lfll
 
-build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print-error.c main/process.c
+build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print-data.c main/print-error.c main/process.c
 build_sources_library fss/status_code.c fss/common.c
 
-build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print-error.h main/process.h
+build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print-data.h main/print-error.h main/process.h
 build_sources_headers fss/status_code.h fss/common.h
 
 build_sources_documentation man
index 194ded088a80f86099d87afe5767bf75e272e0d2..7e48f9d311df5e47861f3a20147db37572fac89b 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the bytesequence functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _PRIVATE_utf8_bytesequence_h
 #define _PRIVATE_utf8_bytesequence_h
index 45fa9fe7982b2bfe44f746ae59869786a0a00d6d..38fceb7370620a462ce6ff51ebba888c6f2342c7 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the codepoint functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _PRIVATE_utf8_codepoint_h
 #define _PRIVATE_utf8_codepoint_h
index 5e55a3fe4490712b8e5a187f87629939471152a7..b8431b699a4d54608dbb8c3e550d2eca6b54f0d5 100644 (file)
@@ -25,8 +25,12 @@ extern "C" {
 
     if (!main || !setting) return;
 
+    setting->state.step_small = utf8_allocation_console_d;
+
     f_console_parameter_process(arguments, &main->parameters, &setting->state, 0);
 
+    setting->state.step_small = utf8_allocation_small_d;
+
     if (F_status_is_error(setting->state.status)) {
       utf8_print_line_first(setting, main->message);
       utf8_print_error(setting, main->error, macro_utf8_f(f_console_parameter_process));
@@ -190,6 +194,7 @@ extern "C" {
       if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) {
         setting->state.status = F_status_set_error(F_parameter);
 
+        utf8_print_line_first(setting, main->message);
         utf8_print_error_parameter_file_to_too_many(setting, main->error);
 
         return;
index 72297ed4d3bc4271eae4ba3bf4fe790905af7876..4a2878ea4aef324643393341ef2d7fef61725bef 100644 (file)
@@ -25,9 +25,18 @@ extern "C" {
 
 /**
  * The program defines.
+ *
+ * utf8_*:
+ *   - allocation_console: An allocation step used for small buffers specifically for console parameter.
+ *   - allocation_large:   An allocation step used for buffers that are anticipated to have large buffers.
+ *   - allocation_small:   An allocation step used for buffers that are anticipated to have small buffers.
+ *   - signal_check:       Number of iterations before performing signal check in non-threaded signal handling.
  */
 #ifndef _di_utf8_d_
-  #define utf8_signal_check_d 20000
+  #define utf8_allocation_console_d 4
+  #define utf8_allocation_large_d   256
+  #define utf8_allocation_small_d   16
+  #define utf8_signal_check_d       20000
 #endif // _di_utf8_d_
 
 /**
index 13de28333d38175a0b4628a51f5d3f7645ab65ad..ab7e2ce14e8dcc7886f0ed067f99a385fe1a0841 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 #ifndef _di_utf8_print_data_bytesequence_
   f_status_t utf8_print_data_bytesequence(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     fl_print_format("%r%r%r", print.to, setting->prepend, sequence, setting->append);
 
@@ -18,7 +18,7 @@ extern "C" {
 #ifndef _di_utf8_print_data_character_invalid_
   f_status_t utf8_print_data_character_invalid(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t invalid) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
     if (!invalid.used) return F_output_not;
 
@@ -48,7 +48,7 @@ extern "C" {
 #ifndef _di_utf8_print_data_codepoint_
   f_status_t utf8_print_data_codepoint(utf8_setting_t * const setting, const fl_print_t print, const uint32_t codepoint) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     if (codepoint < 0x10000) {
       fl_print_format("%rU+%04_U%r", print.to, setting->prepend, codepoint, setting->append);
@@ -67,7 +67,7 @@ extern "C" {
 #ifndef _di_utf8_print_data_combining_or_width_
   f_status_t utf8_print_data_combining_or_width(utf8_setting_t * const setting, const fl_print_t print, const f_string_static_t sequence) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     if (setting->mode & utf8_mode_to_combining_e) {
       f_status_t status = f_utf_is_combining(sequence.string, sequence.used);
@@ -103,7 +103,7 @@ extern "C" {
 #ifndef _di_utf8_print_data_combining_or_width_invalid_
   f_status_t utf8_print_data_combining_or_width_invalid(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
     if (setting->flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not;
 
     fl_print_format("%r%[%r%]%r", print.to, setting->prepend, setting->valid_not, utf8_string_unknown_s, setting->valid_not, setting->append);
index c8e0663a30e4aa4a9f00e0bb1aa0713e07c0f0ec..1cab73225b0f3d9b6755dd5ea4449c2dc4851155 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print data functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _utf8_print_data_h
 #define _utf8_print_data_h
index 17fd254c827bd789c969f78a82760de848a320f2..bf1a341148c6807be6c36dc1b9767e46a170a201 100644 (file)
@@ -143,8 +143,6 @@ extern "C" {
     if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
-    utf8_print_line_first(setting, print);
-
     fll_print_format("%[%QToo many '%r' files specified, there may only be one '%r' file.%]%r", print.to, print.set->error, print.prefix, utf8_string_to_s, utf8_string_to_s, print.set->error, f_string_eol_s);
 
     return F_none;
index 34ac5dc2f4710c7cf0ae56c99095179ada936aad..293263a825b74bbce1a8228d9d3d6be5b17b369e 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print error functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _utf8_print_error_h
 #define _utf8_print_error_h
@@ -207,8 +211,6 @@ extern "C" {
  *   F_output_not (with error bit) if setting is NULL.
  *
  * @see fll_print_format()
- *
- * @see utf8_print_line_first()
  */
 #ifndef _di_utf8_print_error_parameter_file_to_too_many_
   extern f_status_t utf8_print_error_parameter_file_to_too_many(utf8_setting_t * const setting, const fl_print_t print);
index e6c2e1304a1729a5ae75c1ba11dc08af2337c598..c007f3cfbb7b83b718b66716a8aadad92af3d709 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 #ifndef _di_utf8_print_help_
   f_status_t utf8_print_help(utf8_setting_t * const setting, const fl_print_t print) {
 
-    if (!setting) return F_output_not;
+    if (!setting) return F_status_set_error(F_output_not);
 
     f_file_stream_lock(print.to);
 
@@ -69,6 +69,10 @@ extern "C" {
     if (!setting) return F_status_set_error(F_output_not);
     if (print.verbosity < f_console_verbosity_error_e) return F_output_not;
 
+    if (F_status_is_error_not(setting->state.status)) {
+      if (print.verbosity < f_console_verbosity_normal_e) return F_output_not;
+    }
+
     if (setting->flag & utf8_main_flag_print_first_e) {
       fll_print_dynamic_raw(setting->line_first, print.to);
 
index b0af6e3ec2a8f3c466cbb8ebfde1ed6614ca7455..95f4c9c80b8907a088569204060579678081b1d8 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the print functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _utf8_print_h
 #define _utf8_print_h
index 81db317b3325b01c5beab217e71b9d23d9568ddb..4918fe58e41a0fd64ead818fe76c5ab723f9aa5a 100644 (file)
@@ -4,6 +4,10 @@
  * Project: UTF8
  * API Version: 0.7
  * Licenses: lgpl-2.1-or-later
+ *
+ * Provides the process functionality.
+ *
+ * This is auto-included and should not need to be explicitly included.
  */
 #ifndef _utf8_process_h
 #define _utf8_process_h
index a6cb03fbe0bd9cbe015e49e3a80a1c47db179bc7..31dca55ff8de4e4ae1440d124b96c7e98f3c2f68 100644 (file)
@@ -35,7 +35,9 @@ extern "C" {
       return;
     }
 
-    utf8_print_line_first(setting, main->message);
+    if (main->message.verbosity > f_console_verbosity_error_e) {
+      utf8_print_line_first(setting, main->message);
+    }
 
     f_status_t valid = F_true;