]> Kevux Git Server - fll/commitdiff
Update: Improve FSS Read function correctness based on runtime unit tests.
authorKevin Day <Kevin@kevux.org>
Sun, 18 Aug 2024 01:09:30 +0000 (20:09 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 18 Aug 2024 01:57:40 +0000 (20:57 -0500)
This improves the runtime unit tests to be more correct as per the standard.
The standard allows for spaces after an Object.

There is no reason to print these extra spaces.
Add additional logic to better handle this behavior.

The FSS Basic Read and FSS Extended Read should not print this extra space after the Object when there is no Content to be printed.

The pipe mode should wrap empty Content with the start and end pipe characters.
This pope mode is still not well tested (or reviewed) and will eventually need further review and runtime tests.

The handling of `--empty` should only apply to when there is empty Content and not when there is no Content at all.

This adds new callback and flags to better handle these situations.

Update the `verify.sh` script (and associated `testfile`) to print the test name.
Update the `generate.sh` and `verify.sh` scripts to safely pass arguments with spaces using `"$@"`.

65 files changed:
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/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/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/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/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/define.h
level_3/fss_read/c/main/common/type.h
level_3/fss_read/c/main/main.c
level_3/fss_read/c/main/print/data.c
level_3/fss_read/c/main/print/data.h
level_3/fss_read/c/main/process_normal.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
level_3/fss_read/data/build/testfile
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-at-6.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-original.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-select-0.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content-trim.expect
level_3/fss_read/tests/runtime/fss_0000/expect/test-0001-unicode-object_and_content.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-name--select-1.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-name-a-select-100.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-name-a-select-2.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-name-a-select-5.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-name-a-select-6.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-select-1.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-select-100.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-select-5.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0000-quotes_and_escapes-object_and_content-select-6.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-at-6.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-a-select-100.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-a-select-2.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-a-select-5.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-a-select-6.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-hi-select-1-empty.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-hi-select-1.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-name-мир-select-1.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-original.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-select-0.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-select-1.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-select-100.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-select-5.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-select-6.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content-trim.expect
level_3/fss_read/tests/runtime/fss_0001/expect/test-0001-unicode-object_and_content.expect
level_3/fss_read/tests/runtime/script/generate.sh
level_3/fss_read/tests/runtime/script/verify.sh

index 3ffefea26ffb018f168a3eea6f436cddd90af1ea..b99860f675855fb48b1793501212916705eab052 100644 (file)
@@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.program.output.custom = (void *) &data;
   data.program.warning.custom = (void *) &data;
 
-  data.setting.flag |= fss_read_main_flag_line_single_d;
+  data.setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_end_d;
   data.setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d;
 
   data.setting.state.custom = (void *) &data;
@@ -36,11 +36,12 @@ 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_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_data_object_end;
+  data.callback.print_object_end = &fss_read_basic_print_object_end;
+  data.callback.print_object_end_content = &fss_read_basic_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_print_content_empty;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
index 51cdd75cedc27ed18d70646813c800ff7f7e4e58..f7dfd2054c6ba0d5144a93f1ff7a763e3a1b99af 100644 (file)
@@ -4,25 +4,35 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_basic_print_data_object_end_
-  f_status_t fss_read_basic_print_data_object_end(fl_print_t * const print) {
+#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_d) {
-      if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
-        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-      }
-      else {
-        fll_print_dynamic_raw(f_fss_basic_open_s, print->to);
-      }
+      fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_start_s : f_fss_basic_open_s, print->to);
+    }
+    else {
+      return F_output_not;
     }
 
     return F_okay;
   }
