]> Kevux Git Server - fll/commitdiff
Progress: Improve FSS program processing and fix related bugs.
authorKevin Day <kevin@kevux.org>
Sun, 28 Jan 2024 06:32:13 +0000 (00:32 -0600)
committerKevin Day <kevin@kevux.org>
Sun, 28 Jan 2024 06:43:14 +0000 (00:43 -0600)
Clean up the logic in the fll_fss functions, removing redundant code.

Improve handling of F_fss_found_object_content_not cases in a more consistent manner.

Improve logic of the fll_fss payload functions.
Remove dead code that does nothing.
Have the payload processing properly determine and communicate when the "payload" section is missing.
Update the documentation comments.

Improve the FSS read programs relating to the above changes.
Fix problems in the FSS read programs where sometimes the EOL string is directly printed rather than calling the appropriate object/content end callbacks.
The callbacks handle the uses cases for when the pipe is used but the direct EOL string printing does not.

Rename the FSS read progams print functions to have the "data", "message", "error", and such practice be more consistently followed.

This fixes several of the problems in the FSS Read programs where the "-e/--empty" parameter is not being properly respected in many cases.
I am not sure I got all of the situations and the logic from all of the changes that I made needs some review.

For the FSS payload read program, add a new special parameter called "--payload".
This allows giving the user more control over how to handle the cases where the payload section does not exist.
Specifically, there is a payload "create" mode that allows for ensuring that the "payload" section always exists.
This should ideally help make scripting simpler and therefore easier.

The parameters must be re-processed once the '-A" is passed for the fss_read combined program.

I added a print_content_empty callback and then commented it out in this commit.
This seems like it would be practical to have but I am not certain any FSS specification would need this at this time.
Further investigation is needed in this regard.

Add some more TODO and FIXME comments so that when I come back to this code and can better resume where I left off.

I did very little testing of these changes.

46 files changed:
level_2/fll_fss/c/fss/basic.c
level_2/fll_fss/c/fss/basic_list.c
level_2/fll_fss/c/fss/extended.c
level_2/fll_fss/c/fss/extended_list.c
level_2/fll_fss/c/fss/payload.c
level_2/fll_fss/c/fss/payload.h
level_3/fss_read/c/basic/fss_read.c
level_3/fss_read/c/basic/main.c
level_3/fss_read/c/basic/print.c
level_3/fss_read/c/basic/print.h
level_3/fss_read/c/basic_list/fss_read.c
level_3/fss_read/c/basic_list/main.c
level_3/fss_read/c/basic_list/print.c
level_3/fss_read/c/basic_list/print.h
level_3/fss_read/c/embedded_list/fss_read.c
level_3/fss_read/c/embedded_list/main.c
level_3/fss_read/c/embedded_list/print.c
level_3/fss_read/c/embedded_list/print.h
level_3/fss_read/c/extended/fss_read.c
level_3/fss_read/c/extended/main.c
level_3/fss_read/c/extended/print.c
level_3/fss_read/c/extended/print.h
level_3/fss_read/c/extended_list/fss_read.c
level_3/fss_read/c/extended_list/main.c
level_3/fss_read/c/extended_list/print.c
level_3/fss_read/c/extended_list/print.h
level_3/fss_read/c/main/common.c
level_3/fss_read/c/main/common/enumeration.h
level_3/fss_read/c/main/common/print.c
level_3/fss_read/c/main/common/print.h
level_3/fss_read/c/main/common/string.c
level_3/fss_read/c/main/common/string.h
level_3/fss_read/c/main/common/type.h
level_3/fss_read/c/main/main.c
level_3/fss_read/c/main/main/print.c
level_3/fss_read/c/main/main/print.h
level_3/fss_read/c/main/print/data.c
level_3/fss_read/c/main/print/data.h
level_3/fss_read/c/main/print/message.c
level_3/fss_read/c/main/process_normal.c
level_3/fss_read/c/payload/common.c
level_3/fss_read/c/payload/common.h
level_3/fss_read/c/payload/fss_read.c
level_3/fss_read/c/payload/main.c
level_3/fss_read/c/payload/print.c
level_3/fss_read/c/payload/print.h

index e900861424c8599b2d2159d090878094d274cf0a..8dd3369e657ed4d9d6bb14730583cd66bbbcf491 100644 (file)
@@ -47,24 +47,9 @@ extern "C" {
 
         if (range->start >= range->stop || range->start >= buffer.used) {
           if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
-            ++objects->used;
-
-            if (objects_quoted) {
-              ++objects_quoted->used;
-            }
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-            if (F_status_is_error(status)) {
-              state->status = status;
-
-              return;
-            }
-
-            contents->array[contents->used++].used = 0;
             state->status = F_fss_found_object_content_not;
 
-            return;
+            break;
           }
 
           if (state->status == F_data_not) return;
@@ -90,19 +75,7 @@ extern "C" {
           break;
         }
 
-        if (state->status == F_fss_found_object_content_not) {
-          found_data = F_true;
-
-          status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-          if (F_status_is_error(status)) {
-            state->status = status;
-
-            return;
-          }
-
-          break;
-        }
+        if (state->status == F_fss_found_object_content_not) break;
 
       } while (state->status == F_fss_found_object_not);
 
@@ -131,14 +104,23 @@ extern "C" {
         return;
       }
 