-#endif // _di_fss_read_basic_print_data_object_end_
+#endif // _di_fss_read_basic_print_object_end_
+
+#ifndef _di_fss_read_basic_print_object_end_content_
+  f_status_t fss_read_basic_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_basic_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_basic_print_object_end_content_
 
 #ifndef _di_fss_read_basic_print_message_help_
   f_status_t fss_read_basic_print_message_help(fl_print_t * const print) {
index e738351605afa3fd6689d7b938ca4fa161805458..8e6b0957490f0db34e23dd8cd952015b1159443b 100644 (file)
@@ -29,12 +29,41 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @param print
+ *   The output structure to print to.
  *
- * @see fll_print_dynamic_raw()
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_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_
+#ifndef _di_fss_read_basic_print_object_end_content_
+  extern f_status_t fss_read_basic_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_basic_print_object_end_content_
 
 /**
  * Print help for FSS-0000 (Basic).
index 7141d9349d5cabeb68e20c846afa3de8a3a5abf1..b76d60da2172bccb935c57da4b300f700a298bdd 100644 (file)
@@ -35,11 +35,12 @@ 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_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_data_object_end;
+  data.callback.print_object_end = &fss_read_basic_list_print_object_end;
+  data.callback.print_object_end_content = &fss_read_basic_list_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_basic_list_print_object_end_empty;
   data.callback.print_set_end = &fss_read_print_set_end_no_eol;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
index 2ed28ee6456b07b06e63be750e0abf0b16819ad9..8ee1d002a91d1e7d8e05ffde466f1338179c1e69 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#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) {
+#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);
 
@@ -16,21 +16,46 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
       f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
     }
+    else if (main->setting.flag & fss_read_main_flag_content_d) {
+      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 {
-      if (main->setting.flag & fss_read_main_flag_content_d) {
-        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_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_
+#endif // _di_fss_read_basic_list_print_object_end_
+
+#ifndef _di_fss_read_basic_list_print_object_end_content_
+  f_status_t fss_read_basic_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_basic_list_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_basic_list_print_object_end_content_
+
+#ifndef _di_fss_read_basic_list_print_object_end_empty_
+  f_status_t fss_read_basic_list_print_object_end_empty(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
+
+    const f_status_t status_1 = fss_read_basic_list_print_object_end(print);
+    const f_status_t status_2 = fss_read_print_content_empty(print);
+
+    if (F_status_is_error(status_1)) return status_1;
+    if (F_status_is_error(status_2)) return status_2;
+
+    return (status_1 == F_okay || status_2 == F_okay) ? F_okay: F_output_not;
+  }
+#endif // _di_fss_read_basic_list_print_object_end_empty_
 
 #ifndef _di_fss_read_basic_list_print_message_help_
   f_status_t fss_read_basic_list_print_message_help(fl_print_t * const print) {
index 2a7ffa93599a156211791d5c748c9b870592421c..62324200bddb98e4e5a4e92d1bcf5310e5fcefde 100644 (file)
@@ -29,14 +29,65 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @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 range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_basic_list_print_object_end_content_
+  extern f_status_t fss_read_basic_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_basic_list_print_object_end_content_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the end of the Content when no 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 a parameter is NULL.
  *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ * @see fss_read_print_content_empty()
  */
-#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_
+#ifndef _di_fss_read_basic_list_print_object_end_empty_
+  extern f_status_t fss_read_basic_list_print_object_end_empty(fl_print_t * const print);
+#endif // _di_fss_read_basic_list_print_object_end_empty_
 
 /**
  * Print help for FSS-0002 (Basic List).
index 488bad7e3d581fa158c2241f93b4ec3dae9b94e8..41573263d2d3e6122359ff3a3548beae37d0cfdb 100644 (file)
@@ -36,11 +36,12 @@ 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_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_data_object_end;
+  data.callback.print_object_end = &fss_read_embedded_list_print_object_end;
+  data.callback.print_object_end_content = &fss_read_embedded_list_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_embedded_list_print_object_end_empty;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
index ae2b29f0cd5f3579f996d281330e414becd4dce1..dc5e6aaec7341b61d600d13124c6e8cecbfee4d8 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#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) {
+#ifndef _di_fss_read_embedded_list_print_object_end_
+  f_status_t fss_read_embedded_list_print_object_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -16,37 +16,69 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
       f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
     }
+    else if (main->setting.flag & fss_read_main_flag_content_d) {
+      f_print_dynamic_raw(f_fss_embedded_list_open_s, print->to);
+      f_print_dynamic_raw(f_fss_embedded_list_open_end_s, print->to);
+    }
     else {
-      if (main->setting.flag & fss_read_main_flag_content_d) {
-        f_print_dynamic_raw(f_fss_embedded_list_open_s, print->to);
-        f_print_dynamic_raw(f_fss_embedded_list_open_end_s, print->to);
-      }
-      else {
-        f_print_dynamic_raw(f_fss_eol_s, print->to);
-      }
+      f_print_dynamic_raw(f_fss_eol_s, print->to);
     }
 
     f_file_stream_unlock(print->to);
 
     return F_okay;
   }
-#endif // _di_fss_read_embedded_list_print_data_object_end_
+#endif // _di_fss_read_embedded_list_print_object_end_
+
+#ifndef _di_fss_read_embedded_list_print_object_end_content_
+  f_status_t fss_read_embedded_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_embedded_list_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_embedded_list_print_object_end_content_
+
+#ifndef _di_fss_read_embedded_list_print_object_end_empty_
+  f_status_t fss_read_embedded_list_print_object_end_empty(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
 
-#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) {
+    const f_status_t status_1 = fss_read_embedded_list_print_object_end(print);
+    const f_status_t status_2 = fss_read_print_content_empty(print);
+
+    if (F_status_is_error(status_1)) return status_1;
+    if (F_status_is_error(status_2)) return status_2;
+
+    return (status_1 == F_okay || status_2 == F_okay) ? F_okay: F_output_not;
+  }
+#endif // _di_fss_read_embedded_list_print_object_end_empty_
+
+#ifndef _di_fss_read_embedded_list_print_set_end_
+  f_status_t fss_read_embedded_list_print_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->setting.flag & fss_read_main_flag_object_d) && main->setting.flag & fss_read_main_flag_content_d) {
+    if ((main->setting.flag & fss_read_main_flag_object_d) && (main->setting.flag & fss_read_main_flag_content_d)) {
+      f_file_stream_lock(print->to);
+
       f_print_dynamic_raw(f_fss_embedded_list_close_s, print->to);
       f_print_dynamic_raw(f_fss_embedded_list_close_end_s, print->to);
+
+      f_file_stream_unlock(print->to);
+    }
+    else {
+      return F_output_not;
     }
 
     return F_okay;
   }
-#endif // _di_fss_read_embedded_list_print_data_set_end_
+#endif // _di_fss_read_embedded_list_print_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) {
index 3afa41c21c26b563155c0022352f4679052d6156..406e0d277b599892675685798be8d79a8fe9b605 100644 (file)
@@ -29,17 +29,44 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
  *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @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 range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_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_
+#ifndef _di_fss_read_embedded_list_print_object_end_content_
+  extern f_status_t fss_read_embedded_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_embedded_list_print_object_end_content_
 
 /**
- * Print the end of an Object/Content set.
+ * Print the end of an Object (which is often the start of Content) and the end of the Content when no Content.
  *
  * This locks, uses, and unlocks the file stream.
  *
@@ -56,13 +83,33 @@ extern "C" {
  *
  *   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()
+ * @see fss_read_print_content_empty()
+ */
+#ifndef _di_fss_read_embedded_list_print_object_end_empty_
+  extern f_status_t fss_read_embedded_list_print_object_end_empty(fl_print_t * const print);
+#endif // _di_fss_read_embedded_list_print_object_end_empty_
+
+/**
+ * Print the end of an Object/Content 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.
  */
-#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_
+#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_
 
 /**
  * Print help for FSS-0008 (Embedded List).
index bdfb48c471644aeaf9db1ee75d533555d0e132d0..178c85dc926787dd037a85dc58f8e3a8021e4e64 100644 (file)
@@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.program.output.custom = (void *) &data;
   data.program.warning.custom = (void *) &data;
 
-  data.setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d;
+  data.setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d | fss_read_main_flag_content_end_d;
   data.setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d;
 
   data.setting.state.custom = (void *) &data;
@@ -36,11 +36,12 @@ 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_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_data_content_next;
+  data.callback.print_content_next = &fss_read_extended_print_content_next;
   data.callback.print_object = &fss_read_print_object;
-  data.callback.print_object_end = &fss_read_extended_print_data_object_end;
+  data.callback.print_object_end = &fss_read_extended_print_object_end;
+  data.callback.print_object_end_content = &fss_read_extended_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_print_content_empty;
   data.callback.print_set_end = &fss_read_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
index 234021c163d08d46bf8cf62eae3ca8607deb8225..98d07307fa6638dca9d1bb73560e307ec5f4c38c 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_extended_print_data_content_next_
-  f_status_t fss_read_extended_print_data_content_next(fl_print_t * const print) {
+#ifndef _di_fss_read_extended_print_content_next_
+  f_status_t fss_read_extended_print_content_next(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -14,30 +14,43 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_content_d) {
       fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_start_s : f_fss_extended_next_s, print->to);
     }
+    else {
+      return F_output_not;
+    }
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_print_data_content_next_
+#endif // _di_fss_read_extended_print_content_next_
 
-#ifndef _di_fss_read_extended_print_data_object_end_
-  f_status_t fss_read_extended_print_data_object_end(fl_print_t * const print) {
+#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_d) {
-      if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
-        fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
-      }
-      else {
-        fll_print_dynamic_raw(f_fss_extended_open_s, print->to);
-      }
+      fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_start_s : f_fss_extended_open_s, print->to);
+    }
+    else {
+      return F_output_not;
     }
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_print_data_object_end_
+#endif // _di_fss_read_extended_print_object_end_
+
+#ifndef _di_fss_read_extended_print_object_end_content_
+  f_status_t fss_read_extended_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_extended_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_extended_print_object_end_content_
 
 #ifndef _di_fss_read_extended_print_message_help_
   f_status_t fss_read_extended_print_message_help(fl_print_t * const print) {
index e9b5197a6db660d3eff19c49bfcc2b0d02f38834..5c02ffb8fe4d53e7fe3bc2c48d1730bbe9fe4089 100644 (file)
@@ -31,12 +31,10 @@ extern "C" {
  *   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_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_
+#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_
 
 /**
  * Print the end of an Object (which is often the start of Content).
@@ -55,12 +53,41 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @param print
+ *   The output structure to print to.
  *
- * @see fll_print_dynamic_raw()
+ *   The print.custom is expected to be of type fss_read_main_t.
+ *
+ *   This does not alter print.custom.setting.state.status.
+ * @param range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_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_
+#ifndef _di_fss_read_extended_print_object_end_content_
+  extern f_status_t fss_read_extended_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_extended_print_object_end_content_
 
 /**
  * Print help for FSS-0001 (Extended).
index a60f176c2e7f731725f8b7cfe1a9e3b25e23ac28..1b093f7f24495c5be8deed333f64b14a62000620 100644 (file)
@@ -35,12 +35,13 @@ 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_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_data_object_end;
-  data.callback.print_set_end = &fss_read_extended_list_print_data_set_end;
+  data.callback.print_object_end = &fss_read_extended_list_print_object_end;
+  data.callback.print_object_end_content = &fss_read_extended_list_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_extended_list_print_object_end;
+  data.callback.print_set_end = &fss_read_extended_list_print_set_end;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
index 3dd8c6449c1d86abc2f24ede360ab0be2cd012f5..82c3a879dacc34495b8e7546c80acb85f1724d03 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#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) {
+#ifndef _di_fss_read_extended_list_print_object_end_
+  f_status_t fss_read_extended_list_print_object_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -16,37 +16,69 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
       f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
     }
+    else if (main->setting.flag & fss_read_main_flag_content_d) {
+      f_print_dynamic_raw(f_fss_extended_list_open_s, print->to);
+      f_print_dynamic_raw(f_fss_extended_list_open_end_s, print->to);
+    }
     else {
-      if (main->setting.flag & fss_read_main_flag_content_d) {
-        f_print_dynamic_raw(f_fss_extended_list_open_s, print->to);
-        f_print_dynamic_raw(f_fss_extended_list_open_end_s, print->to);
-      }
-      else {
-        f_print_dynamic_raw(f_fss_eol_s, print->to);
-      }
+      f_print_dynamic_raw(f_fss_eol_s, print->to);
     }
 
     f_file_stream_unlock(print->to);
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_list_print_data_object_end_
+#endif // _di_fss_read_extended_list_print_object_end_
+
+#ifndef _di_fss_read_extended_list_print_object_end_empty_
+  f_status_t fss_read_extended_list_print_object_end_empty(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
+
+    const f_status_t status_1 = fss_read_extended_list_print_object_end(print);
+    const f_status_t status_2 = fss_read_print_content_empty(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 (F_status_is_error(status_1)) return status_1;
+    if (F_status_is_error(status_2)) return status_2;
+
+    return (status_1 == F_okay || status_2 == F_okay) ? F_okay: F_output_not;
+  }
+#endif // _di_fss_read_extended_list_print_object_end_empty_
+
+#ifndef _di_fss_read_extended_list_print_object_end_content_
+  f_status_t fss_read_extended_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_extended_list_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_extended_list_print_object_end_content_
+
+#ifndef _di_fss_read_extended_list_print_set_end_
+  f_status_t fss_read_extended_list_print_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->setting.flag & fss_read_main_flag_object_d) && main->setting.flag & fss_read_main_flag_content_d) {
+      f_file_stream_lock(print->to);
+
       f_print_dynamic_raw(f_fss_extended_list_close_s, print->to);
       f_print_dynamic_raw(f_fss_extended_list_close_end_s, print->to);
+
+      f_file_stream_unlock(print->to);
+    }
+    else {
+      return F_output_not;
     }
 
     return F_okay;
   }
-#endif // _di_fss_read_extended_list_print_data_set_end_
+#endif // _di_fss_read_extended_list_print_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) {
index 8aa3b0dad18630cb4bcc9e6832829bc0b2547db0..bcc5a09b41aaa03d0df868936a24efc449b3b9a1 100644 (file)
@@ -29,15 +29,44 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
  *
- * @see fll_print_dynamic_raw()
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @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 range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_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_
+#ifndef _di_fss_read_extended_list_print_object_end_content_
+  extern f_status_t fss_read_extended_list_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_extended_list_print_object_end_content_
 
 /**
- * Print the end of an Object/Content set.
+ * Print the end of an Object (which is often the start of Content) and the end of the Content when no Content.
  *
  * This locks, uses, and unlocks the file stream.
  *
@@ -54,13 +83,34 @@ extern "C" {
  *
  *   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()
+ * @see fss_read_extended_list_print_object_end()
+ * @see fss_read_print_content_empty()
+ */
+#ifndef _di_fss_read_extended_list_print_object_end_empty_
+  extern f_status_t fss_read_extended_list_print_object_end_empty(fl_print_t * const print);
+#endif // _di_fss_read_extended_list_print_object_end_empty_
+
+/**
+ * Print the end of an Object/Content 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.
  */
-#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_
+#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_
 
 /**
  * Print help for FSS-0003 (Extended List).
index 56cbbc758becdbcd948210fac7271975c20635a0..4ed94e63b0c01d8161086a5a99b0c80bca6dc18e 100644 (file)
@@ -54,6 +54,7 @@ extern "C" {
  *   - at:                     The object at the given position is being selected (Think of this as select a row for some Object).
  *   - columns:                The total columns found and selected is printed instead of the Content.
  *   - content:                The Content is to be printed.
+ *   - content_end:            Print the Content end set even if there is no Content (some standards like FSS-0000 and FSS-0001 require this).
  *   - content_has_close:      The Content has a closing character which needs to be counted and handled when processing both Object and Content, but is otherwise not processed or printed.
  *   - content_multiple:       Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object.
  *   - copyright:              Print copyright.
@@ -88,34 +89,35 @@ extern "C" {
   #define fss_read_main_flag_at_d                     0x1
   #define fss_read_main_flag_columns_d                0x2
   #define fss_read_main_flag_content_d                0x4
-  #define fss_read_main_flag_content_has_close_d      0x8
-  #define fss_read_main_flag_content_multiple_d       0x10
-  #define fss_read_main_flag_copyright_d              0x20
-  #define fss_read_main_flag_delimit_d                0x40
-  #define fss_read_main_flag_depth_d                  0x80
-  #define fss_read_main_flag_depth_multiple_d         0x100
-  #define fss_read_main_flag_empty_d                  0x200
-  #define fss_read_main_flag_help_d                   0x400
-  #define fss_read_main_flag_line_d                   0x800
-  #define fss_read_main_flag_line_single_d            0x1000
-  #define fss_read_main_flag_name_d                   0x2000
-  #define fss_read_main_flag_object_d                 0x4000
-  #define fss_read_main_flag_object_as_line_d         0x8000
-  #define fss_read_main_flag_object_trim_d            0x10000
-  #define fss_read_main_flag_original_d               0x20000
-  #define fss_read_main_flag_payload_create_d         0x40000
-  #define fss_read_main_flag_payload_error_d          0x80000
-  #define fss_read_main_flag_payload_warn_d           0x100000
-  #define fss_read_main_flag_pipe_d                   0x200000
-  #define fss_read_main_flag_pipe_format_d            0x400000
-  #define fss_read_main_flag_quote_content_d          0x800000
-  #define fss_read_main_flag_quote_object_d           0x1000000
-  #define fss_read_main_flag_select_d                 0x2000000
-  #define fss_read_main_flag_total_d                  0x4000000
-  #define fss_read_main_flag_trim_d                   0x8000000
-  #define fss_read_main_flag_trim_object_d            0x10000000
-  #define fss_read_main_flag_version_d                0x20000000
-  #define fss_read_main_flag_version_copyright_help_d 0x20000420
+  #define fss_read_main_flag_content_end_d            0x8
+  #define fss_read_main_flag_content_has_close_d      0x10
+  #define fss_read_main_flag_content_multiple_d       0x20
+  #define fss_read_main_flag_copyright_d              0x40
+  #define fss_read_main_flag_delimit_d                0x80
+  #define fss_read_main_flag_depth_d                  0x100
+  #define fss_read_main_flag_depth_multiple_d         0x200
+  #define fss_read_main_flag_empty_d                  0x400
+  #define fss_read_main_flag_help_d                   0x800
+  #define fss_read_main_flag_line_d                   0x1000
+  #define fss_read_main_flag_line_single_d            0x2000
+  #define fss_read_main_flag_name_d                   0x4000
+  #define fss_read_main_flag_object_d                 0x8000
+  #define fss_read_main_flag_object_as_line_d         0x10000
+  #define fss_read_main_flag_object_trim_d            0x20000
+  #define fss_read_main_flag_original_d               0x40000
+  #define fss_read_main_flag_payload_create_d         0x80000
+  #define fss_read_main_flag_payload_error_d          0x100000
+  #define fss_read_main_flag_payload_warn_d           0x200000
+  #define fss_read_main_flag_pipe_d                   0x400000
+  #define fss_read_main_flag_pipe_format_d            0x800000
+  #define fss_read_main_flag_quote_content_d          0x1000000
+  #define fss_read_main_flag_quote_object_d           0x2000000
+  #define fss_read_main_flag_select_d                 0x4000000
+  #define fss_read_main_flag_total_d                  0x8000000
+  #define fss_read_main_flag_trim_d                   0x10000000
+  #define fss_read_main_flag_trim_object_d            0x20000000
+  #define fss_read_main_flag_version_d                0x40000000
+  #define fss_read_main_flag_version_copyright_help_d 0x40000840
 #endif // _di_fss_read_main_flag_d_
 
 /**
index 4c48614b7cea40b7c4ae9e674dde47fc1fec72f2..b44488391b3b9e6df4257b2cff474f9d4162cc67 100644 (file)
@@ -128,14 +128,16 @@ 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_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.
+ * 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_object_end_content: Print both the Object end and the Content.
+ * print_object_end_empty:   Print the Object end when there is no Content, some standards print this and other standards print nothing (This also handles the Object end pipe).
+ * print_set_end:            Print the Content set end, usually called by several callbacks within the process_normal() callback.
+ * print_set_end_empty:      Print set end for cases where the Content is empty and only something like a closing new line is required.
  */
 #ifndef _di_fss_read_callback_t_
   typedef struct {
@@ -152,12 +154,14 @@ 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_object_end_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)(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_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);
+    f_status_t (*print_object_end_empty)(fl_print_t * const print);
     f_status_t (*print_set_end)(fl_print_t * const print);
+    f_status_t (*print_set_end_empty)(fl_print_t * const print);
   } fss_read_callback_t;
 
   #define fss_read_callback_t_initialize \
@@ -179,6 +183,8 @@ extern "C" {
       0, \
       0, \
       0, \
+      0, \
+      0, \
     }
 #endif // _di_fss_read_callback_t_
 
index e78059198280b55f30d206d345c674ff336fa03f..173355fbbcfba931bd965b0b6e02dd7844812884 100644 (file)
@@ -111,11 +111,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
     main->callback.print_at = &fss_read_print_at;
     main->callback.print_content = &fss_read_print_content;
-    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_object_end = &fss_read_basic_print_object_end;
+    main->callback.print_object_end_content = &fss_read_basic_print_object_end_content;
+    main->callback.print_object_end_empty = &fss_read_print_content_empty;
     main->callback.print_set_end = &fss_read_print_set_end;
 
     main->setting.standard = fss_read_basic_standard_s;
@@ -129,7 +130,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
     main->setting.flag &= ~fss_read_main_flag_payload_warn_d;
     main->setting.flag &= ~fss_read_main_flag_trim_object_d;
 
-    main->setting.flag |= fss_read_main_flag_line_single_d;
+    main->setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_end_d;
     main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d;
 
     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) {
@@ -153,7 +154,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->setting.flag &= ~fss_read_main_flag_payload_warn_d;
         main->setting.flag &= ~fss_read_main_flag_trim_object_d;
 
-        main->setting.flag |= fss_read_main_flag_line_single_d;
+        main->setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_end_d;
         main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d;
 
         main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
@@ -162,12 +163,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         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_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_object_end = &fss_read_basic_print_object_end;
+        main->callback.print_object_end_content = &fss_read_basic_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_print_content_empty;
         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 ||
@@ -186,7 +186,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->setting.flag &= ~fss_read_main_flag_payload_warn_d;
         main->setting.flag &= ~fss_read_main_flag_trim_object_d;
 
-        main->setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d;
+        main->setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d | fss_read_main_flag_content_end_d;
         main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d;
 
         main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
@@ -195,9 +195,10 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->callback.process_load = &fss_read_extended_process_load;
         main->callback.process_total = &fss_read_process_normal_total;
 
-        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_content_next = &fss_read_extended_print_content_next;
+        main->callback.print_object_end = &fss_read_extended_print_object_end;
+        main->callback.print_object_end_content = &fss_read_extended_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_print_content_empty;
         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 ||
@@ -208,6 +209,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->setting.standard = fss_read_basic_list_standard_s;
 
         // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_end_d;
         main->setting.flag &= ~fss_read_main_flag_content_has_close_d;
         main->setting.flag &= ~fss_read_main_flag_content_multiple_d;
         main->setting.flag &= ~fss_read_main_flag_depth_multiple_d;
@@ -225,9 +227,10 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         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_set = 0;
         main->callback.print_content_next = 0;
-        main->callback.print_object_end = &fss_read_basic_list_print_data_object_end;
+        main->callback.print_object_end = &fss_read_basic_list_print_object_end;
+        main->callback.print_object_end_content = &fss_read_basic_list_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_basic_list_print_object_end_empty;
         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 ||
@@ -239,6 +242,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
         // Remove flags not supported for this standard.
         main->setting.flag &= ~fss_read_main_flag_line_single_d;
+        main->setting.flag &= ~fss_read_main_flag_content_end_d;
         main->setting.flag &= ~fss_read_main_flag_content_multiple_d;
         main->setting.flag &= ~fss_read_main_flag_depth_multiple_d;
         main->setting.flag &= ~fss_read_main_flag_payload_error_d;
@@ -255,10 +259,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         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_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;
+        main->callback.print_object_end = &fss_read_extended_list_print_object_end;
+        main->callback.print_object_end_content = &fss_read_extended_list_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_extended_list_print_object_end_empty;
+        main->callback.print_set_end = &fss_read_extended_list_print_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 ||
@@ -268,6 +273,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->setting.standard = fss_read_embedded_list_standard_s;
 
         // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_end_d;
         main->setting.flag &= ~fss_read_main_flag_content_has_close_d;
         main->setting.flag &= ~fss_read_main_flag_line_single_d;
         main->setting.flag &= ~fss_read_main_flag_payload_error_d;
@@ -285,10 +291,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         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_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;
+        main->callback.print_object_end = &fss_read_embedded_list_print_object_end;
+        main->callback.print_object_end_content = &fss_read_embedded_list_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_embedded_list_print_object_end_empty;
+        main->callback.print_set_end = &fss_read_embedded_list_print_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 ||
@@ -298,6 +305,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->setting.standard = fss_read_payload_standard_s;
 
         // Remove flags not supported for this standard.
+        main->setting.flag &= ~fss_read_main_flag_content_end_d;
         main->setting.flag &= ~fss_read_main_flag_content_has_close_d;
         main->setting.flag &= ~fss_read_main_flag_content_multiple_d;
         main->setting.flag &= ~fss_read_main_flag_depth_multiple_d;
@@ -314,9 +322,10 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
         main->callback.process_load = &fss_read_payload_process_load;
         main->callback.process_total = &fss_read_process_normal_total_multiple;
 
-        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_object_end = &fss_read_payload_print_object_end;
+        main->callback.print_object_end_content = &fss_read_payload_print_object_end_content;
+        main->callback.print_object_end_empty = &fss_read_payload_print_object_end_empty;
         main->callback.print_set_end = &fss_read_print_set_end_no_eol;
       }
       else {
index bea80aa462eb2e3b7bb2f0051d451a6640889cad..7f8cf20a8591e99b5cca20f05d37039f808b3b24 100644 (file)
@@ -13,61 +13,116 @@ extern "C" {
 
     if (at >= main->setting.contents.used) return F_output_not;
 
-    bool print_set_end = F_false;
+    if (!(main->setting.flag & fss_read_main_flag_object_d)) {
+      if (!(main->setting.flag & fss_read_main_flag_content_d) || (!main->setting.contents.array[at].used && !(main->setting.flag & fss_read_main_flag_empty_d))) {
+        return F_okay;
+      }
+    }
 
-    if ((main->setting.flag & fss_read_main_flag_object_d) || (main->setting.flag & fss_read_main_flag_content_d) && (main->setting.contents.array[at].used || (main->setting.flag & fss_read_main_flag_empty_d))) {
-      if (main->setting.flag & fss_read_main_flag_object_d) {
-        if (main->callback.print_object) {
-          main->callback.print_object(&main->program.output, at, delimits_object);
-        }
+    // 0x1 = object printed, 0x2 = content printed, 0x4 = object end printed, 0x8 = content is empty, 0x10 = select is out of range.
+    uint8_t print_state = 0x0;
 
-        if (main->callback.print_object_end) {
-          main->callback.print_object_end(&main->program.output);
-        }
+    if (main->setting.flag & fss_read_main_flag_object_d) {
+      if (main->callback.print_object) {
+        print_state = 0x1;
 
-        print_set_end = F_true;
+        main->callback.print_object(&main->program.output, at, delimits_object);
       }
+    }
 
-      if (main->setting.flag & fss_read_main_flag_content_d) {
-        if (main->setting.flag & fss_read_main_flag_select_d) {
-          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);
-                }
+    if (main->setting.flag & fss_read_main_flag_content_d) {
+      if (main->setting.flag & fss_read_main_flag_select_d) {
+        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) {
+          if (main->callback.print_content && main->callback.print_object_end_content) {
+            if (print_state & 0x1) {
+              if (main->callback.print_object_end_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) != F_output_not) {
+                print_state |= 0x6;
               }
-              else {
-                print_set_end = F_true;
+            }
+            else {
+              if (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) != F_output_not) {
+                print_state |= 0x2;
               }
             }
           }
-          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;
+        else {
+          print_state |= (main->setting.select < main->setting.contents.array[at].used) ? 0x8 : 0x18;
+        }
+      }
+      else if (main->setting.contents.array[at].used) {
+        if (main->callback.print_content && main->callback.print_object_end_content) {
+          f_number_unsigned_t i = 0;
 
-          if (main->callback.print_content) {
-            for (f_number_unsigned_t i = 0; i < main->setting.contents.array[at].used; ++i) {
+          // Loop through with conditionals only when necessary for performance reasons.
+          for (print_state |= 0x8; i < main->setting.contents.array[at].used; ++i) {
 
-              main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+            if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
+              print_state &= ~0x8;
 
-              if (main->callback.print_content_next && i + 1 < main->setting.contents.array[at].used) {
+              if (print_state & 0x1) {
+                if (main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content) != F_output_not) {
+                  print_state |= 0x6;
+                }
+              }
+              else {if (main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content) != F_output_not) {
+                  print_state |= 0x2;
+                }
+              }
+
+              ++i;
+
+              break;
+            }
+          } // for
+
+          for (; i < main->setting.contents.array[at].used; ++i) {
+
+            if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
+              if (main->callback.print_content_next) {
                 main->callback.print_content_next(&main->program.output);
               }
-            } // for
+
+              main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+            }
+          } // for
+        }
+      }
+      else {
+        print_state |= 0x8;
+      }
+
+      if (print_state & 0x8) {
+        if (print_state & 0x1) {
+          if (!(print_state & 0x4) && main->callback.print_object_end_empty) {
+            main->callback.print_object_end_empty(&main->program.output);
           }
         }
-        else if (main->callback.print_content_empty_set) {
-          main->callback.print_content_empty_set(&main->program.output);
+
+        if ((print_state & 0x1) || !(print_state & 0x10)) {
+          if (main->callback.print_set_end) {
+            main->callback.print_set_end(&main->program.output);
+          }
         }
       }
+      else {
+        if ((print_state & 0x3) != 0x3 && (print_state & 0x1)) {
+          if (!(print_state & 0x4) && main->callback.print_object_end) {
+            main->callback.print_object_end(&main->program.output);
+          }
+        }
 
-      if (print_set_end && main->callback.print_set_end) {
+        if (main->callback.print_set_end) {
+          main->callback.print_set_end(&main->program.output);
+        }
+      }
+    }
+    else if (print_state & 0x1) {
+      if (main->callback.print_object_end_empty) {
+        main->callback.print_object_end_empty(&main->program.output);
+      }
+
+      if (main->callback.print_set_end) {
         main->callback.print_set_end(&main->program.output);
       }
     }
@@ -109,31 +164,35 @@ 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) {
+#ifndef _di_fss_read_print_content_empty_
+  f_status_t fss_read_print_content_empty(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_d)) {
-      main->callback.print_set_end(print);
+    if ((main->setting.flag & fss_read_main_flag_content_d) && (main->setting.flag & fss_read_main_flag_pipe_format_d)) {
+      fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
+    }
+    else {
+      return F_output_not;
     }
 
     return F_okay;
   }
-#endif // _di_fss_read_print_content_empty_set_end_
+#endif // _di_fss_read_print_content_empty_
 
 #ifndef _di_fss_read_print_content_ignore_
   f_status_t fss_read_print_content_ignore(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
+    if (((fss_read_main_t *) print->custom)->setting.flag & fss_read_main_flag_pipe_format_d) {
       fll_print_dynamic_raw(fss_read_pipe_content_ignore_s, print->to);
     }
+    else {
+      return F_output_not;
+    }
 
     return F_okay;
   }
@@ -196,6 +255,18 @@ extern "C" {
   }
 #endif // _di_fss_read_print_object_
 
+#ifndef _di_fss_read_print_object_content_
+  f_status_t fss_read_print_object_content(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content) {
+
+    {
+      const f_status_t status = fss_read_print_object(print, at, delimits_object);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits_content);
+  }
+#endif // _di_fss_read_print_object_content_
+
 #ifndef _di_fss_read_print_quote_
   f_status_t fss_read_print_quote(fl_print_t * const print, const uint8_t type) {
 
@@ -211,6 +282,9 @@ extern "C" {
         print->to
       );
     }
+    else {
+      return F_output_not;
+    }
 
     return F_okay;
   }
@@ -221,9 +295,7 @@ extern "C" {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_end_s : f_string_eol_s, print->to);
+    fll_print_dynamic_raw((((fss_read_main_t *) print->custom)->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_end_s : f_string_eol_s, print->to);
 
     return F_okay;
   }
@@ -234,11 +306,12 @@ extern "C" {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
-    fss_read_main_t * const main = (fss_read_main_t *) print->custom;
-
-    if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
+    if (((fss_read_main_t *) print->custom)->setting.flag & fss_read_main_flag_pipe_format_d) {
       fll_print_dynamic_raw(fss_read_pipe_content_end_s, print->to);
     }
+    else {
+      return F_output_not;
+    }
 
     return F_okay;
   }
index aa24aa33da8ec696df5f3b41d12df6644f1ee1a2..35ee3302cacbf313615a008c288e5c2ec54a4c3a 100644 (file)
@@ -44,11 +44,6 @@ extern "C" {
  *
  *   F_output_not (with error bit) if a parameter is NULL.
  *
- * @see fll_print_dynamic_partial()
- * @see fll_print_except_dynamic_partial()
- * @see fll_print_trim_dynamic_partial()
- * @see fll_print_trim_except_dynamic_partial()
- *
  * @see main.callback.print_content()
  * @see main.callback.print_object()
  * @see main.callback.print_object_end()
@@ -85,7 +80,6 @@ extern "C" {
  *
  *   F_output_not (with error bit) if a parameter is NULL.
  *
- * @see fll_print_except_in_dynamic_partial()
  * @see main.callback.print_content()
  * @see main.callback.print_object_end()
  * @see main.callback.print_set_end()
@@ -95,10 +89,15 @@ 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.
+ * Print the "empty" Content.
  *
  * This locks, uses, and unlocks the file stream.
  *
+ * This only prints the end Content start pipe character.
+ * This does not print the Content end pipe character to avoid conflicting with the calls to the set end function.
+ *
+ * This does not print the Content set end.
+ *
  * @param print
  *   The output structure to print to.
  *
@@ -111,12 +110,10 @@ extern "C" {
  *   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_
+#ifndef _di_fss_read_print_content_empty_
+  extern f_status_t fss_read_print_content_empty(fl_print_t * const print);
+#endif // _di_fss_read_print_content_empty_
 
 /**
  * Print the ignore character for Content.
@@ -161,8 +158,6 @@ extern "C" {
  *   F_output_not on success, but no printing is performed.
  *
  *   F_output_not (with error bit) if a parameter is NULL.
- *
- * @see fll_print_format()
  */
 #ifndef _di_fss_read_print_number_
   extern f_status_t fss_read_print_number(fl_print_t * const print, const f_number_unsigned_t number);
@@ -192,19 +187,47 @@ extern "C" {
  *   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_partial()
- * @see fll_print_except_dynamic_partial()
- * @see fll_print_trim_dynamic_partial()
- * @see fll_print_trim_except_dynamic_partial()
- *
- * @see fss_read_print_quote()
  */
 #ifndef _di_fss_read_print_object_
   extern f_status_t fss_read_print_object(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits);
 #endif // _di_fss_read_print_object_
 
 /**
+ * Print the Object at the given Object index position and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * Different standards may want to call this before they perform their final printing.
+ *
+ * @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 at
+ *   The Object index to be printed.
+ * @param range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits_object
+ *   The delimits array representing a delimited Object.
+ *   This represents the positions within the current Object at the "at" position.
+ * @param delimits_content
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_print_object_content_
+  extern f_status_t fss_read_print_object_content(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
+#endif // _di_fss_read_print_object_content_
+
+/**
  * Print the Object at the given Object index position.
  *
  * This locks, uses, and unlocks the file stream.
@@ -226,8 +249,6 @@ extern "C" {
  *   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_quote_
   extern f_status_t fss_read_print_quote(fl_print_t * const print, const uint8_t type);
@@ -250,8 +271,6 @@ extern "C" {
  *   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_set_end_
   extern f_status_t fss_read_print_set_end(fl_print_t * const print);
@@ -276,8 +295,6 @@ extern "C" {
  *   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_set_end_no_eol_
   extern f_status_t fss_read_print_set_end_no_eol(fl_print_t * const print);
index 1d82c71078964b1530a9ffeaf4b61e823b28fff2..6f6561bad2d68b9defdc59c2121bb0419f5e5473 100644 (file)
@@ -11,8 +11,6 @@ extern "C" {
 
     fss_read_main_t * const main = (fss_read_main_t *) void_main;
 
-    // @todo note that embedded list will probably need to implement its own version of this function (aka: fss_read_process_embedded).
-
     // For depth, most standards do not support nesting, so any depth greater than 0 can be predicted without processing the buffer.
     // For select, most standards do not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
     if (!(main->setting.flag & fss_read_main_flag_depth_multiple_d) && main->setting.depths.array[0].depth || !(main->setting.flag & fss_read_main_flag_content_multiple_d) && ((main->setting.flag & fss_read_main_flag_select_d) && main->setting.select)) {
@@ -71,6 +69,7 @@ extern "C" {
     }
     else if (main->setting.flag & fss_read_main_flag_at_d) {
       if (main->callback.process_at) {
+
         main->callback.process_at(main, names, *delimits_object, *delimits_content);
       }
     }
@@ -224,7 +223,7 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_content_d) {
       if (!main->setting.contents.array[at].used) {
 
-        // Must process/count line when both Object and Content share the same line but Content is empty for single line Content.
+        // Must process/count line when both Object and Content share the same line and Content is empty for single line Content.
         if ((main->setting.flag & fss_read_main_flag_line_single_d)) {
           if (main->setting.flag & fss_read_main_flag_object_d) {
             if (!(main->setting.flag & fss_read_main_flag_object_as_line_d)) {
@@ -243,8 +242,8 @@ extern "C" {
           }
           else if (main->setting.flag & fss_read_main_flag_empty_d) {
             if (*line == main->setting.line) {
-              if (main->callback.print_content_empty_set) {
-                main->callback.print_content_empty_set(&main->program.output);
+              if (main->callback.print_set_end) {
+                main->callback.print_set_end(&main->program.output);
               }
 
               main->setting.state.status = F_success;
@@ -256,9 +255,11 @@ extern "C" {
           }
         }
         else {
-          if (main->callback.print_content_empty_set) {
+          if (main->setting.flag & fss_read_main_flag_empty_d) {
             if (*line == main->setting.line) {
-              main->callback.print_content_empty_set(&main->program.output);
+              if (main->callback.print_set_end) {
+                main->callback.print_set_end(&main->program.output);
+              }
 
               main->setting.state.status = F_success;
 
@@ -278,18 +279,20 @@ extern "C" {
 
       if (main->setting.flag & fss_read_main_flag_line_single_d) {
         if (*line == main->setting.line) {
-          while (main->setting.contents.array[at].used) {
+          if (main->setting.contents.array[at].used) {
+            for (;;) {
 
-            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 (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);
+              }
+            } // for
+          }
 
           if (main->callback.print_set_end) {
             main->callback.print_set_end(&main->program.output);
@@ -352,8 +355,7 @@ extern "C" {
         } // for
       }
 
-      // @fixme The fll_fss_*_read functions do not have a store of the set closing ranges but should.
-      //        Simulate the ending by printing, but the original range should ideally be used (add new features to accomplish this).
+      // Simulate the ending by printing.
       if ((main->setting.flag & fss_read_main_flag_object_d) && (main->setting.flag & fss_read_main_flag_content_has_close_d)) {
         if (*line == main->setting.line) {
           if (main->callback.print_set_end) {
index bad567d2b5fa1f061d4543f1b2afe11493fd5e69..55e72f191bd6c6a9d2400e0f19e8466d7b5cb30f 100644 (file)
@@ -35,11 +35,12 @@ 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_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_data_object_end;
+  data.callback.print_object_end = &fss_read_payload_print_object_end;
+  data.callback.print_object_end_content = &fss_read_payload_print_object_end_content;
+  data.callback.print_object_end_empty = &fss_read_payload_print_object_end_empty;
   data.callback.print_set_end = &fss_read_print_set_end_no_eol;
 
   f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
index 91a39ac1c43524a4b9f2420c9aa4e54d1643f699..e171fd159e63a71729bd8b08e83dec5ecf8a8ade 100644 (file)
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#ifndef _di_fss_read_payload_print_data_object_end_
-  f_status_t fss_read_payload_print_data_object_end(fl_print_t * const print) {
+#ifndef _di_fss_read_payload_print_object_end_
+  f_status_t fss_read_payload_print_object_end(fl_print_t * const print) {
 
     if (!print || !print->custom) return F_status_set_error(F_output_not);
 
@@ -16,21 +16,46 @@ extern "C" {
     if (main->setting.flag & fss_read_main_flag_pipe_format_d) {
       f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to);
     }
+    else if (main->setting.flag & fss_read_main_flag_content_d) {
+      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 {
-      if (main->setting.flag & fss_read_main_flag_content_d) {
-        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_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_
+#endif // _di_fss_read_payload_print_object_end_
+
+#ifndef _di_fss_read_payload_print_object_end_content_
+  f_status_t fss_read_payload_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits) {
+
+    {
+      const f_status_t status = fss_read_payload_print_object_end(print);
+      if (F_status_is_error(status) || status == F_output_not) return status;
+    }
+
+    return fss_read_print_content(print, range, quote, delimits);
+  }
+#endif // _di_fss_read_payload_print_object_end_content_
+
+#ifndef _di_fss_read_payload_print_object_end_empty_
+  f_status_t fss_read_payload_print_object_end_empty(fl_print_t * const print) {
+
+    if (!print) return F_status_set_error(F_output_not);
+
+    const f_status_t status_1 = fss_read_payload_print_object_end(print);
+    const f_status_t status_2 = fss_read_print_content_empty(print);
+
+    if (F_status_is_error(status_1)) return status_1;
+    if (F_status_is_error(status_2)) return status_2;
+
+    return (status_1 == F_okay || status_2 == F_okay) ? F_okay: F_output_not;
+  }
+#endif // _di_fss_read_payload_print_object_end_empty_
 
 #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) {
index 4d5c4dfae1e07e8088798de2e7708e4b92516ae8..b7596755062dd222533551703e27cfe94d20b49a 100644 (file)
@@ -29,14 +29,66 @@ extern "C" {
  *   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_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_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the Content.
+ *
+ * This locks, uses, and unlocks the file stream.
+ *
+ * This processes single Content range.
+ * This does not print a new line after the Content.
+ *
+ * @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 range
+ *   The range within the buffer representing the Content to print.
+ * @param quote
+ *   The quote type representing the character to use (from the f_fss_quote_type_*_e).
+ * @param delimits
+ *   The delimits array representing a delimited Content.
+ *
+ * @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_readpayload_print_data_object_end_content_
+  extern f_status_t fss_read_payload_print_object_end_content(fl_print_t * const print, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+#endif // _di_fss_read_payload_print_object_end_content_
+
+/**
+ * Print the end of an Object (which is often the start of Content) and the end of the Content when no 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.
  *
- * @see f_file_stream_lock()
- * @see f_file_stream_unlock()
- * @see f_print_dynamic_raw()
+ *   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 fss_read_payload_print_object_end()
+ * @see fss_read_print_content_empty()
  */
-#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_
+#ifndef _di_fss_read_payload_print_object_end_empty_
+  extern f_status_t fss_read_payload_print_object_end_empty(fl_print_t * const print);
+#endif // _di_fss_read_payload_print_object_end_empty_
 
 /**
  * Print an error message about the payload parameter not having a valid value.
@@ -127,8 +179,6 @@ extern "C" {
  *   F_output_not on success, but no printing is performed.
  *
  *   F_output_not (with error bit) if setting is NULL.
- *
- * @see fll_error_print()
  */
 #ifndef _di_fss_read_payload_print_problem_payload_missing_
   extern f_status_t fss_read_payload_print_problem_payload_missing(fl_print_t * const print);
index ec131e873de68f74dc737ad3fdee56bd9caefb2c..c1ee9e1ca91b42442807b839f32968a64e1447b2 100644 (file)
@@ -129,32 +129,32 @@ verify_process:
   print
   print Verifying Tests for Basic (FSS-0000).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0000/ tests/runtime/fss_0000/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0000/ tests/runtime/fss_0000/expect/ "Basic (FSS-0000)"
 
   print
   print Verifying Tests for Extended (FSS-0001).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0001/ tests/runtime/fss_0001/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0001/ tests/runtime/fss_0001/expect/ "Extended (FSS-0001)"
 
   print
   print Verifying Tests for Basic List (FSS-0002).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0002/ tests/runtime/fss_0002/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0002/ tests/runtime/fss_0002/expect/ "Basic List (FSS-0002)"
 
   print
   print Verifying Tests for Extended List (FSS-0003).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0003/ tests/runtime/fss_0003/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0003/ tests/runtime/fss_0003/expect/ "Extended List (FSS-0003)"
 
   print
   print Verifying Tests for Embedded List (FSS-0008).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0008/ tests/runtime/fss_0008/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_0008/ tests/runtime/fss_0008/expect/ "Embedded List (FSS-0008)"
 
   print
   print Verifying Tests for Payload (FSS-000E).
   print
-  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_000e/ tests/runtime/fss_000e/expect/
+  run parameter:"script" ./tests/runtime/script/verify.sh build/test/fss_000e/ tests/runtime/fss_000e/expect/ "Payload (FSS-000E)"
 
 build_path:
   parameter build_path build/
index a476db9763b9d6239fe4a33c993108d86f6bc2b8..8b3f61bd4cc979185999595072f1feefb12a6bba 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out  
 UTF space! <-- should have the word 'space!'
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index e078c77e3cc2e447b67d76b4a163baef37db88f8..f16d422d06ea23cda2f4fadba3771e21c3f16439 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out  
 UTF space! <-- should have the word 'space!'
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index e078c77e3cc2e447b67d76b4a163baef37db88f8..f16d422d06ea23cda2f4fadba3771e21c3f16439 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out  
 UTF space! <-- should have the word 'space!'
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index e078c77e3cc2e447b67d76b4a163baef37db88f8..f16d422d06ea23cda2f4fadba3771e21c3f16439 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out  
 UTF space! <-- should have the word 'space!'
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index 289d8f71f0932d6e10c0389304751972e39bfa2e..9469ba0f4b474e7447d7b51d232c112753b35635 100644 (file)
@@ -1,15 +1,15 @@
-Hi 
-\\hi 
+Hi
+\\hi
 \\\\\"Hello you."
 \\" quoted stuff. so
+
 "" b
-" 
+"
 "" d
 "  f
-\\" sss 
-\\"\" xx 
-\\"\\\" 
+\\" sss
+\\"\" xx
+\\"\\\"
  zero
 #not comment...should have
 \#not comment
index 53d59f92554c5f34ebeeae85a2d19b8b295334ce..c1e8d1a0f37052638d906742b4e887c77946d53c 100644 (file)
@@ -1,21 +1,21 @@
-Hi 
-\\hi 
-\\\\\"Hello 
-\\" quoted stuff. 
-"" 
+Hi
+\\hi
+\\\\\"Hello
+\\" quoted stuff.
+
+""
+"
+""
 " 
-"" 
-"  
-\\" sss 
-\\"\" xx 
-\\"\\\" 
-#not 
-\#not 
-\\#not 
-a 
-a 
-a 
-мир 
-привет has space 
+\\" sss
+\\"\" xx
+\\"\\\"
+
+#not
+\#not
+\\#not
+a
+a
+a
+мир
+привет has space
index 53d59f92554c5f34ebeeae85a2d19b8b295334ce..c1e8d1a0f37052638d906742b4e887c77946d53c 100644 (file)
@@ -1,21 +1,21 @@
-Hi 
-\\hi 
-\\\\\"Hello 
-\\" quoted stuff. 
-"" 
+Hi
+\\hi
+\\\\\"Hello
+\\" quoted stuff.
+
+""
+"
+""
 " 
-"" 
-"  
-\\" sss 
-\\"\" xx 
-\\"\\\" 
-#not 
-\#not 
-\\#not 
-a 
-a 
-a 
-мир 
-привет has space 
+\\" sss
+\\"\" xx
+\\"\\\"
+
+#not
+\#not
+\\#not
+a
+a
+a
+мир
+привет has space
index 53d59f92554c5f34ebeeae85a2d19b8b295334ce..c1e8d1a0f37052638d906742b4e887c77946d53c 100644 (file)
@@ -1,21 +1,21 @@
-Hi 
-\\hi 
-\\\\\"Hello 
-\\" quoted stuff. 
-"" 
+Hi
+\\hi
+\\\\\"Hello
+\\" quoted stuff.
+
+""
+"
+""
 " 
-"" 
-"  
-\\" sss 
-\\"\" xx 
-\\"\\\" 
-#not 
-\#not 
-\\#not 
-a 
-a 
-a 
-мир 
-привет has space 
+\\" sss
+\\"\" xx
+\\"\\\"
+
+#not
+\#not
+\\#not
+a
+a
+a
+мир
+привет has space
index 893daaafff2f9527e805d70c391e23f68112700a..ca706930461a581d95c2bb2935bd58f7ed131446 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out
 UTF space! <-- should have the word 'space!'
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index e09261921d4042b5bd17d8b7b6a60ca2b764fa11..4732397ec4bf2487a5e5a13d4b23f647f8a07bdb 100644 (file)
@@ -1,11 +1,11 @@
-a 
-c 
-привет 
-мир 
-spaced 
-UTF 
-hi 
-a 
-a 
-a 
-привет has space 
+a
+c
+привет
+мир
+spaced
+UTF
+hi
+a
+a
+a
+привет has space
index 4344cdea5f99c5886272dcab56cfa36d2d9e9722..2e608881fb3355450929e4c508b37b419a6a054e 100644 (file)
@@ -1,11 +1,11 @@
-a 
-c 
-привет 
-мир 
-spaced 
+a
+c
+привет
+мир
+spaced
 UTF word
-hi 
-a 
-a 
+hi
+a
+a
 a ሴ䌡
-привет has space 
+привет has space
index ce58a18e74d5197f995b02e99f5acf5842f9b7b7..c561697849ffd59ec2c42dbecccd78ce88e49691 100644 (file)
@@ -1,11 +1,11 @@
-a 
-c 
-привет 
-мир 
-spaced 
+a
+c
+привет
+мир
+spaced
 UTF space!
-hi 
-a 
-a 
-a 
-привет has space 
+hi
+a
+a
+a
+привет has space
index 8f71132c8ab963dae83293ca0dc974365a6c6915..8e9469c52c2f4119f04ba6301a9f8193648a8c81 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out
 UTF space! <-- should have the word space!
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index 8f71132c8ab963dae83293ca0dc974365a6c6915..8e9469c52c2f4119f04ba6301a9f8193648a8c81 100644 (file)
@@ -4,7 +4,7 @@ c d zero​width
 мир e␠
 spaced out
 UTF space! <-- should have the word space!
-hi 
+hi
 a line܀܀܀with some random text
 a 偐 ぐ
 a b c d e f ሴ䌡
index bf43a1af31ed81ec13d51c27a08b3444b3eb1a4a..6be3bb5797580b982bf1e94f3517ad78862c5b4b 100644 (file)
@@ -1687,4 +1687,4 @@ generate_cleanup() {
   unset generate_cleanup
 }
 
-generate_main $*
+generate_main "$@"
index b9853561815e3d243b85abc18ca6b166b585ba29..f80c2358faf01c7c53859fdfe905ce447dfc93bb 100644 (file)
@@ -12,6 +12,7 @@
 verify_main() {
   local path_build="${1}"
   local path_expect="${2}"
+  local test_name="${3}"
   local failure=0
   local basename_file=
   local hash_build=
@@ -44,6 +45,10 @@ verify_main() {
     return 1
   fi
 
+  if [[ $test_name != "" ]] ; then
+    test_name=" for ${test_name}"
+  fi
+
   verify_operate_test_standard
 
   if [[ ${failure} -eq 1 ]] ; then
@@ -54,6 +59,9 @@ verify_main() {
 }
 
 verify_operate_test_standard() {
+  let -i fail=0
+  let -i success=0
+  let message="(Did not run tests)"
 
   for i in ${path_build}* ; do
 
@@ -91,20 +99,27 @@ verify_operate_test_standard() {
 
     if [[ $hash_build == $hash_expect ]] ; then
       echo "[ Success ] ${basename_file}."
+
+      let success++
     else
       echo "[ Failure ] ${basename_file}."
 
       let failure=1
+      let fail++
     fi
 
   done
 
+  if [[ $fail -gt 0 || $success -gt 0 ]] ; then
+    message=" (Success: $success, Fail: $fail)"
+  fi
+
   echo
 
   if [[ $failure -eq 1 ]] ; then
-    echo "Failure! Some or all tests failed."
+    echo "Failure! Some or all tests failed${message}${test_name}."
   else
-    echo "Success! All tests passed."
+    echo "Success! All tests passed${message}${test_name}."
   fi
 
   return $failure
@@ -117,4 +132,4 @@ verify_cleanup() {
   unset verify_cleanup
 }
 
-verify_main $*
+verify_main "$@"