+      if (state->status == F_fss_found_object_content_not) {
+        found_data = F_true;
+
+        status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
+        if (F_status_is_error(status)) {
+          state->status = status;
+
+          return;
+        }
+
+        contents->array[contents->used].used = 0;
+      }
+
       // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
       if (range->start >= range->stop || range->start >= buffer.used) {
         if (state->status == F_fss_found_object || state->status == F_fss_found_content || state->status == F_fss_found_content_not || state->status == F_fss_found_object_content_not) {
-
-          if (state->status == F_fss_found_object_content_not) {
-            contents->array[contents->used].used = 0;
-          }
-
           ++objects->used;
           ++contents->used;
 
@@ -152,10 +134,6 @@ extern "C" {
         return;
       }
 
-      if (state->status == F_fss_found_object_content_not) {
-        contents->array[contents->used].used = 0;
-      }
-
       ++objects->used;
       ++contents->used;
 
index f3cb7a4de3dae28af73b897b9759db449cec91bf..e7a65c4fa0de08b8a40810c9366b358c7c7f2559 100644 (file)
@@ -36,20 +36,9 @@ extern "C" {
 
         if (range->start >= range->stop || range->start >= buffer.used) {
           if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
-            ++objects->used;
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-            if (F_status_is_error(status)) {
-              state->status = status;
-
-              return;
-            }
-
-            contents->array[contents->used++].used = 0;
             state->status = F_fss_found_object_content_not;
 
-            return;
+            break;
           }
 
           if (state->status == F_data_not) return;
@@ -66,7 +55,6 @@ extern "C" {
 
         if (state->status == F_fss_found_object) {
           found_data = F_true;
-
           contents->array[contents->used].used = 0;
 
           fl_fss_basic_list_content_read(buffer, range, &contents->array[contents->used], contents_delimits ? contents_delimits : objects_delimits, comments, state);
@@ -75,19 +63,7 @@ extern "C" {
           break;
         }
 
-        if (state->status == F_fss_found_object_content_not) {
-          found_data = F_true;
-
-          status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-          if (F_status_is_error(status)) {
-            state->status = status;
-
-            return;
-          }
-
-          break;
-        }
+        if (state->status == F_fss_found_object_content_not) break;
 
       } while (state->status == F_fss_found_object_not);
 
@@ -112,15 +88,24 @@ extern "C" {
         return;
       }
 
+      if (state->status == F_fss_found_object_content_not) {
+        found_data = F_true;
+
+        status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
+        if (F_status_is_error(status)) {
+          state->status = status;
+
+          return;
+        }
+
+        contents->array[contents->used].used = 0;
+      }
+
       if (range->start >= range->stop || range->start >= buffer.used) {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (state->status == F_fss_found_object || state->status == F_fss_found_content || state->status == F_fss_found_content_not || state->status == F_fss_found_object_content_not) {
-
-          if (state->status == F_fss_found_object_content_not) {
-            contents->array[contents->used].used = 0;
-          }
-
           ++objects->used;
           ++contents->used;
         }
@@ -130,10 +115,6 @@ extern "C" {
         return;
       }
 
-      if (state->status == F_fss_found_object_content_not) {
-        contents->array[contents->used].used = 0;
-      }
-
       ++objects->used;
       ++contents->used;
 
index e610b355c66a02097a8d108ff3f86e004e6fba26..6b83f2160174d66f487f11058904c79e8b878072 100644 (file)
@@ -55,27 +55,9 @@ extern "C" {
 
         if (range->start >= range->stop || range->start >= buffer.used) {
           if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
-            ++objects->used;
-
-            if (objects_quoted) {
-              ++objects_quoted->used;
-            }
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-            if (F_status_is_error(status)) return;
-
-            contents->array[contents->used++].used = 0;
-
-            if (contents_quoted) {
-              status = f_memory_array_increase(state->step_small, sizeof(uint8_t), (void **) &contents_quoted->array[contents_quoted->used].array, &contents_quoted->array[contents_quoted->used].used, &contents_quoted->array[contents_quoted->used].size);
-              if (F_status_is_error(status)) return;
-
-              contents_quoted->array[contents_quoted->used++].used = 0;
-            }
-
             state->status = F_fss_found_object_content_not;
 
-            return;
+            break;
           }
 
           if (state->status == F_data_not) return;
@@ -92,13 +74,9 @@ extern "C" {
 
         if (state->status == F_fss_found_object) {
           found_data = F_true;
-
           contents->array[contents->used].used = 0;
 
           if (contents_quoted) {
-            state->status = f_memory_array_increase(state->step_small, sizeof(uint8_t), (void **) &contents_quoted->array[contents_quoted->used].array, &contents_quoted->array[contents_quoted->used].used, &contents_quoted->array[contents_quoted->used].size);
-            if (F_status_is_error(state->status)) return;
-
             quoted_content = &contents_quoted->array[contents_quoted->used];
             quoted_content->used = 0;
           }
@@ -109,11 +87,7 @@ extern "C" {
           break;
         }
 
-        if (state->status == F_fss_found_object_content_not) {
-          found_data = F_true;
-
-          break;
-        }
+        if (state->status == F_fss_found_object_content_not) break;
 
       } while (state->status == F_fss_found_object_not);
 
@@ -147,15 +121,23 @@ extern "C" {
         return;
       }
 
+      if (state->status == F_fss_found_object_content_not) {
+        found_data = F_true;
+        contents->array[contents->used].used = 0;
+
+        status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
+        if (F_status_is_error(status)) {
+          state->status = status;
+
+          return;
+        }
+      }
+
       if (range->start >= range->stop || range->start >= buffer.used) {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (state->status == F_fss_found_object || state->status == F_fss_found_content || state->status == F_fss_found_content_not || state->status == F_fss_found_object_content_not || state->status == F_end_not_group) {
-
-          if (state->status == F_fss_found_object_content_not) {
-            contents->array[contents->used].used = 0;
-          }
-
           ++objects->used;
           ++contents->used;
 
@@ -179,10 +161,6 @@ extern "C" {
         return;
       }
 
-      if (state->status == F_fss_found_object_content_not) {
-        contents->array[contents->used].used = 0;
-      }
-
       ++objects->used;
       ++contents->used;
 
index ab2e4abd04bc3e7eb4c9374f8ff85c1ab13ec92e..c28d302ce4dda7aac7cc0178658b437283431b9f 100644 (file)
@@ -36,20 +36,9 @@ extern "C" {
 
         if (range->start >= range->stop || range->start >= buffer.used) {
           if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
-            ++objects->used;
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-            if (F_status_is_error(state->status)) {
-              state->status = status;
-
-              return;
-            }
-
-            contents->array[contents->used++].used = 0;
             state->status = F_fss_found_object_content_not;
 
-            return;
+            break;
           }
 
           if (state->status == F_data_not) return;
@@ -74,19 +63,7 @@ extern "C" {
           break;
         }
 
-        if (state->status == F_fss_found_object_content_not) {
-          found_data = F_true;
-
-          status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-          if (F_status_is_error(status)) {
-            state->status = status;
-
-            return;
-          }
-
-          break;
-        }
+        if (state->status == F_fss_found_object_content_not) break;
 
       } while (state->status == F_fss_found_object_not);
 
@@ -101,7 +78,7 @@ extern "C" {
 
         // If at least some valid object was found, then return F_okay equivalents.
         if (objects->used > initial_used) {
-          state->status = state->status == F_data_not_eos ? F_okay_eos : F_okay_stop;
+          state->status = (state->status == F_data_not_eos) ? F_okay_eos : F_okay_stop;
         }
 
         return;
@@ -111,15 +88,24 @@ extern "C" {
         return;
       }
 
+      if (state->status == F_fss_found_object_content_not) {
+        found_data = F_true;
+
+        status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
+        if (F_status_is_error(status)) {
+          state->status = status;
+
+          return;
+        }
+
+        contents->array[contents->used].used = 0;
+      }
+
       if (range->start >= range->stop || range->start >= buffer.used) {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (state->status == F_fss_found_object || state->status == F_fss_found_content || state->status == F_fss_found_content_not || state->status == F_fss_found_object_content_not) {
-
-          if (state->status == F_fss_found_object_content_not) {
-            contents->array[contents->used].used = 0;
-          }
-
           ++objects->used;
           ++contents->used;
         }
@@ -129,10 +115,6 @@ extern "C" {
         return;
       }
 
-      if (state->status == F_fss_found_object_content_not) {
-        contents->array[contents->used].used = 0;
-      }
-
       ++objects->used;
       ++contents->used;
 
index 8b900422e6e5a177760a567699a4668dda8033b4..e26a44422dfdb0c2af129d716cd79f728a8333a0 100644 (file)
@@ -16,10 +16,17 @@ extern "C" {
       }
     #endif // _di_level_2_parameter_checking_
 
+    if (!buffer.used) {
+      state->status = F_data_not;
+
+      return;
+    }
+
     f_status_t status = F_okay;
     f_number_unsigned_t initial_used = objects->used;
 
-    bool found_data = F_false;
+    // 0x1 = found data, 0x2 = found payload object.
+    uint8_t found_data = 0;
 
     do {
       state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &objects->array, &objects->used, &objects->size);
@@ -34,40 +41,18 @@ extern "C" {
         fl_fss_basic_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits, state);
         if (F_status_is_error(state->status)) return;
 
+        if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
+          found_data |= 0x2;
+        }
+
         if (range->start >= range->stop || range->start >= buffer.used) {
           if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) {
-            if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
-              state->status = F_fss_found_object_content_not;
-            }
-
-            // Returning without a "payload" is an error.
-            else {
-              state->status = F_status_set_error(F_fss_found_object_content_not);
-            }
-
-            ++objects->used;
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-            if (F_status_is_error(status)) {
-              state->status = status;
-
-              return;
-            }
-
-            contents->array[contents->used++].used = 0;
-
-            return;
-          }
+            state->status = F_fss_found_object_content_not;
 
-          // Returning without a "payload" is an error.
-          if (state->status == F_data_not) {
-            state->status = F_status_set_error(F_data_not);
-
-            return;
+            break;
           }
 
-          if (found_data) {
+          if (found_data & 0x1) {
             state->status = F_status_set_error((range->start >= buffer.used) ? F_okay_eos : F_okay_stop);
           }
           else {
@@ -78,8 +63,7 @@ extern "C" {
         }
 
         if (state->status == F_fss_found_object) {
-          found_data = F_true;
-
+          found_data |= 0x1;
           contents->array[contents->used].used = 0;
 
           if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
@@ -118,34 +102,7 @@ extern "C" {
         }
 
         if (state->status == F_fss_found_object_content_not) {
-          found_data = F_true;
-
-          status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-          if (F_status_is_error(status)) {
-            state->status = status;
-
-            return;
-          }
-
-          contents->array[contents->used].used = 0;
-
-          if (f_compare_dynamic_partial_string(f_fss_payload_s.string, buffer, f_fss_payload_s.used, objects->array[objects->used]) == F_equal_to) {
-            ++objects->used;
-
-            status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
-
-            if (F_status_is_error(status)) {
-              state->status = status;
-
-              return;
-            }
-
-            contents->array[contents->used++].used = 0;
-            state->status = F_okay;
-
-            return;
-          }
+          found_data |= 0x1;
 
           break;
         }
@@ -157,7 +114,9 @@ extern "C" {
         ++contents->used;
 
         // Returning without a "payload" is an error.
-        state->status = F_status_set_error(state->status);
+        if (!(found_data & 0x2)) {
+          state->status = F_status_set_error(state->status);
+        }
 
         return;
       }
@@ -168,7 +127,12 @@ extern "C" {
         if (objects->used > initial_used) {
 
           // Returning without a "payload" is an error.
-          state->status = (state->status == F_data_not_eos) ? F_status_set_error(F_okay_eos) : F_status_set_error(F_okay_stop);
+          if (found_data & 0x2) {
+            state->status = (state->status == F_data_not_eos) ? F_okay_eos : F_okay_stop;
+          }
+          else {
+            state->status = F_status_set_error((state->status == F_data_not_eos) ? F_okay_eos : F_okay_stop);
+          }
         }
         else {
           state->status = F_status_set_error(state->status);
@@ -181,29 +145,39 @@ extern "C" {
         return;
       }
 
+      if (state->status == F_fss_found_object_content_not) {
+        found_data |= 0x1;
+
+        status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &contents->array[contents->used].array, &contents->array[contents->used].used, &contents->array[contents->used].size);
+
+        if (F_status_is_error(status)) {
+          state->status = status;
+
+          return;
+        }
+
+        contents->array[contents->used].used = 0;
+      }
+
       if (range->start >= range->stop || range->start >= buffer.used) {
 
         // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
         if (state->status == F_fss_found_object || state->status == F_fss_found_content || state->status == F_fss_found_content_not || state->status == F_fss_found_object_content_not) {
-
-          if (state->status == F_fss_found_object_content_not) {
-            contents->array[contents->used].used = 0;
-          }
-
           ++objects->used;
           ++contents->used;
         }
 
         // Returning without a "payload" is an error.
-        state->status = F_status_set_error((range->start >= buffer.used) ? F_okay_eos : F_okay_stop);
+        if (found_data & 0x2) {
+          state->status = (range->start >= buffer.used) ? F_okay_eos : F_okay_stop;
+        }
+        else {
+          state->status = F_status_set_error((range->start >= buffer.used) ? F_okay_eos : F_okay_stop);
+        }
 
         return;
       }
 
-      if (state->status == F_fss_found_object_content_not) {
-        contents->array[contents->used].used = 0;
-      }
-
       ++objects->used;
       ++contents->used;
 
index 2ba2d64949098fb4d03a4c3bc6803d7ad515481f..2b9e42b806b41cd24a7eb61335dee3e9adba2aa2 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
  * This processes only the outermost part and specially handles the payload.
  * The inner data, such as the fss-0001 inside of the "header", should be directly processed via the appropriate function.
  *
- * The "payload" Object is required and if it is not file, this function returns with the error flag set.
+ * The "payload" Object is required and if it is not found, this function returns with the error flag set.
  *
  * @param buffer
  *   The buffer to read from.
@@ -72,11 +72,9 @@ extern "C" {
  *     F_data_not_stop no data to read due start location being greater than stop location.
  *
  *     F_fss_found_object_content_not (with error bit) When payload Content is missing.
- *     F_data_not_eos (with error bit) no data to read due start location being greater than or equal to buffer size, except that no "payload" is found.
- *     F_data_not_stop (with error bit) no data to read due start location being greater than stop location, except that no "payload" is found.
  *     F_okay (with error bit) on success, except that no "payload" is found.
- *     F_okay_eos (with error bit) on success after reaching the end of the buffer, except that no "payload" is found.
- *     F_okay_stop (with error bit) on success after reaching stopping point, except that no "payload" is found.
+ *     F_okay_eos (with error bit) on success, but no "payload" is found and start location is now greater than or equal to buffer size.
+ *     F_okay_stop (with error bit) on success, but no "payload" is found and start location is now greater than stop location.
  *     F_number_overflow (with error bit) if the maximum buffer size is reached.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
index 14acecf715b0984d0d7b25e9433fb488a51ff958..bf351a18eb3f23e3523c93f12b7535367768a206 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_basic_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_basic_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_basic_process_help_
 
index 26c0f1f769468944dd174b67ab972b38208e777a..04dc1b33ff5408397b4328f3860e12625580a772 100644 (file)
@@ -36,15 +36,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = &fss_read_print_content_empty_set_end;
   data.callback.print_content_ignore = 0;
   data.callback.print_content_next = 0;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_basic_print_object_end;
+  data.callback.print_object_end = &fss_read_basic_print_data_object_end;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index 103dea442897b5f6cc5133ee2c28925e55e47eb4..83a5a82add468126f746648974d5c19bfed5bfb3 100644 (file)
@@ -4,8 +4,28 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_basic_print_help_
-  f_status_t fss_read_basic_print_help(fl_print_t * const print) {
+#ifndef _di_fss_read_basic_print_data_object_end_
+  f_status_t fss_read_basic_print_data_object_end(fl_print_t * const print) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+
+    if (main->setting.flag & fss_read_main_flag_content_e) {
+      if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
+        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
+      }
+      else {
+        fll_print_dynamic_raw(f_fss_basic_open_s, print->to);
+      }
+    }
+
+    return F_okay;
+  }
+#endif // _di_fss_read_basic_print_data_object_end_
+
+#ifndef _di_fss_read_basic_print_message_help_
+  f_status_t fss_read_basic_print_message_help(fl_print_t * const print) {
 
     if (!print) return F_status_set_error(F_output_not);
 
@@ -32,27 +52,7 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_basic_print_help_
-
-#ifndef _di_fss_read_basic_print_object_end_
-  f_status_t fss_read_basic_print_object_end(fl_print_t * const print) {
-
-    if (!print || !print->custom) return F_status_set_error(F_output_not);
-
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    if (main->setting.flag & fss_read_main_flag_content_e) {
-      if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
-        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-      }
-      else {
-        fll_print_dynamic_raw(f_fss_basic_open_s, print->to);
-      }
-    }
-
-    return F_okay;
-  }
-#endif // _di_fss_read_basic_print_object_end_
+#endif // _di_fss_read_basic_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index c3e793285e60d8e3dcf87809cc573da65ae99f6c..e738351605afa3fd6689d7b938ca4fa161805458 100644 (file)
@@ -13,46 +13,46 @@ extern "C" {
 #endif
 
 /**
- * Print help for FSS-0000 (Basic).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see fll_print_dynamic_raw()
  */
-#ifndef _di_fss_read_basic_print_help_
-  extern f_status_t fss_read_basic_print_help(fl_print_t * const print);
-#endif // _di_fss_read_basic_print_help_
+#ifndef _di_fss_read_basic_print_data_object_end_
+  extern f_status_t fss_read_basic_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_basic_print_data_object_end_
 
 /**
- * Print the end of an Object (which is often the start of Content).
- *
- * This locks, uses, and unlocks the file stream.
+ * Print help for FSS-0000 (Basic).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see fll_print_dynamic_raw()
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_basic_print_object_end_
-  extern f_status_t fss_read_basic_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_basic_print_object_end_
+#ifndef _di_fss_read_basic_print_message_help_
+  extern f_status_t fss_read_basic_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_basic_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index 6d1f4773d1d4589f84cceae1d963da76598afad2..74dac22cdefaa71e0c7991d33748d5c0b333f68f 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_basic_list_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_basic_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_basic_list_process_help_
 
index 412e07f1cb75614a7573e59b78cd3e479ec3d7ca..d928aa80fcbd6d3fab0cff659bbdbbd56f4a6c78 100644 (file)
@@ -35,15 +35,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = 0;
   data.callback.print_content_ignore = &fss_read_print_content_ignore;
   data.callback.print_content_next = 0;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_basic_list_print_object_end;
+  data.callback.print_object_end = &fss_read_basic_list_print_data_object_end;
   data.callback.print_set_end = &fss_read_print_set_end_no_eol;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index 9e89e2dbcdc49cea86550f0c273716bad8634a60..9d55d95511c5f970f48773e57913e8c847f7800d 100644 (file)
@@ -4,8 +4,36 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_basic_list_print_help_
-  f_status_t fss_read_basic_list_print_help(fl_print_t * const print) {
+#ifndef _di_fss_read_basic_list_print_data_object_end_
+  f_status_t fss_read_basic_list_print_data_object_end(fl_print_t * const print) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+
+    f_file_stream_lock(print->to);
+
+    if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
+      f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
+    }
+    else {
+      if (main->setting.flag & fss_read_main_flag_content_e) {
+        f_print_dynamic_raw(f_fss_basic_list_open_s, print->to);
+        f_print_dynamic_raw(f_fss_basic_list_open_end_s, print->to);
+      }
+      else {
+        f_print_dynamic_raw(f_fss_eol_s, print->to);
+      }
+    }
+
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_basic_list_print_data_object_end_
+
+#ifndef _di_fss_read_basic_list_print_message_help_
+  f_status_t fss_read_basic_list_print_message_help(fl_print_t * const print) {
 
     if (!print) return F_status_set_error(F_output_not);
 
@@ -32,35 +60,7 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_basic_list_print_help_
-
-#ifndef _di_fss_read_basic_list_print_object_end_
-  f_status_t fss_read_basic_list_print_object_end(fl_print_t * const print) {
-
-    if (!print || !print->custom) return F_status_set_error(F_output_not);
-
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    f_file_stream_lock(print->to);
-
-    if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
-      f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-    }
-    else {
-      if (main->setting.flag & fss_read_main_flag_content_e) {
-        f_print_dynamic_raw(f_fss_basic_list_open_s, print->to);
-        f_print_dynamic_raw(f_fss_basic_list_open_end_s, print->to);
-      }
-      else {
-        f_print_dynamic_raw(f_fss_eol_s, print->to);
-      }
-    }
-
-    f_file_stream_unlock(print->to);
-
-    return F_okay;
-  }
-#endif // _di_fss_read_basic_list_print_object_end_
+#endif // _di_fss_read_basic_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index 029055ebb4c275f33367749af9a224e03c0d3a35..2a7ffa93599a156211791d5c748c9b870592421c 100644 (file)
@@ -13,48 +13,48 @@ extern "C" {
 #endif
 
 /**
- * Print help for FSS-0002 (Basic List).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see f_print_dynamic_raw()
  */
-#ifndef _di_fss_read_basic_list_print_help_
-  extern f_status_t fss_read_basic_list_print_help(fl_print_t * const print);
-#endif // _di_fss_read_basic_list_print_help_
+#ifndef _di_fss_read_basic_list_print_data_object_end_
+  extern f_status_t fss_read_basic_list_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_basic_list_print_data_object_end_
 
 /**
- * Print the end of an Object (which is often the start of Content).
- *
- * This locks, uses, and unlocks the file stream.
+ * Print help for FSS-0002 (Basic List).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_basic_list_print_object_end_
-  extern f_status_t fss_read_basic_list_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_basic_list_print_object_end_
+#ifndef _di_fss_read_basic_list_print_message_help_
+  extern f_status_t fss_read_basic_list_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_basic_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index 326d306661f48e250759fbf6012f52dfd3431cf4..34a8d86517537d837804b510a56eda3b9775f5ea 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_embedded_list_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_embedded_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_embedded_list_process_help_
 
index 5f8e32362828f24a859185998607b0fc4435e80a..c1ff6f2c22516490b9cbb2200d4d593a83b8f939 100644 (file)
@@ -36,15 +36,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = 0;
   data.callback.print_content_ignore = &fss_read_print_content_ignore;
   data.callback.print_content_next = 0;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_embedded_list_print_object_end;
+  data.callback.print_object_end = &fss_read_embedded_list_print_data_object_end;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index bdf29b50d665298f725005452ca2fcd345d7e5b8..3e1f7a8a757f63be7addb6b5a6359782496a9765 100644 (file)
@@ -4,38 +4,8 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_embedded_list_print_help_
-  f_status_t fss_read_embedded_list_print_help(fl_print_t * const print) {
-
-    if (!print) return F_status_set_error(F_output_not);
-
-    f_file_stream_lock(print->to);
-
-    fll_program_print_help_header(print, fss_read_embedded_list_program_name_long_s, fss_read_program_version_s);
-
-    fss_read_print_message_help(print);
-
-    f_print_dynamic_raw(f_string_eol_s, print->to);
-
-    fll_program_print_help_usage(print, fss_read_embedded_list_program_name_s, f_string_empty_s);
-
-    f_print_dynamic_raw(f_string_eol_s, print->to);
-
-    fss_read_print_message_help_note_header(print, fss_read_format_code_short_0008_s, fss_read_format_code_name_0008_s);
-
-    fss_read_print_message_help_pipe(print);
-
-    fss_read_print_message_help_note(print, F_true);
-
-    f_file_stream_flush(print->to);
-    f_file_stream_unlock(print->to);
-
-    return F_okay;
-  }
-#endif // _di_fss_read_embedded_list_print_help_
-
-#ifndef _di_fss_read_embedded_list_print_object_end_
-  f_status_t fss_read_embedded_list_print_object_end(fl_print_t * const print) {
+#ifndef _di_fss_read_embedded_list_print_data_object_end_
+  f_status_t fss_read_embedded_list_print_data_object_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -60,10 +30,10 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_embedded_list_print_object_end_
+#endif // _di_fss_read_embedded_list_print_data_object_end_
 
-#ifndef _di_fss_read_embedded_list_print_set_end_
-  f_status_t fss_read_embedded_list_print_set_end(fl_print_t * const print) {
+#ifndef _di_fss_read_embedded_list_print_data_set_end_
+  f_status_t fss_read_embedded_list_print_data_set_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -76,7 +46,37 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_embedded_list_print_set_end_
+#endif // _di_fss_read_embedded_list_print_data_set_end_
+
+#ifndef _di_fss_read_embedded_list_print_message_help_
+  f_status_t fss_read_embedded_list_print_message_help(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
+
+    f_file_stream_lock(print->to);
+
+    fll_program_print_help_header(print, fss_read_embedded_list_program_name_long_s, fss_read_program_version_s);
+
+    fss_read_print_message_help(print);
+
+    f_print_dynamic_raw(f_string_eol_s, print->to);
+
+    fll_program_print_help_usage(print, fss_read_embedded_list_program_name_s, f_string_empty_s);
+
+    f_print_dynamic_raw(f_string_eol_s, print->to);
+
+    fss_read_print_message_help_note_header(print, fss_read_format_code_short_0008_s, fss_read_format_code_name_0008_s);
+
+    fss_read_print_message_help_pipe(print);
+
+    fss_read_print_message_help_note(print, F_true);
+
+    f_file_stream_flush(print->to);
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_embedded_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index 4c62c4d465cc237ffa77f02264c0a4f47b64b99e..3afa41c21c26b563155c0022352f4679052d6156 100644 (file)
@@ -13,25 +13,33 @@ extern "C" {
 #endif
 
 /**
- * Print help for FSS-0008 (Embedded List).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see f_print_dynamic_raw()
  */
-#ifndef _di_fss_read_embedded_list_print_help_
-  extern f_status_t fss_read_embedded_list_print_help(fl_print_t * const print);
-#endif // _di_fss_read_embedded_list_print_help_
+#ifndef _di_fss_read_embedded_list_print_data_object_end_
+  extern f_status_t fss_read_embedded_list_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_embedded_list_print_data_object_end_
 
 /**
- * Print the end of an Object (which is often the start of Content).
+ * Print the end of an Object/Content set.
  *
  * This locks, uses, and unlocks the file stream.
  *
@@ -52,35 +60,27 @@ extern "C" {
  * @see f_file_stream_unlock()
  * @see f_print_dynamic_raw()
  */
-#ifndef _di_fss_read_embedded_list_print_object_end_
-  extern f_status_t fss_read_embedded_list_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_embedded_list_print_object_end_
+#ifndef _di_fss_read_embedded_list_print_data_set_end_
+  extern f_status_t fss_read_embedded_list_print_data_set_end(fl_print_t * const print);
+#endif // _di_fss_read_embedded_list_print_data_set_end_
 
 /**
- * Print the end of an Object/Content set.
- *
- * This locks, uses, and unlocks the file stream.
+ * Print help for FSS-0008 (Embedded List).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_embedded_list_print_set_end_
-  extern f_status_t fss_read_embedded_list_print_set_end(fl_print_t * const print);
-#endif // _di_fss_read_embedded_list_print_set_end_
+#ifndef _di_fss_read_embedded_list_print_message_help_
+  extern f_status_t fss_read_embedded_list_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_embedded_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index 213add14427655aa5f4c4ace3c3a587daba8c192..f78ef74799b93187882d01329a9d2080bcf069b6 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_extended_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_extended_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_extended_process_help_
 
index 5cf0ed409b3b35894d38e235f9ca6cc959893f08..44940b586482d01e38e74aa53753b642c0b08371 100644 (file)
@@ -36,15 +36,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = &fss_read_print_content_empty_set_end;
   data.callback.print_content_ignore = &fss_read_print_content_ignore;
-  data.callback.print_content_next = &fss_read_extended_print_content_next;
+  data.callback.print_content_next = &fss_read_extended_print_data_content_next;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_extended_print_object_end;
+  data.callback.print_object_end = &fss_read_extended_print_data_object_end;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index 9cec070736fbecef3921b470187a5d6aff446c01..5236b9cc5ce49aeb5973c60cfb8bf4eae18578b2 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_extended_print_content_next_
-  f_status_t fss_read_extended_print_content_next(fl_print_t * const print) {
+#ifndef _di_fss_read_extended_print_data_content_next_
+  f_status_t fss_read_extended_print_data_content_next(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -17,10 +17,30 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_print_content_next_
+#endif // _di_fss_read_extended_print_data_content_next_
 
-#ifndef _di_fss_read_extended_print_help_
-  f_status_t fss_read_extended_print_help(fl_print_t * const print) {
+#ifndef _di_fss_read_extended_print_data_object_end_
+  f_status_t fss_read_extended_print_data_object_end(fl_print_t * const print) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+
+    if (main->setting.flag & fss_read_main_flag_content_e) {
+      if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
+        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
+      }
+      else {
+        fll_print_dynamic_raw(f_fss_extended_open_s, print->to);
+      }
+    }
+
+    return F_okay;
+  }
+#endif // _di_fss_read_extended_print_data_object_end_
+
+#ifndef _di_fss_read_extended_print_message_help_
+  f_status_t fss_read_extended_print_message_help(fl_print_t * const print) {
 
     if (!print) return F_status_set_error(F_output_not);
 
@@ -47,27 +67,7 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_print_help_
-
-#ifndef _di_fss_read_extended_print_object_end_
-  f_status_t fss_read_extended_print_object_end(fl_print_t * const print) {
-
-    if (!print || !print->custom) return F_status_set_error(F_output_not);
-
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    if (main->setting.flag & fss_read_main_flag_content_e) {
-      if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
-        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-      }
-      else {
-        fll_print_dynamic_raw(f_fss_extended_open_s, print->to);
-      }
-    }
-
-    return F_okay;
-  }
-#endif // _di_fss_read_extended_print_object_end_
+#endif // _di_fss_read_extended_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index f8b10a25c8a52363214b7394a06baf83c93deab1..e9b5197a6db660d3eff19c49bfcc2b0d02f38834 100644 (file)
@@ -34,51 +34,51 @@ extern "C" {
  *
  * @see fll_print_dynamic_raw()
  */
-#ifndef _di_fss_read_extended_print_content_next_
-  extern f_status_t fss_read_extended_print_content_next(fl_print_t * const print);
-#endif // _di_fss_read_extended_print_content_next_
+#ifndef _di_fss_read_extended_print_data_content_next_
+  extern f_status_t fss_read_extended_print_data_content_next(fl_print_t * const print);
+#endif // _di_fss_read_extended_print_data_content_next_
 
 /**
- * Print help for FSS-0001 (Extended).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see fll_print_dynamic_raw()
  */
-#ifndef _di_fss_read_extended_print_help_
-  extern f_status_t fss_read_extended_print_help(fl_print_t * const print);
-#endif // _di_fss_read_extended_print_help_
+#ifndef _di_fss_read_extended_print_data_object_end_
+  extern f_status_t fss_read_extended_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_extended_print_data_object_end_
 
 /**
- * Print the end of an Object (which is often the start of Content).
- *
- * This locks, uses, and unlocks the file stream.
+ * Print help for FSS-0001 (Extended).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see fll_print_dynamic_raw()
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_extended_print_object_end_
-  extern f_status_t fss_read_extended_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_extended_print_object_end_
+#ifndef _di_fss_read_extended_print_message_help_
+  extern f_status_t fss_read_extended_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_extended_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index adb75b25f25ba728ad016bc0a99b0bc704c8f14d..825187ce518182ee3130f09d6936a8a130df8440 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_extended_list_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_extended_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_extended_list_process_help_
 
index c6d3929f60399d2b1e92c08c6137690d7fd58669..eafebe00b94c127d2ad8a1168a1ec242073a90b2 100644 (file)
@@ -35,15 +35,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = 0;
   data.callback.print_content_ignore = &fss_read_print_content_ignore;
   data.callback.print_content_next = 0;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_extended_list_print_object_end;
-  data.callback.print_set_end = &fss_read_extended_list_print_set_end;
+  data.callback.print_object_end = &fss_read_extended_list_print_data_object_end;
+  data.callback.print_set_end = &fss_read_extended_list_print_data_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index f3c2fc08db18f43f95e249d6a3c048c8ff3e648b..ccf2afd45d357e0f927d43a2751747789a8136f9 100644 (file)
@@ -4,38 +4,8 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_extended_list_print_help_
-  f_status_t fss_read_extended_list_print_help(fl_print_t * const print) {
-
-    if (!print) return F_status_set_error(F_output_not);
-
-    f_file_stream_lock(print->to);
-
-    fll_program_print_help_header(print, fss_read_extended_list_program_name_long_s, fss_read_program_version_s);
-
-    fss_read_print_message_help(print);
-
-    f_print_dynamic_raw(f_string_eol_s, print->to);
-
-    fll_program_print_help_usage(print, fss_read_extended_list_program_name_s, f_string_empty_s);
-
-    f_print_dynamic_raw(f_string_eol_s, print->to);
-
-    fss_read_print_message_help_note_header(print, fss_read_format_code_short_0003_s, fss_read_format_code_name_0003_s);
-
-    fss_read_print_message_help_pipe(print);
-
-    fss_read_print_message_help_note(print, F_true);
-
-    f_file_stream_flush(print->to);
-    f_file_stream_unlock(print->to);
-
-    return F_okay;
-  }
-#endif // _di_fss_read_extended_list_print_help_
-
-#ifndef _di_fss_read_extended_list_print_object_end_
-  f_status_t fss_read_extended_list_print_object_end(fl_print_t * const print) {
+#ifndef _di_fss_read_extended_list_print_data_object_end_
+  f_status_t fss_read_extended_list_print_data_object_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -60,10 +30,10 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_list_print_object_end_
+#endif // _di_fss_read_extended_list_print_data_object_end_
 
-#ifndef _di_fss_read_extended_list_print_set_end_
-  f_status_t fss_read_extended_list_print_set_end(fl_print_t * const print) {
+#ifndef _di_fss_read_extended_list_print_data_set_end_
+  f_status_t fss_read_extended_list_print_data_set_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -76,7 +46,37 @@ extern "C" {
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_list_print_set_end_
+#endif // _di_fss_read_extended_list_print_data_set_end_
+
+#ifndef _di_fss_read_extended_list_print_message_help_
+  f_status_t fss_read_extended_list_print_message_help(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
+
+    f_file_stream_lock(print->to);
+
+    fll_program_print_help_header(print, fss_read_extended_list_program_name_long_s, fss_read_program_version_s);
+
+    fss_read_print_message_help(print);
+
+    f_print_dynamic_raw(f_string_eol_s, print->to);
+
+    fll_program_print_help_usage(print, fss_read_extended_list_program_name_s, f_string_empty_s);
+
+    f_print_dynamic_raw(f_string_eol_s, print->to);
+
+    fss_read_print_message_help_note_header(print, fss_read_format_code_short_0003_s, fss_read_format_code_name_0003_s);
+
+    fss_read_print_message_help_pipe(print);
+
+    fss_read_print_message_help_note(print, F_true);
+
+    f_file_stream_flush(print->to);
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_extended_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index bb30dc03a52083e6e05dfd9889fd785737ced75b..8aa3b0dad18630cb4bcc9e6832829bc0b2547db0 100644 (file)
@@ -13,25 +13,31 @@ extern "C" {
 #endif
 
 /**
- * Print help for FSS-0003 (Extended List).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see fll_print_dynamic_raw()
  */
-#ifndef _di_fss_read_extended_list_print_help_
-  extern f_status_t fss_read_extended_list_print_help(fl_print_t * const print);
-#endif // _di_fss_read_extended_list_print_help_
+#ifndef _di_fss_read_extended_list_print_data_object_end_
+  extern f_status_t fss_read_extended_list_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_extended_list_print_data_object_end_
 
 /**
- * Print the end of an Object (which is often the start of Content).
+ * Print the end of an Object/Content set.
  *
  * This locks, uses, and unlocks the file stream.
  *
@@ -48,37 +54,31 @@ extern "C" {
  *
  *   F_output_not (with error bit) if a parameter is NULL.
  *
- * @see fll_print_dynamic_raw()
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see f_print_dynamic_raw()
  */
-#ifndef _di_fss_read_extended_list_print_object_end_
-  extern f_status_t fss_read_extended_list_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_extended_list_print_object_end_
+#ifndef _di_fss_read_extended_list_print_data_set_end_
+  extern f_status_t fss_read_extended_list_print_data_set_end(fl_print_t * const print);
+#endif // _di_fss_read_extended_list_print_data_set_end_
 
 /**
- * Print the end of an Object/Content set.
- *
- * This locks, uses, and unlocks the file stream.
+ * Print help for FSS-0003 (Extended List).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
- *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_extended_list_print_set_end_
-  extern f_status_t fss_read_extended_list_print_set_end(fl_print_t * const print);
-#endif // _di_fss_read_extended_list_print_set_end_
+#ifndef _di_fss_read_extended_list_print_message_help_
+  extern f_status_t fss_read_extended_list_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_extended_list_print_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index cd4862cddcebfa070fc1dd9cb63cf2f7a4934f1f..8a410c7e7b80a672da6c160a09f5627e84dc4c81 100644 (file)
@@ -316,7 +316,7 @@ extern "C" {
           return;
         }
 
-        if (f_compare_dynamic(fss_read_delimit_mode_name_none_s, parameters->arguments.array[index]) == F_equal_to) {
+        if (f_compare_dynamic(fss_read_string_none_s, parameters->arguments.array[index]) == F_equal_to) {
           main->setting.delimit_mode = fss_read_delimit_mode_none_e;
         }
         else if (f_compare_dynamic(fss_read_delimit_mode_name_all_s, parameters->arguments.array[index]) == F_equal_to) {
index 59695bad5c2d7b1236f94ad46a3af1d820daec9f..5bd7227850214e63723d752bb024396373a953cf 100644 (file)
@@ -39,6 +39,9 @@ extern "C" {
  *   - object_as_line:    The Object is counted as its own line for the purpose of -l/--line or any other similar behavior.
  *   - object_trim:       Empty space before an after Objects are ignored while processing without affecting printing behavior.
  *   - original:          Enable original printing, where the quotes are printed and no delimits are applied.
+ *   - payload_create:    Create the payload Object with empty Content if the payload Object is missing (when using FSS Payload and related).
+ *   - payload_error:     Treat missing or invalid payload as an error (when using FSS Payload and related).
+ *   - payload_warn:      Treat missing or invalid payload as a warning (when using FSS Payload and related).
  *   - pipe:              Use the input pipe.
  *   - pipe_format:       Print using the special pipe format.
  *   - print_first:       When set, print new line to message output on program begin after loading settings.
@@ -72,17 +75,20 @@ extern "C" {
     fss_read_main_flag_object_as_line_e    = 0x8000,
     fss_read_main_flag_object_trim_e       = 0x10000,
     fss_read_main_flag_original_e          = 0x20000,
-    fss_read_main_flag_pipe_e              = 0x40000,
-    fss_read_main_flag_pipe_format_e       = 0x80000,
-    fss_read_main_flag_print_first_e       = 0x100000,
-    fss_read_main_flag_print_last_e        = 0x200000,
-    fss_read_main_flag_quote_content_e     = 0x400000,
-    fss_read_main_flag_quote_object_e      = 0x800000,
-    fss_read_main_flag_select_e            = 0x1000000,
-    fss_read_main_flag_total_e             = 0x2000000,
-    fss_read_main_flag_trim_e              = 0x4000000,
-    fss_read_main_flag_trim_object_e       = 0x8000000,
-    fss_read_main_flag_version_e           = 0x10000000,
+    fss_read_main_flag_payload_create_e    = 0x40000,
+    fss_read_main_flag_payload_error_e     = 0x80000,
+    fss_read_main_flag_payload_warn_e      = 0x100000,
+    fss_read_main_flag_pipe_e              = 0x200000,
+    fss_read_main_flag_pipe_format_e       = 0x400000,
+    fss_read_main_flag_print_first_e       = 0x800000,
+    fss_read_main_flag_print_last_e        = 0x1000000,
+    fss_read_main_flag_quote_content_e     = 0x2000000,
+    fss_read_main_flag_quote_object_e      = 0x4000000,
+    fss_read_main_flag_select_e            = 0x8000000,
+    fss_read_main_flag_total_e             = 0x10000000,
+    fss_read_main_flag_trim_e              = 0x20000000,
+    fss_read_main_flag_trim_object_e       = 0x40000000,
+    fss_read_main_flag_version_e           = 0x80000000,
   }; // enum
 #endif // _di_fss_read_main_flag_e_
 
@@ -101,6 +107,7 @@ extern "C" {
     fss_read_parameter_line_e,
     fss_read_parameter_name_e,
     fss_read_parameter_object_e,
+    fss_read_parameter_payload_e,
     fss_read_parameter_pipe_e,
     fss_read_parameter_original_e,
     fss_read_parameter_select_e,
@@ -112,7 +119,7 @@ extern "C" {
     { \
       macro_fll_program_console_parameter_standard_initialize, \
       \
-      macro_f_console_parameter_t_initialize_3(fss_read_short_as_s,       fss_read_long_as_s,       1, f_console_flag_normal_e), \
+      macro_f_console_parameter_t_initialize_3(fss_read_short_as_s,       fss_read_long_as_s,       1, f_console_flag_normal_e | f_console_flag_disable_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_at_s,       fss_read_long_at_s,       1, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_content_s,  fss_read_long_content_s,  0, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_columns_s,  fss_read_long_columns_s,  0, f_console_flag_normal_e), \
@@ -122,6 +129,7 @@ extern "C" {
       macro_f_console_parameter_t_initialize_3(fss_read_short_line_s,     fss_read_long_line_s,     1, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_name_s,     fss_read_long_name_s,     1, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_object_s,   fss_read_long_object_s,   0, f_console_flag_normal_e), \
+      macro_f_console_parameter_t_initialize_5(                           fss_read_long_payload_s,  1, f_console_flag_normal_e | f_console_flag_disable_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_pipe_s,     fss_read_long_pipe_s,     0, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_original_s, fss_read_long_original_s, 0, f_console_flag_normal_e), \
       macro_f_console_parameter_t_initialize_3(fss_read_short_select_s,   fss_read_long_select_s,   1, f_console_flag_normal_e), \
@@ -129,7 +137,7 @@ extern "C" {
       macro_f_console_parameter_t_initialize_3(fss_read_short_trim_s,     fss_read_long_trim_s,     0, f_console_flag_normal_e), \
     }
 
-  #define fss_read_parameter_total_d 28
+  #define fss_read_parameter_total_d 29
 #endif // _di_fss_read_parameter_e_
 
 /**
index befaa415929e41bd10c77d2bdd16428ab952834f..c43a7aeacd319cc23b8df8273e9c1be8fb20c0d5 100644 (file)
@@ -7,6 +7,7 @@ extern "C" {
 #ifndef _di_fss_read_f_a_
   const f_string_t fss_read_f_a[] = {
     "f_console_parameter_process",
+    "f_console_parameter_reset",
     "f_file_read_block",
     "f_file_size",
     "f_file_stream_open",
index 12aad9eb59d29509c3e5303097109a77f4fc2994..92e393268ba5723d6346c5fae3258e7f216dba9c 100644 (file)
@@ -40,6 +40,7 @@ extern "C" {
 #ifndef _di_fss_read_f_e_
   enum {
     fss_read_f_f_console_parameter_process_e,
+    fss_read_f_f_console_parameter_reset_e,
     fss_read_f_f_file_read_block_e,
     fss_read_f_f_file_size_e,
     fss_read_f_f_file_stream_open_e,
index 987a8960dc9cce116f20a866de97621f087e0c07..80bf4b53963b157f410fcff39bc9483ca1c9fe47 100644 (file)
@@ -20,11 +20,14 @@ extern "C" {
 #endif // _di_fss_read_pipe_s_
 
 #ifndef _di_fss_read_s_
+  const f_string_static_t fss_read_string_create_s = macro_f_string_static_t_initialize_1(FSS_READ_string_create_s, 0, FSS_READ_string_create_s_length);
+  const f_string_static_t fss_read_string_error_s = macro_f_string_static_t_initialize_1(FSS_READ_string_error_s, 0, FSS_READ_string_error_s_length);
+  const f_string_static_t fss_read_string_none_s = macro_f_string_static_t_initialize_1(FSS_READ_string_none_s, 0, FSS_READ_string_none_s_length);
   const f_string_static_t fss_read_string_two_s = macro_f_string_static_t_initialize_1(FSS_READ_string_two_s, 0, FSS_READ_string_two_s_length);
+  const f_string_static_t fss_read_string_warn_s = macro_f_string_static_t_initialize_1(FSS_READ_string_warn_s, 0, FSS_READ_string_warn_s_length);
 #endif // _di_fss_read_s_
 
 #ifndef _di_fss_read_delimit_mode_s_
-  const f_string_static_t fss_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize_1(FSS_READ_delimit_mode_name_none_s, 0, FSS_READ_delimit_mode_name_none_s_length);
   const f_string_static_t fss_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize_1(FSS_READ_delimit_mode_name_all_s, 0, FSS_READ_delimit_mode_name_all_s_length);
   const f_string_static_t fss_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize_1(FSS_READ_delimit_mode_name_object_s, 0, FSS_READ_delimit_mode_name_object_s_length);
   const f_string_static_t fss_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize_1(FSS_READ_delimit_mode_name_greater_s, 0, FSS_READ_delimit_mode_name_greater_s_length);
@@ -58,6 +61,7 @@ extern "C" {
   const f_string_static_t fss_read_long_line_s = macro_f_string_static_t_initialize_1(FSS_READ_long_line_s, 0, FSS_READ_long_line_s_length);
   const f_string_static_t fss_read_long_name_s = macro_f_string_static_t_initialize_1(FSS_READ_long_name_s, 0, FSS_READ_long_name_s_length);
   const f_string_static_t fss_read_long_object_s = macro_f_string_static_t_initialize_1(FSS_READ_long_object_s, 0, FSS_READ_long_object_s_length);
+  const f_string_static_t fss_read_long_payload_s = macro_f_string_static_t_initialize_1(FSS_READ_long_payload_s, 0, FSS_READ_long_payload_s_length);
   const f_string_static_t fss_read_long_pipe_s = macro_f_string_static_t_initialize_1(FSS_READ_long_pipe_s, 0, FSS_READ_long_pipe_s_length);
   const f_string_static_t fss_read_long_original_s = macro_f_string_static_t_initialize_1(FSS_READ_long_original_s, 0, FSS_READ_long_original_s_length);
   const f_string_static_t fss_read_long_select_s = macro_f_string_static_t_initialize_1(FSS_READ_long_select_s, 0, FSS_READ_long_select_s_length);
index 154ea9a7324acd2388b8ba69df922729fc7ae8d0..e265147844cd95a31691069a1209701e67eff6a1 100644 (file)
@@ -92,11 +92,23 @@ extern "C" {
  * A collection of static strings associated with FSS Read.
  */
 #ifndef _di_fss_read_s_
-  #define FSS_READ_string_two_s "two"
-
-  #define FSS_READ_string_two_s_length 3
-
+  #define FSS_READ_string_create_s "create"
+  #define FSS_READ_string_error_s  "error"
+  #define FSS_READ_string_none_s   "none"
+  #define FSS_READ_string_two_s    "two"
+  #define FSS_READ_string_warn_s   "warn"
+
+  #define FSS_READ_string_create_s_length 6
+  #define FSS_READ_string_error_s_length  5
+  #define FSS_READ_string_none_s_length   4
+  #define FSS_READ_string_two_s_length    3
+  #define FSS_READ_string_warn_s_length   4
+
+  extern const f_string_static_t fss_read_string_create_s;
+  extern const f_string_static_t fss_read_string_error_s;
+  extern const f_string_static_t fss_read_string_none_s;
   extern const f_string_static_t fss_read_string_two_s;
+  extern const f_string_static_t fss_read_string_warn_s;
 #endif // _di_fss_read_s_
 
 /**
@@ -113,19 +125,16 @@ extern "C" {
  *   - object:                 Objects arre to have delimits applied.
  */
 #ifndef _di_fss_read_delimit_mode_s_
-  #define FSS_READ_delimit_mode_name_none_s    "none"
   #define FSS_READ_delimit_mode_name_all_s     "all"
   #define FSS_READ_delimit_mode_name_object_s  "object"
   #define FSS_READ_delimit_mode_name_greater_s "+"
   #define FSS_READ_delimit_mode_name_lesser_s  "-"
 
-  #define FSS_READ_delimit_mode_name_none_s_length    4
   #define FSS_READ_delimit_mode_name_all_s_length     3
   #define FSS_READ_delimit_mode_name_object_s_length  6
   #define FSS_READ_delimit_mode_name_greater_s_length 1
   #define FSS_READ_delimit_mode_name_lesser_s_length  1
 
-  extern const f_string_static_t fss_read_delimit_mode_name_none_s;
   extern const f_string_static_t fss_read_delimit_mode_name_all_s;
   extern const f_string_static_t fss_read_delimit_mode_name_object_s;
   extern const f_string_static_t fss_read_delimit_mode_name_greater_s;
@@ -162,6 +171,7 @@ extern "C" {
   #define FSS_READ_long_line_s     "line"
   #define FSS_READ_long_name_s     "name"
   #define FSS_READ_long_object_s   "object"
+  #define FSS_READ_long_payload_s  "payload"
   #define FSS_READ_long_pipe_s     "pipe"
   #define FSS_READ_long_original_s "original"
   #define FSS_READ_long_select_s   "select"
@@ -194,6 +204,7 @@ extern "C" {
   #define FSS_READ_long_line_s_length     4
   #define FSS_READ_long_name_s_length     4
   #define FSS_READ_long_object_s_length   6
+  #define FSS_READ_long_payload_s_length  7
   #define FSS_READ_long_pipe_s_length     4
   #define FSS_READ_long_original_s_length 8
   #define FSS_READ_long_select_s_length   6
@@ -226,6 +237,7 @@ extern "C" {
   extern const f_string_static_t fss_read_long_line_s;
   extern const f_string_static_t fss_read_long_name_s;
   extern const f_string_static_t fss_read_long_object_s;
+  extern const f_string_static_t fss_read_long_payload_s;
   extern const f_string_static_t fss_read_long_pipe_s;
   extern const f_string_static_t fss_read_long_original_s;
   extern const f_string_static_t fss_read_long_select_s;
index c31643cea8114a5f5fdcaade2576372afd173c00..3fe6b37b3c28fe08103013d3593c2f849aaa850f 100644 (file)
@@ -128,13 +128,15 @@ extern "C" {
  * process_name:    Process name parameter, usually called by the process_normal() callback.
  * process_total:   Process total parameter, usually called by the process_normal() callback.
  *
- * print_at:             Print at the given location, usually called by the process_normal() callback.
- * print_object:         Print the Object, usually called by the process_normal() callback.
- * print_content:        Print the Content, usually called by the process_normal() callback.
- * print_content_ignore: Print the Content ignore character, usually called by several callbacks within the process_normal() callback for a pipe.
- * print_content_next:   Print the Content next (content separator), usually called by several callbacks within the process_normal() callback.
- * print_object_end:     Print the Object end, usually called by several callbacks within the process_normal() callback.
- * print_set_end:        Print the Content set end, usually called by several callbacks within the process_normal() callback.
+ * print_at:                Print at the given location, usually called by the process_normal() callback.
+ * print_object:            Print the Object, usually called by the process_normal() callback.
+ * print_content:           Print the Content, usually called by the process_normal() callback.
+ * print_content_empty:     Print something when the individual Content is empty (this is not about the Content set).
+ * print_content_empty_set: Print something when the entire Content set is empty for the entire Content set.
+ * print_content_ignore:    Print the Content ignore character, usually called by several callbacks within the process_normal() callback for a pipe.
+ * print_content_next:      Print the Content next (content separator), usually called by several callbacks within the process_normal() callback.
+ * print_object_end:        Print the Object end, usually called by several callbacks within the process_normal() callback.
+ * print_set_end:           Print the Content set end, usually called by several callbacks within the process_normal() callback.
  */
 #ifndef _di_fss_read_callback_t_
   typedef struct {
@@ -152,6 +154,8 @@ extern "C" {
     f_status_t (*print_at)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
     f_status_t (*print_object)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits);
     f_status_t (*print_content)(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+    //f_status_t (*print_content_empty)(fl_print_t * const print);
+    f_status_t (*print_content_empty_set)(fl_print_t * const print);
     f_status_t (*print_content_ignore)(fl_print_t * const print);
     f_status_t (*print_content_next)(fl_print_t * const print);
     f_status_t (*print_object_end)(fl_print_t * const print);
@@ -176,6 +180,7 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
     }
 #endif // _di_fss_read_callback_t_
 
index 059405435708a10701b3876fce33b9192f19bdf3..ce7fecebc401dbb3c38360effa1842e41bd6753e 100644 (file)
@@ -28,6 +28,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
+  data.program.parameters.array[fss_read_parameter_as_e].flag &= ~f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
@@ -87,7 +88,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
     if (!void_main) return;
 
-    fss_read_main_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_main_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_main_process_help_
 
@@ -96,6 +97,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
     if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_read_main_flag_version_e)) return;
 
+    // Use the default standard of: FSS-0000 (Basic)
     main->callback.process_help = &fss_read_main_process_help;
     main->callback.process_last_line = &fss_read_process_last_line;
     main->callback.process_normal = &fss_read_process_normal;
@@ -103,14 +105,20 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     main->callback.process_at = &fss_read_process_normal_at;
     main->callback.process_at_line = &fss_read_process_normal_at_line;
     main->callback.process_columns = &fss_read_process_normal_columns;
+    main->callback.process_load = &fss_read_basic_process_load;
     main->callback.process_name = &fss_read_process_normal_name;
+    main->callback.process_total = &fss_read_process_normal_total;
 
     main->callback.print_at = &fss_read_print_at;
     main->callback.print_content = &fss_read_print_content;
-    main->callback.print_content_ignore = &fss_read_print_content_ignore;
+    //main->callback.print_content_empty = 0;
+    main->callback.print_content_empty_set = &fss_read_print_content_empty_set_end;
+    main->callback.print_content_ignore = 0;
+    main->callback.print_content_next = 0;
     main->callback.print_object = &fss_read_print_object;
+    main->callback.print_object_end = &fss_read_basic_print_data_object_end;
+    main->callback.print_set_end = &fss_read_print_set_end;
 
-    // Setup default standard (except for process_help): FSS-0000 (Basic).
     main->setting.standard = fss_read_basic_standard_s;
 
     main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
@@ -118,201 +126,266 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
     main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
     main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+    main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+    main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
     main->setting.flag &= ~fss_read_main_flag_trim_object_e;
 
     main->setting.flag |= fss_read_main_flag_line_single_e;
     main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
 
-    main->setting.flag |= fss_read_main_flag_line_single_e;
-    main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
-
-    main->callback.process_load = &fss_read_basic_process_load;
-    main->callback.process_total = &fss_read_process_normal_total;
-
-    main->callback.print_content_next = 0;
-    main->callback.print_object_end = &fss_read_basic_print_object_end;
-    main->callback.print_set_end = &fss_read_print_set_end;
-
     if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_value_e && main->program.parameters.array[fss_read_parameter_as_e].values.used) {
+      const f_number_unsigned_t index = main->program.parameters.array[fss_read_parameter_as_e].values.array[main->program.parameters.array[fss_read_parameter_as_e].values.used - 1];
+      const f_string_static_t as = main->program.parameters.arguments.array[index];
+
+      if (f_compare_dynamic(as, fss_read_format_code_short_0000_s) == F_equal_to ||
+          f_compare_dynamic(as, fss_read_format_code_long_0000_s) == F_equal_to ||
+          f_compare_dynamic(as, fss_read_format_code_human_0000_s) == F_equal_to ||
+          f_compare_dynamic(as, fss_read_format_code_machine_0000_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_basic_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+        main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
+        main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~fss_read_main_flag_trim_object_e;
+
+        main->setting.flag |= fss_read_main_flag_line_single_e;
+        main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_basic_process_help;
+        main->callback.process_load = &fss_read_basic_process_load;
+        main->callback.process_total = &fss_read_process_normal_total;
+
+        main->callback.print_content = &fss_read_print_content;
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = &fss_read_print_content_empty_set_end;
+        main->callback.print_content_ignore = 0;
+        main->callback.print_content_next = 0;
+        main->callback.print_object = &fss_read_print_object;
+        main->callback.print_object_end = &fss_read_basic_print_data_object_end;
+        main->callback.print_set_end = &fss_read_print_set_end;
+      }
+      else if (f_compare_dynamic(as, fss_read_format_code_short_0001_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_long_0001_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_human_0001_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_machine_0001_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_extended_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+        main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
+        main->setting.flag &= ~fss_read_main_flag_object_trim_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~fss_read_main_flag_trim_object_e;
+
+        main->setting.flag |= fss_read_main_flag_line_single_e | fss_read_main_flag_content_multiple_e;
+        main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_extended_process_help;
+        main->callback.process_load = &fss_read_extended_process_load;
+        main->callback.process_total = &fss_read_process_normal_total;
+
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = &fss_read_print_content_empty_set_end;
+        main->callback.print_content_next = &fss_read_extended_print_data_content_next;
+        main->callback.print_object_end = &fss_read_extended_print_data_object_end;
+        main->callback.print_set_end = &fss_read_print_set_end;
+      }
+      else if (f_compare_dynamic(as, fss_read_format_code_short_0002_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_long_0002_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_human_0002_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_machine_0002_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_basic_list_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+        main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_line_single_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_object_e;
+
+        main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_basic_list_process_help;
+        main->callback.process_load = &fss_read_basic_list_process_load;
+        main->callback.process_total = &fss_read_process_normal_total_multiple;
+
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = 0;
+        main->callback.print_content_next = 0;
+        main->callback.print_object_end = &fss_read_basic_list_print_data_object_end;
+        main->callback.print_set_end = &fss_read_print_set_end_no_eol;
+      }
+      else if (f_compare_dynamic(as, fss_read_format_code_short_0003_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_long_0003_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_human_0003_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_machine_0003_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_extended_list_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_line_single_e;
+        main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_object_e;
+
+        main->setting.flag |= fss_read_main_flag_content_has_close_e;
+        main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_extended_list_process_help;
+        main->callback.process_load = &fss_read_extended_list_process_load;
+        main->callback.process_total = &fss_read_process_normal_total_multiple;
+
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = 0;
+        main->callback.print_content_next = 0;
+        main->callback.print_object_end = &fss_read_extended_list_print_data_object_end;
+        main->callback.print_set_end = &fss_read_extended_list_print_data_set_end;
+      }
+      else if (f_compare_dynamic(as, fss_read_format_code_short_0008_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_long_0008_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_human_0008_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_machine_0008_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_embedded_list_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+        main->setting.flag &= ~fss_read_main_flag_line_single_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_object_e;
+
+        main->setting.flag |= fss_read_main_flag_content_has_close_e | fss_read_main_flag_content_multiple_e;
+        main->setting.flag |= fss_read_main_flag_depth_multiple_e;
+        main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_embedded_list_process_help;
+        main->callback.process_load = &fss_read_embedded_list_process_load;
+        main->callback.process_total = &fss_read_process_normal_total_multiple;
+
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = 0;
+        main->callback.print_content_next = 0;
+        main->callback.print_object_end = &fss_read_embedded_list_print_data_object_end;
+        main->callback.print_set_end = &fss_read_embedded_list_print_data_set_end;
+      }
+      else if (f_compare_dynamic(as, fss_read_format_code_short_000e_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_long_000e_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_human_000e_s) == F_equal_to ||
+               f_compare_dynamic(as, fss_read_format_code_machine_000e_s) == F_equal_to) {
+
+        main->setting.standard = fss_read_payload_standard_s;
+
+        // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
+        main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
+        main->setting.flag &= ~fss_read_main_flag_line_single_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_content_e;
+        main->setting.flag &= ~fss_read_main_flag_quote_object_e;
+
+        main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
+        main->setting.flag |= fss_read_main_flag_payload_error_e;
+
+        main->program.parameters.array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e;
+
+        main->callback.process_help = &fss_read_payload_process_help;
+        main->callback.process_load = &fss_read_payload_process_load;
+        main->callback.process_total = &fss_read_process_normal_total_multiple;
+
+        //main->callback.print_content_empty = 0;
+        main->callback.print_content_empty_set = 0;
+        main->callback.print_content_next = 0;
+        main->callback.print_object_end = &fss_read_payload_print_data_object_end;
+        main->callback.print_set_end = &fss_read_print_set_end_no_eol;
+      }
+      else {
+        main->setting.state.status = F_status_set_error(F_parameter);
 
-      f_number_unsigned_t index = 0;
-      f_string_static_t *argv = main->program.parameters.arguments.array;
-
-      for (f_number_unsigned_t i = 0; i < main->program.parameters.array[fss_read_parameter_as_e].values.used; ++i) {
-
-        index = main->program.parameters.array[fss_read_parameter_as_e].values.array[i];
-
-        if (f_compare_dynamic(argv[index], fss_read_format_code_short_0000_s) == F_equal_to ||
-            f_compare_dynamic(argv[index], fss_read_format_code_long_0000_s) == F_equal_to ||
-            f_compare_dynamic(argv[index], fss_read_format_code_human_0000_s) == F_equal_to ||
-            f_compare_dynamic(argv[index], fss_read_format_code_machine_0000_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_basic_standard_s;
+        if (main->setting.flag & fss_read_main_flag_help_e) {
+          fss_read_main_process_help((void *) main);
+        }
+        else {
+          fss_read_main_print_error_format_unknown(&main->program.error, as);
+        }
 
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
-          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
-          main->setting.flag &= ~fss_read_main_flag_object_trim_e;
-          main->setting.flag &= ~fss_read_main_flag_trim_object_e;
+        return;
+      }
 
-          main->setting.flag |= fss_read_main_flag_line_single_e;
-          main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
+      main->setting.state.step_small = fss_read_allocation_console_d;
 
-          main->callback.process_help = &fss_read_basic_process_help;
-          main->callback.process_load = &fss_read_basic_process_load;
-          main->callback.process_total = &fss_read_process_normal_total;
+      main->setting.state.status = f_console_parameter_reset(&main->program.parameters);
 
-          main->callback.print_content_next = 0;
-          main->callback.print_object_end = &fss_read_basic_print_object_end;
-          main->callback.print_set_end = &fss_read_print_set_end;
-        }
-        else if (f_compare_dynamic(argv[index], fss_read_format_code_short_0001_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_long_0001_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_human_0001_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_machine_0001_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_extended_standard_s;
-
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
-          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_object_as_line_e;
-          main->setting.flag &= ~fss_read_main_flag_object_trim_e;
-          main->setting.flag &= ~fss_read_main_flag_trim_object_e;
-
-          main->setting.flag |= fss_read_main_flag_line_single_e | fss_read_main_flag_content_multiple_e;
-          main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e;
-
-          main->callback.process_help = &fss_read_extended_process_help;
-          main->callback.process_load = &fss_read_extended_process_load;
-          main->callback.process_total = &fss_read_process_normal_total;
-
-          main->callback.print_content_next = &fss_read_extended_print_content_next;
-          main->callback.print_object_end = &fss_read_extended_print_object_end;
-          main->callback.print_set_end = &fss_read_print_set_end;
-        }
-        else if (f_compare_dynamic(argv[index], fss_read_format_code_short_0002_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_long_0002_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_human_0002_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_machine_0002_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_basic_list_standard_s;
-
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
-          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_line_single_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
-
-          main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
-
-          main->callback.process_help = &fss_read_basic_list_process_help;
-          main->callback.process_load = &fss_read_basic_list_process_load;
-          main->callback.process_total = &fss_read_process_normal_total_multiple;
-
-          main->callback.print_content_next = 0;
-          main->callback.print_object_end = &fss_read_basic_list_print_object_end;
-          main->callback.print_set_end = &fss_read_print_set_end_no_eol;
-        }
-        else if (f_compare_dynamic(argv[index], fss_read_format_code_short_0003_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_long_0003_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_human_0003_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_machine_0003_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_extended_list_standard_s;
-
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_line_single_e;
-          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
-
-          main->setting.flag |= fss_read_main_flag_content_has_close_e;
-          main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
-
-          main->callback.process_help = &fss_read_extended_list_process_help;
-          main->callback.process_load = &fss_read_extended_list_process_load;
-          main->callback.process_total = &fss_read_process_normal_total_multiple;
-
-          main->callback.print_content_next = 0;
-          main->callback.print_object_end = &fss_read_extended_list_print_object_end;
-          main->callback.print_set_end = &fss_read_extended_list_print_set_end;
-        }
-        else if (f_compare_dynamic(argv[index], fss_read_format_code_short_0008_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_long_0008_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_human_0008_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_machine_0008_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_embedded_list_standard_s;
-
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
-          main->setting.flag &= ~fss_read_main_flag_line_single_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
-
-          main->setting.flag |= fss_read_main_flag_content_has_close_e | fss_read_main_flag_content_multiple_e;
-          main->setting.flag |= fss_read_main_flag_depth_multiple_e;
-          main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
-
-          main->callback.process_help = &fss_read_embedded_list_process_help;
-          main->callback.process_load = &fss_read_embedded_list_process_load;
-          main->callback.process_total = &fss_read_process_normal_total_multiple;
-
-          main->callback.print_content_next = 0;
-          main->callback.print_object_end = &fss_read_embedded_list_print_object_end;
-          main->callback.print_set_end = &fss_read_embedded_list_print_set_end;
-        }
-        else if (f_compare_dynamic(argv[index], fss_read_format_code_short_000e_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_long_000e_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_human_000e_s) == F_equal_to ||
-                 f_compare_dynamic(argv[index], fss_read_format_code_machine_000e_s) == F_equal_to) {
-
-          main->setting.standard = fss_read_payload_standard_s;
-
-          // Remove flags not supported for this standard.
-          main->setting.flag &= ~fss_read_main_flag_content_has_close_e;
-          main->setting.flag &= ~fss_read_main_flag_content_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_depth_multiple_e;
-          main->setting.flag &= ~fss_read_main_flag_line_single_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_content_e;
-          main->setting.flag &= ~fss_read_main_flag_quote_object_e;
-
-          main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e;
-
-          main->callback.process_help = &fss_read_payload_process_help;
-          main->callback.process_load = &fss_read_payload_process_load;
-          main->callback.process_total = &fss_read_process_normal_total_multiple;
-
-          main->callback.print_content_next = 0;
-          main->callback.print_object_end = &fss_read_payload_print_object_end;
-          main->callback.print_set_end = &fss_read_print_set_end_no_eol;
+      if (F_status_is_error(main->setting.state.status)) {
+        if (main->setting.flag & fss_read_main_flag_help_e) {
+          fss_read_main_process_help((void *) main);
         }
         else {
-          if (main->setting.flag & fss_read_main_flag_help_e) {
-            main->setting.state.status = F_status_set_error(F_parameter);
-
-            break;
-          }
+          fss_read_print_error(&main->program.error, macro_fss_read_f(f_console_parameter_reset));
+        }
 
-          main->setting.state.status = F_status_set_error(F_parameter);
+        return;
+      }
 
-          fss_read_main_print_error_format_unknown(&main->program.error, argv[index]);
-        }
-      } // for
+      f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
 
       if (F_status_is_error(main->setting.state.status)) {
         if (main->setting.flag & fss_read_main_flag_help_e) {
           fss_read_main_process_help((void *) main);
         }
+        else {
+          fss_read_print_error(&main->program.error, macro_fss_read_f(f_console_parameter_process));
+        }
 
         return;
       }
+
+      main->setting.state.step_small = fss_read_allocation_small_d;
+
+      // If the --as parameter changed as a result of the re-run of the parameter processing, then something is wrong with the parameters.
+      {
+        const f_number_unsigned_t index_new = main->program.parameters.array[fss_read_parameter_as_e].values.array[main->program.parameters.array[fss_read_parameter_as_e].values.used - 1];
+
+        if (f_compare_dynamic(as, main->program.parameters.arguments.array[index_new]) != F_equal_to) {
+          main->setting.state.status = F_status_set_error(F_parameter);
+
+          if (main->setting.flag & fss_read_main_flag_help_e) {
+            fss_read_main_process_help((void *) main);
+          }
+          else {
+            fss_read_main_print_error_parameter_as_changed(&main->program.error, as, main->program.parameters.arguments.array[index_new]);
+          }
+
+          return;
+        }
+      }
     }
     else if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_found_e) {
       main->setting.state.status = F_status_set_error(F_parameter);
index 95453f8248c7004db9f35c66e5947fc044782f14..66e133d0f66af99f49cf4ad0afa36cbde421879c 100644 (file)
@@ -31,8 +31,30 @@ extern "C" {
   }
 #endif // _di_fss_read_main_print_error_format_unknown_
 
+#ifndef _di_fss_read_main_print_error_parameter_as_changed_
+  f_status_t fss_read_main_print_error_parameter_as_changed(fl_print_t * const print, const f_string_static_t previous, const f_string_static_t current) {
+
+    if (!print) return F_status_set_error(F_output_not);
+    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QThe parameter '%]", print->to, print->set->error, print->prefix, print->set->error);
+    fl_print_format(f_string_format_QQ_single_s.string, print->to, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_as_s, print->set->notable);
+    fl_print_format("%[' value changed from '%]", print->to, print->set->error, print->set->error);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, previous, print->set->notable);
+    fl_print_format("%[' to %] ", print->to, print->set->error, print->set->error);
+    fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, current, print->set->notable);
+    fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->set->error, print->set->error, f_string_eol_s);
+
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_main_print_error_parameter_as_changed_
+
 #ifndef _di_fss_read_main_main_print_help_
-  f_status_t fss_read_main_print_help(fl_print_t * const print) {
+  f_status_t fss_read_main_print_message_help(fl_print_t * const print) {
 
     if (!print) return F_status_set_error(F_output_not);
 
@@ -58,8 +80,6 @@ extern "C" {
 
     f_print_dynamic_raw(f_string_eol_s, print->to);
 
-    // @todo everything below needs to be reviewed and updated as appropriate.
-
     fl_print_format("  The '%[%r%r%]' parameter supports the following standards with the specified possible case-sensitive values:%r", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_as_s, print->set->notable, f_string_eol_s);
 
     // FSS-0000 (Basic)
index 0cb6aba0873c0bb03e638fd3851691dfd1f32c56..85efb281687bcba947fae4d62bc27e70f26533f7 100644 (file)
@@ -33,6 +33,28 @@ extern "C" {
 #endif // _di_fss_read_main_print_error_format_unknown_
 
 /**
+ * Print an error message about a value given to the --as parameter changed after re-loading.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param previous
+ *   A string representing the value of the previous --as parameter.
+ * @param current
+ *   A string representing the value of the current --as parameter.
+ *
+ * @return
+ *   F_okay 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_read_main_print_error_parameter_as_changed_
+  extern f_status_t fss_read_main_print_error_parameter_as_changed(fl_print_t * const print, const f_string_static_t previous, const f_string_static_t current);
+#endif // _di_fss_read_main_print_error_parameter_as_changed_
+
+/**
  * Print help for "main" fss_read.
  *
  * @param print
@@ -46,9 +68,9 @@ extern "C" {
  *
  *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_print_main_help_
-  extern f_status_t fss_read_main_print_help(fl_print_t * const print);
-#endif // _di_fss_read_print_main_help_
+#ifndef _di_fss_read_print_main_message_help_
+  extern f_status_t fss_read_main_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_print_main_message_help_
 
 #ifdef __cplusplus
 } // extern "C"
index e24ffaab6a452e3903ae1d0748bd1c3c22cf9066..2cc2323d1581b83fa7ae4a6f5fbcb430760a86e5 100644 (file)
@@ -29,14 +29,28 @@ extern "C" {
       }
 
       if (main->setting.flag & fss_read_main_flag_content_e) {
-        if(main->setting.flag & fss_read_main_flag_select_e) {
-          if (main->setting.select < main->setting.contents.array[at].used && main->setting.contents.array[at].array[main->setting.select].start <= main->setting.contents.array[at].array[main->setting.select].stop) {
-            print_set_end = F_true;
+        if (main->setting.flag & fss_read_main_flag_select_e) {
+          if (main->setting.contents.array[at].used) {
+            if (main->setting.select < main->setting.contents.array[at].used) {
+              if (main->setting.contents.array[at].array[main->setting.select].start <= main->setting.contents.array[at].array[main->setting.select].stop) {
+                print_set_end = F_true;
+
+                if (main->callback.print_content) {
+                  main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content);
+                }
+              }
+              else {
+                print_set_end = F_true;
 
-            if (main->callback.print_content) {
-              main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content);
+                //if (main->callback.print_content_empty) {
+                //  main->callback.print_content_empty(&main->program.output);
+                //}
+              }
             }
           }
+          else if (main->callback.print_content_empty_set && !main->setting.select) {
+            main->callback.print_content_empty_set(&main->program.output);
+          }
         }
         else if (main->setting.contents.array[at].used) {
           print_set_end = F_true;
@@ -52,6 +66,9 @@ extern "C" {
             } // for
           }
         }
+        else if (main->callback.print_content_empty_set) {
+          main->callback.print_content_empty_set(&main->program.output);
+        }
       }
 
       if (print_set_end && main->callback.print_set_end) {
@@ -96,6 +113,21 @@ extern "C" {
   }
 #endif // _di_fss_read_print_content_
 
+#ifndef _di_fss_read_print_content_empty_set_end_
+  f_status_t fss_read_print_content_empty_set_end(fl_print_t * const print) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+
+    if (main->callback.print_set_end && (main->setting.flag & fss_read_main_flag_empty_e)) {
+      main->callback.print_set_end(print);
+    }
+
+    return F_okay;
+  }
+#endif // _di_fss_read_print_content_empty_set_end_
+
 #ifndef _di_fss_read_print_content_ignore_
   f_status_t fss_read_print_content_ignore(fl_print_t * const print) {
 
index c938ab4f3702583ab35ef07f8bf384a705f7d5d0..aa24aa33da8ec696df5f3b41d12df6644f1ee1a2 100644 (file)
@@ -95,6 +95,30 @@ extern "C" {
 #endif // _di_fss_read_print_content_
 
 /**
+ * Print the set end via the set end callback when Content is empty and the empty flag is set.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if a parameter is NULL.
+ *
+ * @see fll_print_dynamic_raw()
+ */
+#ifndef _di_fss_read_print_content_empty_set_end_
+  extern f_status_t fss_read_print_content_empty_set_end(fl_print_t * const print);
+#endif // _di_fss_read_print_content_empty_set_end_
+
+/**
  * Print the ignore character for Content.
  *
  * This locks, uses, and unlocks the file stream.
index 9f7f282e02a692cb9767adb264936f3cb4c53280..2e45f23f7ee30d2ec604a7733bb92cb63c2291a3 100644 (file)
@@ -110,7 +110,7 @@ extern "C" {
     }
 
     fl_print_format("  The parameter %[%r%r%] accepts the following:%r", print->to, set->notable, f_console_symbol_long_normal_s, fss_read_long_delimit_s, set->notable, f_string_eol_s);
-    fl_print_format("  - %[%r%]: Do not apply delimits.%r", print->to, set->notable, fss_read_delimit_mode_name_none_s, set->notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Do not apply delimits.%r", print->to, set->notable, fss_read_string_none_s, set->notable, f_string_eol_s);
     fl_print_format("  - %[%r%]: (default) Apply all delimits.%r", print->to, set->notable, fss_read_delimit_mode_name_all_s, set->notable, f_string_eol_s);
     fl_print_format("  - %[%r%]: Apply delimits for Objects.%r", print->to, set->notable, fss_read_delimit_mode_name_object_s, set->notable, f_string_eol_s); // @todo this isn't in embedded_list print, confirm/deny if this is intended or not.
     fl_print_format("  - A number, 0 or greater: apply delimits for Content at the specified depth.%r", print->to, f_string_eol_s);
@@ -120,7 +120,7 @@ extern "C" {
     fl_print_format("  The %[%r%r%] parameter may be specified multiple times to customize the delimit behavior.%r", print->to, set->notable, f_console_symbol_long_normal_s, fss_read_long_delimit_s, set->notable, f_string_eol_s);
 
     fl_print_format("  The %[%r%r%]", print->to, set->notable, f_console_symbol_long_normal_s, fss_read_long_delimit_s, set->notable);
-    fl_print_format(" values %[%r%]", print->to, set->notable, fss_read_delimit_mode_name_none_s, set->notable);
+    fl_print_format(" values %[%r%]", print->to, set->notable, fss_read_string_none_s, set->notable);
     fl_print_format(" and %[%r%],", print->to, set->notable, fss_read_delimit_mode_name_all_s, set->notable);
     fl_print_format(" overrule all other delimit values.%r%r", print->to, f_string_eol_s, f_string_eol_s);
 
index 3bdde50f2a558c0da483acdae5ea9a5a764a9806..84a582cc7f3f58b7063b6e4c289c90cc71c78d7b 100644 (file)
@@ -161,7 +161,7 @@ extern "C" {
           }
         }
         else if (main->setting.flag & fss_read_main_flag_columns_e) {
-          fss_read_print_number(&main->program.output, main->setting.contents.array[i].used);
+          fss_read_print_number(&main->program.output, main->setting.contents.array[i].used); // @todo review and consider what to do when empty flag is set.
         }
         else if (main->callback.print_at) {
           main->callback.print_at(&main->program.output, i, delimits_object, delimits_content);
@@ -206,7 +206,9 @@ extern "C" {
 
         if (!(main->setting.flag & fss_read_main_flag_content_e)) {
           if (!(main->setting.flag & fss_read_main_flag_object_as_line_e)) {
-            f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
+            if (main->callback.print_set_end) {
+              main->callback.print_set_end(&main->program.output);
+            }
           }
 
           main->setting.state.status = F_success;
@@ -221,19 +223,23 @@ extern "C" {
     }
 
     if (main->setting.flag & fss_read_main_flag_content_e) {
+
+      // Must process/count line when both Object and Content share the same line but Content is empty. @todo review this block.
       if (!main->setting.contents.array[at].used) {
+        if (main->setting.flag & (fss_read_main_flag_empty_e | fss_read_main_flag_object_e)) {
+          if (!(main->setting.flag & fss_read_main_flag_object_e) || !(main->setting.flag & fss_read_main_flag_object_as_line_e) && (main->setting.flag & fss_read_main_flag_line_single_e)) {
+            if (*line == main->setting.line) {
+              if (main->callback.print_set_end) {
+                main->callback.print_set_end(&main->program.output);
+              }
 
-        // Must process/count line when both Object and Content share the same line but Content is empty.
-        if ((main->setting.flag & fss_read_main_flag_object_e) && !(main->setting.flag & fss_read_main_flag_object_as_line_e) && (main->setting.flag & fss_read_main_flag_line_single_e)) {
-          if (*line == main->setting.line) {
-            f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
+              main->setting.state.status = F_success;
 
-            main->setting.state.status = F_success;
+              return;
+            }
 
-            return;
+            ++(*line);
           }
-
-          ++(*line);
         }
 
         main->setting.state.status = F_okay;
@@ -244,19 +250,29 @@ extern "C" {
       f_number_unsigned_t i = 0;
 
       if (main->setting.flag & fss_read_main_flag_line_single_e) {
+        // @fixme review this for when the line is empty.
         if (*line == main->setting.line) {
-          while (main->setting.contents.array[at].used) {
+          if (main->setting.contents.array[at].used) {
+            while (main->setting.contents.array[at].used) {
 
-            fss_read_print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].array[i], delimits_content);
+              if (main->callback.print_content) {
+                main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].array[i], delimits_content);
+              }
 
-            if (++i >= main->setting.contents.array[at].used) break;
+              if (++i >= main->setting.contents.array[at].used) break;
 
-            if (main->callback.print_content_next) {
-              main->callback.print_content_next(&main->program.output);
-            }
-          } // while
+              if (main->callback.print_content_next) {
+                main->callback.print_content_next(&main->program.output);
+              }
+            } // while
 
-          f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
+            if (main->callback.print_set_end) {
+              main->callback.print_set_end(&main->program.output);
+            }
+          }
+          else if (main->callback.print_content_empty_set) {
+            main->callback.print_content_empty_set(&main->program.output);
+          }
 
           main->setting.state.status = F_success;
 
@@ -270,63 +286,54 @@ extern "C" {
         f_number_unsigned_t j = 0;
         f_number_unsigned_t k = 0;
 
-        for (; i < main->setting.contents.array[at].used; ++i) {
+        if (main->setting.contents.array[at].used) {
+          for (; i < main->setting.contents.array[at].used; ++i) {
 
-          if (fss_read_signal_check(main)) return;
+            if (fss_read_signal_check(main)) return;
 
-          line_original = *line;
-          main->setting.range = main->setting.contents.array[at].array[i];
-          k = 0;
+            line_original = *line;
+            main->setting.range = main->setting.contents.array[at].array[i];
+            k = 0;
 
-          for (j = main->setting.range.start; j <= main->setting.range.stop; ++j) {
+            for (j = main->setting.range.start; j <= main->setting.range.stop; ++j) {
 
-            if (fss_read_signal_check(main)) return;
+              if (fss_read_signal_check(main)) return;
 
-            if (k < main->setting.comments.used) {
-              while (main->setting.comments.array[k].stop < j) ++k;
+              if (k < main->setting.comments.used) {
+                while (main->setting.comments.array[k].stop < j) ++k;
 
-              if (j >= main->setting.comments.array[k].start && j <= main->setting.comments.array[k].stop) {
-                j = main->setting.comments.array[k++].stop + 1;
+                if (j >= main->setting.comments.array[k].start && j <= main->setting.comments.array[k].stop) {
+                  j = main->setting.comments.array[k++].stop + 1;
 
-                if (j > main->setting.range.stop) break;
+                  if (j > main->setting.range.stop) break;
+                }
               }
-            }
 
-            if (main->setting.buffer.string[j] == f_string_eol_s.string[0]) {
-              if (*line == main->setting.line) {
-                main->setting.range.stop = j;
+              if (main->setting.buffer.string[j] == f_string_eol_s.string[0]) {
+                if (*line == main->setting.line) {
+                  main->setting.range.stop = j;
 
-                fss_read_print_content(&main->program.output, main->setting.range, main->setting.quotes_content.array[at].array[i], delimits_content);
+                  if (main->callback.print_content) {
+                    main->callback.print_content(&main->program.output, main->setting.range, main->setting.quotes_content.array[at].array[i], delimits_content);
+                  }
 
-                main->setting.state.status = F_success;
+                  main->setting.state.status = F_success;
 
-                return;
-              }
+                  return;
+                }
 
-              main->setting.range.start = j + 1;
+                main->setting.range.start = j + 1;
 
-              if (j <= main->setting.range.stop) {
-                ++(*line);
+                if (j <= main->setting.range.stop) {
+                  ++(*line);
+                }
               }
-            }
+            } // for
           } // for
-
-          // If Content does not end with a newline, it still must be treated as the last line.
-          if ((main->setting.flag & fss_read_main_flag_line_single_e) && *line == line_original) {
-            ++(*line);
-
-            if (*line == main->setting.line) {
-              main->setting.range.stop = main->setting.contents.array[at].array[i].stop;
-
-              fss_read_print_content(&main->program.output, main->setting.range, main->setting.quotes_content.array[at].array[i], delimits_content);
-              f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
-
-              main->setting.state.status = F_success;
-
-              return;
-            }
-          }
-        } // for
+        }
+        else if (main->callback.print_content_empty_set) {
+          main->callback.print_content_empty_set(&main->program.output);
+        }
       }
 
       // @fixme The fll_fss_*_read functions do not have a store of the set closing ranges but should.
@@ -368,15 +375,23 @@ extern "C" {
     f_number_unsigned_t max = 0;
 
     if (main->setting.flag & fss_read_main_flag_content_multiple_e) {
+      uint8_t has_at = F_false;
+
       for (f_number_unsigned_t at = 0; at < main->setting.contents.used; ++at) {
 
         if (!names[at]) continue;
         if (fss_read_signal_check(main)) return;
 
+        has_at = F_true;
+
         if (main->setting.contents.array[at].used > max) {
           max = main->setting.contents.array[at].used;
         }
       } // for
+
+      if (!max && has_at && (main->setting.flag & fss_read_main_flag_empty_e)) {
+        max = 1;
+      }
     }
     else {
       for (f_number_unsigned_t at = 0; at < main->setting.contents.used; ++at) {
@@ -458,7 +473,14 @@ extern "C" {
           if (main->setting.depths.array[0].value_at != i) continue;
         }
 
-        if (main->setting.select < main->setting.contents.array[i].used && main->setting.contents.array[i].array[main->setting.select].start <= main->setting.contents.array[i].array[main->setting.select].stop) {
+        if (main->setting.contents.array[i].used) {
+          if (main->setting.select < main->setting.contents.array[i].used) {
+            if ((main->setting.flag & fss_read_main_flag_empty_e) || main->setting.contents.array[i].array[main->setting.select].start <= main->setting.contents.array[i].array[main->setting.select].stop) {
+              ++total;
+            }
+          }
+        }
+        else if (!main->setting.select && (main->setting.flag & fss_read_main_flag_empty_e)) {
           ++total;
         }
       } // for
@@ -519,7 +541,6 @@ extern "C" {
       }
 
       if (main->setting.flag & fss_read_main_flag_content_e) {
-
         if (!main->setting.contents.array[at].used) continue;
 
         for (i = 0; i < main->setting.contents.array[at].used; ++i) {
@@ -528,7 +549,7 @@ extern "C" {
           range.stop = main->setting.contents.array[at].array[i].stop;
 
           // This content has no data, do not even check "include empty" because it cannot be counted as a line.
-          if (range.start > range.stop) continue;
+          if (range.start > range.stop) continue; // @fixme review this check for when include empty is set (basic list might not count but extended list might).
 
           for (j = range.start; j <= range.stop; ++j) {
 
index b5fd25d905b1ccd9185f26e961e23314204ab03b..11ba67dae15d69c10e58502231462cfdde38039f 100644 (file)
@@ -5,8 +5,6 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_read_payload_s_
-  const f_string_static_t fss_read_payload_s = macro_f_string_static_t_initialize_1(FSS_READ_payload_s, 0, FSS_READ_payload_s_length);
-
   const f_string_static_t fss_read_payload_standard_s = macro_f_string_static_t_initialize_1(FSS_READ_payload_standard_s, 0, FSS_READ_payload_standard_s_length);
 
   const f_string_static_t fss_read_payload_program_name_s = macro_f_string_static_t_initialize_1(FSS_READ_payload_program_name_s, 0, FSS_READ_payload_program_name_s_length);
index bf3fe87251ba51280331f8376a3b22ed44d85408..24c8d376a1feb0daa0aaaa9c28e10ee20ce4f330 100644 (file)
@@ -20,8 +20,6 @@ extern "C" {
  * The FSS-000E (Payload) specific strings.
  */
 #ifndef _di_fss_read_payload_s_
-  #define FSS_READ_payload_s "payload"
-
   #define FSS_READ_payload_standard_s "FSS-000E (Payload)"
 
   #define FSS_READ_payload_program_name_s      "fss_payload_read"
@@ -33,8 +31,6 @@ extern "C" {
   #define FSS_READ_format_code_machine_000e_s "payload"
   #define FSS_READ_format_code_name_000e_s    "Payload"
 
-  #define FSS_READ_payload_s_length 7
-
   #define FSS_READ_payload_standard_s_length 18
 
   #define FSS_READ_payload_program_name_s_length      16
@@ -46,8 +42,6 @@ extern "C" {
   #define FSS_READ_format_code_machine_000e_s_length 7
   #define FSS_READ_format_code_name_000e_s_length    7
 
-  extern const f_string_static_t fss_read_payload_s;
-
   extern const f_string_static_t fss_read_payload_standard_s;
 
   extern const f_string_static_t fss_read_payload_program_name_s;
index cb56b3e27216d87378ee078539a877960048ee02..73c40fe40b449b2c19c679102214af0a31f8cf8a 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
 
     if (!void_main) return;
 
-    fss_read_payload_print_help(&((fss_read_main_t *) void_main)->program.message);
+    fss_read_payload_print_message_help(&((fss_read_main_t *) void_main)->program.message);
   }
 #endif // _di_fss_read_payload_process_help_
 
@@ -44,17 +44,75 @@ extern "C" {
     if (F_status_is_error(main->setting.state.status)) {
       if (F_status_set_fine(main->setting.state.status) == F_interrupt) return;
 
-      fll_error_file_print(
-        &main->program.error,
-        F_status_set_fine(main->setting.state.status),
-        macro_fss_read_f(fll_fss_payload_read),
-        fll_error_file_flag_fallback_e,
-        fss_read_file_identify(main->setting.range.start, main->setting.files),
-        f_file_operation_process_s,
-        fll_error_file_type_file_e
-      );
+      if (main->setting.state.status == F_status_set_error(F_okay_stop) || main->setting.state.status == F_status_set_error(F_okay_eos)) {
+        if (main->setting.flag & fss_read_main_flag_payload_error_e) {
+          fss_read_payload_print_problem_payload_missing(&main->program.error);
 
-      return;
+          return;
+        }
+
+        if (main->setting.flag & (fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e)) {
+          if (main->program.warning.verbosity > f_console_verbosity_normal_e) {
+            fss_read_payload_print_problem_payload_missing(&main->program.warning);
+          }
+
+          main->setting.state.status = F_okay;
+        }
+        else if (main->setting.flag & fss_read_main_flag_payload_create_e) {
+          main->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &main->setting.buffer);
+
+          if (F_status_is_error(main->setting.state.status)) {
+            fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append_assure));
+          }
+          else {
+            main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_range_t), (void **) &main->setting.objects.array, &main->setting.objects.used, &main->setting.objects.size);
+
+            if (F_status_is_error_not(main->setting.state.status)) {
+              main->setting.state.status = f_memory_array_increase(main->setting.state.step_small, sizeof(f_ranges_t), (void **) &main->setting.contents.array, &main->setting.contents.used, &main->setting.contents.size);
+            }
+
+            if (F_status_is_error(main->setting.state.status)) {
+              fss_read_print_error(&main->program.error, macro_fss_read_f(f_memory_array_increase));
+            }
+            else {
+              main->setting.objects.array[main->setting.objects.used].start = main->setting.buffer.used;
+
+              main->setting.state.status = f_string_dynamic_append(f_fss_payload_s, &main->setting.buffer);
+
+              if (F_status_is_error_not(main->setting.state.status)) {
+                main->setting.state.status = f_string_dynamic_append(f_fss_payload_list_open_s, &main->setting.buffer);
+              }
+
+              if (F_status_is_error_not(main->setting.state.status)) {
+                main->setting.state.status = f_string_dynamic_append(f_fss_payload_list_open_end_s, &main->setting.buffer);
+              }
+
+              if (F_status_is_error(main->setting.state.status)) {
+                fss_read_print_error(&main->program.error, macro_fss_read_f(f_string_dynamic_append));
+              }
+              else {
+                main->setting.objects.array[main->setting.objects.used++].stop = main->setting.objects.array[main->setting.objects.used].start + f_fss_payload_s.used - 1;
+                main->setting.contents.array[main->setting.contents.used++].used = 0;
+
+                main->setting.state.status = F_okay;
+              }
+            }
+          }
+        }
+      }
+      else {
+        fll_error_file_print(
+          &main->program.error,
+          F_status_set_fine(main->setting.state.status),
+          macro_fss_read_f(fll_fss_payload_read),
+          fll_error_file_flag_fallback_e,
+          fss_read_file_identify(main->setting.range.start, main->setting.files),
+          f_file_operation_process_s,
+          fll_error_file_type_file_e
+        );
+
+        return;
+      }
     }
 
     if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) {
@@ -93,22 +151,32 @@ extern "C" {
 
     if (!main) return;
 
-    f_number_unsigneds_t * const values = &main->program.parameters.array[fss_read_parameter_object_e].values;
-    f_string_static_t * const argv = main->program.parameters.arguments.array;
-
-    if ((main->program.parameters.array[fss_read_parameter_object_e].result & f_console_result_value_e) && values->used) {
-      for (f_number_unsigned_t i = 0; i < values->used; ++i) {
-
-        if (fss_read_signal_check(main)) return;
+    f_number_unsigneds_t * const values = &main->program.parameters.array[fss_read_parameter_payload_e].values;
 
-        if (f_compare_dynamic(argv[values->array[i]], fss_read_payload_s) == F_equal_to && i + 1 < values->used) {
-          main->setting.state.status = F_status_set_error(F_parameter);
+    if ((main->program.parameters.array[fss_read_parameter_payload_e].result & f_console_result_value_e) && values->used) {
+      f_string_static_t * const argv = main->program.parameters.arguments.array;
 
-          fss_read_payload_print_error_payload_not_last(&main->program.error);
+      if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_create_s) == F_equal_to) {
+        main->setting.flag |= fss_read_main_flag_payload_create_e;
+        main->setting.flag &= ~(fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e);
+      }
+      else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_none_s) == F_equal_to) {
+        main->setting.flag |= fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e);
+      }
+      else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_error_s) == F_equal_to) {
+        main->setting.flag |= fss_read_main_flag_payload_error_e;
+        main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_warn_e);
+      }
+      else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_warn_s) == F_equal_to) {
+        main->setting.flag |= fss_read_main_flag_payload_warn_e;
+        main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_error_e);
+      }
+      else {
+        main->setting.state.status = F_status_set_error(F_parameter);
 
-          return;
-        }
-      } // for
+        fss_read_payload_print_error_parameter_value_payload(&main->program.error, argv[values->array[values->used - 1]]);
+      }
     }
   }
 #endif // _di_fss_read_payload_setting_load_
index 1df1aece7361294bc1c318514954419060d6f610..e73ca617a98ca2edb7fcaf0538414b0e30dac9be 100644 (file)
@@ -35,15 +35,17 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
   data.callback.print_at = &fss_read_print_at;
   data.callback.print_content = &fss_read_print_content;
+  //data.callback.print_content_empty = 0;
+  data.callback.print_content_empty_set = 0;
   data.callback.print_content_ignore = &fss_read_print_content_ignore;
   data.callback.print_content_next = 0;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_payload_print_object_end;
+  data.callback.print_object_end = &fss_read_payload_print_data_object_end;
   data.callback.print_set_end = &fss_read_print_set_end_no_eol;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
-  data.program.parameters.array[fss_read_parameter_as_e].flag |= f_console_flag_disable_e;
+  data.program.parameters.array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e;
   data.program.parameters.used = fss_read_parameter_total_d;
   data.program.environment = envp;
 
index fa91a73625f08be8a9ba3b14680394f1f1b4d2f3..cb3fafbb7f8f5ecc6d0f3d19245892aa0da59cf0 100644 (file)
@@ -4,20 +4,64 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_payload_print_error_payload_not_last_
-  f_status_t fss_read_payload_print_error_payload_not_last(fl_print_t * const print) {
+#ifndef _di_fss_read_payload_print_data_object_end_
+  f_status_t fss_read_payload_print_data_object_end(fl_print_t * const print) {
+
+    if (!print || !print->custom) return F_status_set_error(F_output_not);
+
+    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+
+    f_file_stream_lock(print->to);
+
+    if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
+      f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
+    }
+    else {
+      if (main->setting.flag & fss_read_main_flag_content_e) {
+        f_print_dynamic_raw(f_fss_payload_list_open_s, print->to);
+        f_print_dynamic_raw(f_fss_payload_list_open_end_s, print->to);
+      }
+      else {
+        f_print_dynamic_raw(f_fss_eol_s, print->to);
+      }
+    }
+
+    f_file_stream_unlock(print->to);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_payload_print_data_object_end_
+
+#ifndef _di_fss_read_payload_print_error_parameter_value_payload_
+  f_status_t fss_read_payload_print_error_parameter_value_payload(fl_print_t * const print, const f_string_static_t value) {
 
     if (!print) return F_status_set_error(F_output_not);
-    if (!print || print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
+
+    f_file_stream_lock(print->to);
+
+    fl_print_format("%[%QThe parameter '%]", print->to, print->context, print->prefix, print->context);
+    fl_print_format(f_string_format_rr_single_s.string, print->to, print->notable, f_console_symbol_long_normal_s, fss_read_long_payload_s, print->notable);
+    fl_print_format("%[' has the value '%]", print->to, print->context, print->context);
+    fl_print_format("%[%Q%]", print->to, print->notable, value, print->notable);
+    fl_print_format("%[' but must only be one of: '%]", print->to, print->context, print->context);
+    fl_print_format("%[%Q%]", print->to, print->notable, fss_read_string_create_s, print->notable);
+    fl_print_format("%[', '%]", print->to, print->context, print->context);
+    fl_print_format("%[%Q%]", print->to, print->notable, fss_read_string_error_s, print->notable);
+    fl_print_format("%[', '%]", print->to, print->context, print->context);
+    fl_print_format("%[%Q%]", print->to, print->notable, fss_read_string_none_s, print->notable);
+    fl_print_format("%[', and '%]", print->to, print->context, print->context);
+    fl_print_format("%[%Q%]", print->to, print->notable, fss_read_string_warn_s, print->notable);
+    fl_print_format(f_string_format_sentence_end_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
 
-    fll_print_format("%r%[%QThe payload may only be specified last.%]%r", print->to, f_string_eol_s, print->set->error, print->prefix, print->set->error, f_string_eol_s);
+    f_file_stream_unlock(print->to);
 
     return F_okay;
   }
-#endif // _di_fss_read_payload_print_error_payload_not_last_
+#endif // _di_fss_read_payload_print_error_parameter_value_payload_
 
-#ifndef _di_fss_read_payload_print_help_
-  f_status_t fss_read_payload_print_help(fl_print_t * const print) {
+#ifndef fss_read_payload_print_message_help
+  f_status_t fss_read_payload_print_message_help(fl_print_t * const print) {
 
     if (!print) return F_status_set_error(F_output_not);
 
@@ -31,6 +75,8 @@ extern "C" {
 
     fll_program_print_help_usage(print, fss_read_payload_program_name_s, f_string_empty_s);
 
+    fss_read_payload_print_message_help_special(print);
+
     fss_read_print_message_help_pipe(print);
 
     fss_read_print_message_help_note(print, F_true);
@@ -45,41 +91,59 @@ extern "C" {
     fl_print_format(" will not contain any Content close pipe control codes when using", print->to);
     fl_print_format(" %[%r%r%].%r", print->to, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_pipe_s, print->set->notable, f_string_eol_s);
 
+    fss_read_payload_print_message_help_payload(print);
+
     f_file_stream_flush(print->to);
     f_file_stream_unlock(print->to);
 
     return F_okay;
   }
-#endif // _di_fss_read_payload_print_help_
+#endif // _di_fss_read_payload_print_message_help_
 
-#ifndef _di_fss_read_payload_print_object_end_
-  f_status_t fss_read_payload_print_object_end(fl_print_t * const print) {
+#ifndef _di_fss_read_payload_print_message_help_payload_
+  f_status_t fss_read_payload_print_message_help_payload(fl_print_t * const print) {
 
-    if (!print || !print->custom) return F_status_set_error(F_output_not);
+    if (!print || !print->set) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
+    fl_print_format("%r  The parameter %[%r%r%] accepts the following:%r", print->to, f_string_eol_s, print->set->notable, f_console_symbol_long_normal_s, fss_read_long_payload_s, print->set->notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Create the payload Object if it is missing, but with empty Content.%r", print->to, print->set->notable, fss_read_string_create_s, print->set->notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Do nothing special with payload Object is missing.%r", print->to, print->set->notable, fss_read_string_none_s, print->set->notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Print error and exit as an error when payload Object is missing.%r", print->to, print->set->notable, fss_read_string_error_s, print->set->notable, f_string_eol_s);
+    fl_print_format("  - %[%r%]: Print warning but continue when payload Object is missing.%r", print->to, print->set->notable, fss_read_string_warn_s, print->set->notable, f_string_eol_s);
+
+    return F_okay;
+  }
+#endif // _di_fss_read_payload_print_message_help_payload_
+
+#ifndef _di_fss_read_payload_print_message_help_special_
+  f_status_t fss_read_payload_print_message_help_special(fl_print_t * const print) {
+
+    if (!print || !print->set) return F_status_set_error(F_output_not);
+
+    fl_print_format("%r %[Special Options:%] %r", print->to, f_string_eol_s, print->set->important, print->set->important, f_string_eol_s);
+
+    fll_program_print_help_option_long(print, fss_read_long_payload_s, f_console_symbol_long_normal_s, "Specify custom actions to perform when payload Object is missing.");
+
+    return F_okay;
+  }
+#endif // _di_fss_read_payload_print_message_help_special_
 
+#ifndef fss_read_payload_print_problem_payload_missing
+  f_status_t fss_read_payload_print_problem_payload_missing(fl_print_t * const print) {
+
+    if (!print || print->verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print->to);
 
-    if (main->setting.flag & fss_read_main_flag_pipe_format_e) {
-      f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-    }
-    else {
-      if (main->setting.flag & fss_read_main_flag_content_e) {
-        f_print_dynamic_raw(f_fss_payload_list_open_s, print->to);
-        f_print_dynamic_raw(f_fss_payload_list_open_end_s, print->to);
-      }
-      else {
-        f_print_dynamic_raw(f_fss_eol_s, print->to);
-      }
-    }
+    fl_print_format("%[%QDid not find the required %]", print->to, print->context, print->prefix, print->context);
+    fl_print_format(f_string_format_r_single_s.string, print->to, print->notable, f_fss_payload_s, print->notable);
+    fl_print_format(" %[Object.%]%r", print->to, print->context, print->context, f_string_eol_s);
 
     f_file_stream_unlock(print->to);
 
     return F_okay;
   }
-#endif // _di_fss_read_payload_print_object_end_
+#endif // _di_fss_read_payload_print_problem_payload_missing_
 
 #ifdef __cplusplus
 } // extern "C"
index c67b5f000c8078fb9e84c6b86f4b3bcd62bf2a01..4d5c4dfae1e07e8088798de2e7708e4b92516ae8 100644 (file)
@@ -13,24 +13,52 @@ extern "C" {
 #endif
 
 /**
- * Print error message about the "payload" not being specified last (when it is specified at all).
+ * Print the end of an Object (which is often the start of Content).
+ *
+ * This locks, uses, and unlocks the file stream.
  *
  * @param print
  *   The output structure to print to.
  *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
  *   This does not alter print.custom.setting.state.status.
  *
  * @return
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if setting is NULL.
+ *   F_output_not (with error bit) if a parameter is NULL.
  *
- * @see fll_error_print()
+ * @see f_file_stream_lock()
+ * @see f_file_stream_unlock()
+ * @see f_print_dynamic_raw()
  */
-#ifndef _di_fss_read_payload_print_error_payload_not_last_
-  extern f_status_t fss_read_payload_print_error_payload_not_last(fl_print_t * const print);
-#endif // _di_fss_read_payload_print_error_payload_not_last_
+#ifndef _di_fss_read_payload_print_data_object_end_
+  extern f_status_t fss_read_payload_print_data_object_end(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_data_object_end_
+
+/**
+ * Print an error message about the payload parameter not having a valid value.
+ *
+ * @param print
+ *   The output structure to print to.
+ *
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param value
+ *   The parameter value that is invalid.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if a parameter is NULL.
+ */
+#ifndef _di_fss_read_payload_print_error_parameter_value_payload_
+  extern f_status_t fss_read_payload_print_error_parameter_value_payload(fl_print_t * const print, const f_string_static_t value);
+#endif // _di_fss_read_payload_print_error_parameter_value_payload_
 
 /**
  * Print help for FSS-000E (Payload).
@@ -46,19 +74,51 @@ extern "C" {
  *
  *   F_output_not (with error bit) if setting is NULL.
  */
-#ifndef _di_fss_read_payload_print_help_
-  extern f_status_t fss_read_payload_print_help(fl_print_t * const print);
-#endif // _di_fss_read_payload_print_help_
+#ifndef _di_fss_read_payload_print_message_help_
+  extern f_status_t fss_read_payload_print_message_help(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_message_help_
 
 /**
- * Print the end of an Object (which is often the start of Content).
+ * Print payload-specific help parameters details for FSS-000E (Payload).
  *
- * This locks, uses, and unlocks the file stream.
+ * @param print
+ *   The output structure to print to.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ *   F_okay 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_read_payload_print_message_help_payload_
+  extern f_status_t fss_read_payload_print_message_help_payload(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_message_help_payload_
+
+/**
+ * Print payload-specific help special parameters for FSS-000E (Payload).
  *
  * @param print
  *   The output structure to print to.
  *
- *   The print.custom is expected to be of type fss_read_main_t.
+ *   This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ *   F_okay 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_read_payload_print_message_help_special_
+  extern f_status_t fss_read_payload_print_message_help_special(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_message_help_special_
+
+/**
+ * Print error or warning message about the "payload" not being found.
+ *
+ * @param print
+ *   The output structure to print to.
  *
  *   This does not alter print.custom.setting.state.status.
  *
@@ -66,15 +126,13 @@ extern "C" {
  *   F_okay on success.
  *   F_output_not on success, but no printing is performed.
  *
- *   F_output_not (with error bit) if a parameter is NULL.
+ *   F_output_not (with error bit) if setting is NULL.
  *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ * @see fll_error_print()
  */
-#ifndef _di_fss_read_payload_print_object_end_
-  extern f_status_t fss_read_payload_print_object_end(fl_print_t * const print);
-#endif // _di_fss_read_payload_print_object_end_
+#ifndef _di_fss_read_payload_print_problem_payload_missing_
+  extern f_status_t fss_read_payload_print_problem_payload_missing(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_problem_payload_missing_
 
 #ifdef __cplusplus
 } // extern "C"