]> Kevux Git Server - fll/commitdiff
Progress: Continue program related work, updating fss_write.
authorKevin Day <thekevinday@gmail.com>
Mon, 5 Dec 2022 01:02:32 +0000 (19:02 -0600)
committerKevin Day <thekevinday@gmail.com>
Mon, 5 Dec 2022 01:02:32 +0000 (19:02 -0600)
Rename F_supported to F_supported and F_supported_not to F_support_not to avoid past tense.

Add a static empty range to make initialization assignment even easier.

For fss_write:
- Add most of the ignore range handling.
- Add support for the multiple Content per Object and handle errors for standards that do not support this.
- Lost of clean up and simplifications.
- Add a lot of fixme and todo comments for things not yet completed.

There is still a lot to do with fss_write.
The common write functionality is mostly done.
The standard specific functionality is not written for anything except FSS Payload.

58 files changed:
level_0/f_capability/c/capability.c
level_0/f_capability/c/capability.h
level_0/f_file/c/file.c
level_0/f_file/c/file.h
level_0/f_file/c/file/stream.c
level_0/f_file/c/file/stream.h
level_0/f_file/c/private-file.c
level_0/f_file/c/private-file.h
level_0/f_fss/c/fss/common.h
level_0/f_signal/c/signal.c
level_0/f_signal/c/signal.h
level_0/f_socket/c/socket.c
level_0/f_socket/c/socket.h
level_0/f_status/c/status.h
level_0/f_status_string/c/status_string.c
level_0/f_status_string/c/status_string.h
level_0/f_string/c/string/range.c
level_0/f_string/c/string/range.h
level_0/f_thread/c/thread.c
level_0/f_thread/c/thread.h
level_1/fl_directory/c/private-directory.c
level_1/fl_fss/c/fss/basic.h
level_2/fll_execute/c/private-execute.c
level_2/fll_status_string/c/status_string.c
level_3/control/c/control.c
level_3/controller/c/controller/private-controller.c
level_3/controller/c/entry/private-entry.c
level_3/controller/c/rule/private-rule.c
level_3/fss_basic_list_write/c/private-write.c
level_3/fss_basic_write/c/private-write.c
level_3/fss_embedded_list_write/c/private-write.c
level_3/fss_extended_list_write/c/private-write.c
level_3/fss_extended_write/c/private-write.c
level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic/fss_write.h
level_3/fss_write/c/basic/main.c
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/basic_list/fss_write.h
level_3/fss_write/c/basic_list/main.c
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/embedded_list/fss_write.h
level_3/fss_write/c/embedded_list/main.c
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended/fss_write.h
level_3/fss_write/c/extended/main.c
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/extended_list/fss_write.h
level_3/fss_write/c/extended_list/main.c
level_3/fss_write/c/main/common.c
level_3/fss_write/c/main/common.h
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/fss_write.h
level_3/fss_write/c/main/main.c
level_3/fss_write/c/main/print.c
level_3/fss_write/c/main/print.h
level_3/fss_write/c/payload/fss_write.c
level_3/fss_write/c/payload/fss_write.h
level_3/fss_write/c/payload/main.c

index 2f50e6b0e2e563d941ca3d4147f019f0e28a2c29..8ed51d95bce168ff386b186f1fba6a033c11660c 100644 (file)
@@ -394,7 +394,7 @@ extern "C" {
       *ambient = cap_get_ambient(value);
 
       if (*ambient == -1) {
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       return F_none;
@@ -598,7 +598,7 @@ extern "C" {
       if (errno == ENOMEM) return F_status_set_error(F_memory_not);
       if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
       if (errno == EPERM) return F_status_set_error(F_prohibited);
-      if (errno == EROFS) return F_status_set_error(F_supported_not);
+      if (errno == EROFS) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -617,7 +617,7 @@ extern "C" {
         if (errno == ENOMEM) return F_status_set_error(F_memory_not);
         if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
         if (errno == EPERM) return F_status_set_error(F_prohibited);
-        if (errno == EROFS) return F_status_set_error(F_supported_not);
+        if (errno == EROFS) return F_status_set_error(F_support_not);
 
         return F_status_set_error(F_failure);
       }
@@ -645,7 +645,7 @@ extern "C" {
       if (errno == ENOMEM) return F_status_set_error(F_memory_not);
       if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
       if (errno == EPERM) return F_status_set_error(F_prohibited);
-      if (errno == EROFS) return F_status_set_error(F_supported_not);
+      if (errno == EROFS) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -664,7 +664,7 @@ extern "C" {
         if (errno == ENOMEM) return F_status_set_error(F_memory_not);
         if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
         if (errno == EPERM) return F_status_set_error(F_prohibited);
-        if (errno == EROFS) return F_status_set_error(F_supported_not);
+        if (errno == EROFS) return F_status_set_error(F_support_not);
 
         return F_status_set_error(F_failure);
       }
@@ -850,7 +850,7 @@ extern "C" {
         if (errno == ENOMEM) return F_status_set_error(F_memory_not);
         if (errno == ENOTDIR) return F_status_set_error(F_directory_not);
         if (errno == EPERM) return F_status_set_error(F_prohibited);
-        if (errno == EROFS) return F_status_set_error(F_supported_not);
+        if (errno == EROFS) return F_status_set_error(F_support_not);
 
         return F_status_set_error(F_failure);
       }
index 2b36b26ce457be3fbd24fb1253a99fb29a041b16..84feb6c3ccc7d52923f9a7c3af950d182d48a048 100644 (file)
@@ -61,7 +61,7 @@ extern "C" {
  *
  *   F_implemented_not (with error bit) if this function is not available (due to not having libcap support compiled in).
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the system does not support ambient capabilities.
+ *   F_support_not (with error bit) if the system does not support ambient capabilities.
  *
  *   F_failure (with error bit) on any other failure.
  *
@@ -304,7 +304,7 @@ extern "C" {
  *   F_name_not (with error bit) if the file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if the file system does not permit this operation.
- *   F_supported_not (with error bit) if the file system does not support this operation.
+ *   F_support_not (with error bit) if the file system does not support this operation.
  *
  *   F_failure (with error bit) on any other failure.
  *
@@ -334,7 +334,7 @@ extern "C" {
  *   F_name_not (with error bit) if the file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if the file system does not permit this operation.
- *   F_supported_not (with error bit) if the file system does not support this operation.
+ *   F_support_not (with error bit) if the file system does not support this operation.
  *
  *   F_failure (with error bit) on any other failure.
  *
@@ -365,7 +365,7 @@ extern "C" {
  *   F_name_not (with error bit) if the file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if the file system does not permit this operation.
- *   F_supported_not (with error bit) if the file system does not support this operation.
+ *   F_support_not (with error bit) if the file system does not support this operation.
  *
  *   F_failure (with error bit) on any other failure.
  *
@@ -395,7 +395,7 @@ extern "C" {
  *   F_name_not (with error bit) if the file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if the file system does not permit this operation.
- *   F_supported_not (with error bit) if the file system does not support this operation.
+ *   F_support_not (with error bit) if the file system does not support this operation.
  *
  *   F_failure (with error bit) on any other failure.
  *
@@ -666,7 +666,7 @@ extern "C" {
  *   F_name_not (with error bit) if the file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if the file system does not permit this operation.
- *   F_supported_not (with error bit) if the file system does not support this operation.
+ *   F_support_not (with error bit) if the file system does not support this operation.
  *
  *   F_failure (with error bit) on any other error.
  *
index e842f15a1ccf3d72063c747c3044752bb7c4f6b2..ec8a5568e66410e3ba531a4612d2ab2fdf2eadb7 100644 (file)
@@ -116,7 +116,7 @@ extern "C" {
       return F_none;
     }
 
-    return F_supported_not;
+    return F_support_not;
   }
 #endif // _di_f_file_clone_
 
@@ -239,7 +239,7 @@ extern "C" {
       return F_none;
     }
 
-    return F_supported_not;
+    return F_support_not;
   }
 #endif // _di_f_file_copy_
 
@@ -268,7 +268,7 @@ extern "C" {
     if (!path.used) return F_data_not;
 
     if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) {
-      return F_status_set_error(F_supported_not);
+      return F_status_set_error(F_support_not);
     }
 
     const dev_t device = makedev(major, minor);
@@ -284,7 +284,7 @@ extern "C" {
     if (!path.used) return F_data_not;
 
     if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) {
-      return F_status_set_error(F_supported_not);
+      return F_status_set_error(F_support_not);
     }
 
     const dev_t device = makedev(major, minor);
@@ -318,7 +318,7 @@ extern "C" {
     if (!path.used) return F_data_not;
 
     if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) {
-      return F_status_set_error(F_supported_not);
+      return F_status_set_error(F_support_not);
     }
 
     return private_f_file_create_node(path, mode, device);
@@ -332,7 +332,7 @@ extern "C" {
     if (!path.used) return F_data_not;
 
     if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) {
-      return F_status_set_error(F_supported_not);
+      return F_status_set_error(F_support_not);
     }
 
     return private_f_file_create_node_at(directory, path, mode, device);
index e8536c702ced0852f78245ac9cf20f148ddc7534..63a46e50a1dc582d4d3fbdb0091465f116e1a48e 100644 (file)
@@ -167,7 +167,7 @@ extern "C" {
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not if copying a given type of file is unsupported.
+ *   F_support_not if copying a given type of file is unsupported.
  *   F_failure (with error bit) for any other error.
  */
 #ifndef _di_f_file_clone_
@@ -250,7 +250,7 @@ extern "C" {
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not if copying a given type of file is unsupported.
+ *   F_support_not if copying a given type of file is unsupported.
  *   F_failure (with error bit) for any other error.
  */
 #ifndef _di_f_file_copy_
@@ -371,7 +371,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see makedev()
@@ -415,7 +415,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see makedev()
@@ -447,7 +447,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mkfifo()
@@ -482,7 +482,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mkfifoat()
@@ -516,7 +516,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mknod()
@@ -555,7 +555,7 @@ extern "C" {
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
  *   F_failure (with error bit) for any other error.
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *
  * @see mknodat()
  */
@@ -664,7 +664,7 @@ extern "C" {
  *   F_input_output (with error bit) on I/O error.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) if the file system or file type does not support flushing.
+ *   F_support_not (with error bit) if the file system or file type does not support flushing.
  *   F_failure (with error bit) on any other failure.
  *
  * @see fsync()
@@ -1408,7 +1408,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
- *   F_supported_not (with error bit) fo unsupported file types.
+ *   F_support_not (with error bit) fo unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see open()
index 593841225d3ab2d39873f03f92efbd7acdd0ae34..4069643d289b79b98543fc1acfc538e42f4fdd7a 100644 (file)
@@ -124,7 +124,7 @@ extern "C" {
       if (errno == EROFS) return F_status_set_error(F_read_only);
       if (errno == ETXTBSY) return F_status_set_error(F_busy);
       if (errno == EISDIR) return F_status_set_error(F_directory);
-      if (errno == EOPNOTSUPP) return F_status_set_error(F_supported_not);
+      if (errno == EOPNOTSUPP) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
index a5b3fc0e1123afbb0887600fab1df038dcb4680d..f46fd3ae70fdd26234340aea97013941cccae794 100644 (file)
@@ -164,7 +164,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
- *   F_supported_not (with error bit) fo unsupported file types.
+ *   F_support_not (with error bit) fo unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see fopen()
@@ -359,7 +359,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
- *   F_supported_not (with error bit) fo unsupported file types.
+ *   F_support_not (with error bit) fo unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see fileno()
index 9a6cdd89d0a1ea0b208ac4a177897d06c2872cee..314af28d4de5be7184d553cac7642f59033d4fb8 100644 (file)
@@ -343,10 +343,10 @@ extern "C" {
     if (fsync(file.id) < 0) {
       if (errno == EBADF) return F_status_set_error(F_file_descriptor);
       if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block);
-      if (errno == EINVAL) return F_status_set_error(F_supported_not);
+      if (errno == EINVAL) return F_status_set_error(F_support_not);
       if (errno == EIO) return F_status_set_error(F_input_output);
       if (errno == ENOSPC) return F_status_set_error(F_space_not);
-      if (errno == EROFS) return F_status_set_error(F_supported_not);
+      if (errno == EROFS) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_file_synchronize);
     }
@@ -545,7 +545,7 @@ extern "C" {
       if (errno == ENOMEM) return F_status_set_error(F_memory_not);
       if (errno == ENOSPC) return F_status_set_error(F_space_not);
       if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
-      if (errno == EOPNOTSUPP) return F_status_set_error(F_supported_not);
+      if (errno == EOPNOTSUPP) return F_status_set_error(F_support_not);
       if (errno == EPERM) return F_status_set_error(F_prohibited);
       if (errno == EROFS) return F_status_set_error(F_read_only);
       if (errno == ETXTBSY) return F_status_set_error(F_busy);
@@ -579,7 +579,7 @@ extern "C" {
       if (errno == ENOMEM) return F_status_set_error(F_memory_not);
       if (errno == ENOSPC) return F_status_set_error(F_space_not);
       if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
-      if (errno == EOPNOTSUPP) return F_status_set_error(F_supported_not);
+      if (errno == EOPNOTSUPP) return F_status_set_error(F_support_not);
       if (errno == EPERM) return F_status_set_error(F_prohibited);
       if (errno == EROFS) return F_status_set_error(F_read_only);
       if (errno == ETXTBSY) return F_status_set_error(F_busy);
index 1be050da1e2ab41784375208d0831c6271746d3d..cfbd13e176ff78828503546451f6359a8b50de3d 100644 (file)
@@ -85,7 +85,7 @@ extern "C" {
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_read_only (with error bit) if file is read-only.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not if copying a given type of file is unsupported.
+ *   F_support_not if copying a given type of file is unsupported.
  *   F_failure (with error bit) for any other error.
  *
  * @see open()
@@ -290,7 +290,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mkfifo()
@@ -328,7 +328,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mkfifoat()
@@ -369,7 +369,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *   F_failure (with error bit) for any other error.
  *
  * @see mknod()
@@ -415,7 +415,7 @@ extern "C" {
  *   F_prohibited (with error bit) if file system does not allow for making changes.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
  *   F_failure (with error bit) for any other error.
- *   F_supported_not (with error bit) for unsupported file types.
+ *   F_support_not (with error bit) for unsupported file types.
  *
  * @see mknodat()
  *
@@ -443,7 +443,7 @@ extern "C" {
  *   F_input_output (with error bit) on I/O error.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) if the file system or file type does not support flushing.
+ *   F_support_not (with error bit) if the file system or file type does not support flushing.
  *   F_file_synchronize (with error bit) on any other failure.
  *
  * @see f_file_clone_at()
index 4556cba128a3cad95a5bd300a6efc7cd615b3e8d..2183ef1976391c66c24e4557e3abecca06048d43 100644 (file)
@@ -179,7 +179,7 @@ extern "C" {
  * The details on how these work are specific to individual specifications.
  * The notes below provide the intended purpose but be sure to still read the individual function documentation.
  *
- * Only "next" and "end" are only meaningful for a Content and will be treated as "none" for an Object.
+ * The "next" and "end" are only meaningful for a Content and will be treated as "none" for an Object.
  *
  * f_fss_complete_*:
  *   - none:         Disable completeness.
index 06d9e767c7300a28549c2f154ab273386f5a6fb5..86e28360acdfbd0cb09186937dacb85360e7e204 100644 (file)
@@ -102,7 +102,7 @@ extern "C" {
 
     if (sigqueue(id, signal, value) == -1) {
       if (errno == EAGAIN) return F_status_set_error(F_resource_not);
-      if (errno == ENOSYS) return F_status_set_error(F_supported_not);
+      if (errno == ENOSYS) return F_status_set_error(F_support_not);
       if (errno == EINVAL) return F_status_set_error(F_parameter);
       if (errno == ESRCH) return F_status_set_error(F_found_not);
 
index 85f87c6a9e170290cf98114eb321a3f1ce6a66ff..feafbceae02bb21b551b536aefd48ae8e7e05b64 100644 (file)
@@ -164,7 +164,7 @@ extern "C" {
  *   F_found_not (with error bit) if the given PID was found.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_resource_not (with error bit) if the max signals is reached.
- *   F_supported_not (with error bit) if this action is not supported by the current OS.
+ *   F_support_not (with error bit) if this action is not supported by the current OS.
  *
  *   F_failure (with error bit) for any other error.
  *
index e4d9410682a9873da2d3b06311c2fbff118a5f39..f4ed967510cdf42dfa620090bb32838b5b942e2f 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
       if (errno == EOPNOTSUPP) return F_status_set_error(F_stream_not);
       if (errno == EPROTO) return F_status_set_error(F_protocol);
       if (errno == EPERM) return F_status_set_error(F_prohibited);
-      if (errno == ESOCKTNOSUPPORT) return F_status_set_error(F_supported_not);
+      if (errno == ESOCKTNOSUPPORT) return F_status_set_error(F_support_not);
       if (errno == EPROTONOSUPPORT) return F_status_set_error(F_protocol_not);
       if (errno == ETIMEDOUT) return F_status_set_error(F_time_out);
 
@@ -224,7 +224,7 @@ extern "C" {
       result = shutdown(socket->id, SHUT_RDWR);
     }
     else {
-      return F_status_set_error(F_supported_not);
+      return F_status_set_error(F_support_not);
     }
 
     if (result == -1) {
@@ -264,7 +264,7 @@ extern "C" {
       if (errno == EADDRINUSE) return F_status_set_error(F_busy_address);
       if (errno == EBADF) return F_status_set_error(F_file_descriptor);
       if (errno == ENOTSOCK) return F_status_set_error(F_socket_not);
-      if (errno == EOPNOTSUPP) return F_status_set_error(F_supported_not);
+      if (errno == EOPNOTSUPP) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
index d7a4daf664ed010811c2a5e8ac1794b9ddf0f313..03d333da44b002bf9ef694872164a673d8028439 100644 (file)
@@ -66,7 +66,7 @@ extern "C" {
  *   F_protocol_not (with error bit) if the given protocol is unknown or is unsupported.
  *   F_socket_not (with error bit) if the id is not a socket descriptor.
  *   F_stream_not (with error bit) the socket type is not a stream.
- *   F_supported_not (with error bit) if this socket type is not supported.
+ *   F_support_not (with error bit) if this socket type is not supported.
  *   F_time_out (with error bit) if a timeout occurred.
  *
  *   F_failure (with error bit) for any other error.
@@ -292,7 +292,7 @@ extern "C" {
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_socket_not (with error bit) if the id is not a socket descriptor.
  *   F_space_not (with error bit) if file system is out of space (or file system quota is reached).
- *   F_supported_not (with error bit) if this socket does not support the listen() operation.
+ *   F_support_not (with error bit) if this socket does not support the listen() operation.
  *
  *   F_failure (with error bit) for any other error.
  *
@@ -319,7 +319,7 @@ extern "C" {
  *   F_busy_address (with error bit) if address is already in use (therefore unavailable).
  *   F_file_descriptor (with error bit) if id is an invalid descriptor.
  *   F_socket_not (with error bit) if the id is not a socket descriptor.
- *   F_supported_not (with error bit) if this socket does not support the listen() operation.
+ *   F_support_not (with error bit) if this socket does not support the listen() operation.
  *
  *   F_failure (with error bit) for any other error.
  *
index 0e5cb973afc00f63f6edc68af52232ed1fdaba79..152a9847208be860b9288a17fc68fe0464c1ed6a 100644 (file)
@@ -463,8 +463,8 @@ extern "C" {
       F_string_too_small,
       F_success,
       F_success_not,
-      F_supported,
-      F_supported_not,
+      F_support,
+      F_support_not,
       F_syntax,
       F_syntax_not,
       F_terminate,
index 11b626009c402334a2f6919d99ff2c5e0b03663b..fd52cc960506187c16a8a71d65b15a1c73837729 100644 (file)
@@ -350,8 +350,8 @@ extern "C" {
     const f_string_static_t f_status_type_not_s = macro_f_string_static_t_initialize(F_status_type_not_s, 0, F_status_type_not_s_length);
     const f_string_static_t f_status_success_s = macro_f_string_static_t_initialize(F_status_success_s, 0, F_status_success_s_length);
     const f_string_static_t f_status_success_not_s = macro_f_string_static_t_initialize(F_status_success_not_s, 0, F_status_success_not_s_length);
-    const f_string_static_t f_status_supported_s = macro_f_string_static_t_initialize(F_status_supported_s, 0, F_status_supported_s_length);
-    const f_string_static_t f_status_supported_not_s = macro_f_string_static_t_initialize(F_status_supported_not_s, 0, F_status_supported_not_s_length);
+    const f_string_static_t f_status_support_s = macro_f_string_static_t_initialize(F_status_support_s, 0, F_status_support_s_length);
+    const f_string_static_t f_status_support_not_s = macro_f_string_static_t_initialize(F_status_support_not_s, 0, F_status_support_not_s_length);
     const f_string_static_t f_status_user_s = macro_f_string_static_t_initialize(F_status_user_s, 0, F_status_user_s_length);
     const f_string_static_t f_status_user_not_s = macro_f_string_static_t_initialize(F_status_user_not_s, 0, F_status_user_not_s_length);
     const f_string_static_t f_status_utf_s = macro_f_string_static_t_initialize(F_status_utf_s, 0, F_status_utf_s_length);
@@ -2353,13 +2353,13 @@ extern "C" {
 
           break;
 
-        case F_supported:
-          *name = f_status_supported_s;
+        case F_support:
+          *name = f_status_support_s;
 
           break;
 
-        case F_supported_not:
-          *name = f_status_supported_not_s;
+        case F_support_not:
+          *name = f_status_support_not_s;
 
           break;
 
index 56bea80a0d3f98f2b23c0b145b8c302b219edb7e..22945700ee5805103085406e7cb823c242211fcf 100644 (file)
@@ -503,8 +503,8 @@ extern "C" {
     #define F_status_type_not_s          "F_type_not"
     #define F_status_success_s           "F_success"
     #define F_status_success_not_s       "F_success_not"
-    #define F_status_supported_s         "F_supported"
-    #define F_status_supported_not_s     "F_supported_not"
+    #define F_status_support_s         "F_support"
+    #define F_status_support_not_s     "F_support_not"
     #define F_status_user_s              "F_user"
     #define F_status_user_not_s          "F_user_not"
     #define F_status_utf_s               "F_utf"
@@ -788,8 +788,8 @@ extern "C" {
     #define F_status_string_too_small_s_length  18
     #define F_status_success_s_length           9
     #define F_status_success_not_s_length       13
-    #define F_status_supported_s_length         11
-    #define F_status_supported_not_s_length     15
+    #define F_status_support_s_length           9
+    #define F_status_support_not_s_length       13
     #define F_status_syntax_s_length            8
     #define F_status_syntax_not_s_length        12
     #define F_status_terminate_s_length         11
@@ -1101,8 +1101,8 @@ extern "C" {
     extern const f_string_static_t f_status_type_not_s;
     extern const f_string_static_t f_status_success_s;
     extern const f_string_static_t f_status_success_not_s;
-    extern const f_string_static_t f_status_supported_s;
-    extern const f_string_static_t f_status_supported_not_s;
+    extern const f_string_static_t f_status_support_s;
+    extern const f_string_static_t f_status_support_not_s;
     extern const f_string_static_t f_status_user_s;
     extern const f_string_static_t f_status_user_not_s;
     extern const f_string_static_t f_status_utf_s;
index f5d0dad2369222c2f10059846b98213d4b7f9077..9763e26dff2510b0a4a4ee08a5a654505e3a84fc 100644 (file)
@@ -6,6 +6,10 @@
 extern "C" {
 #endif
 
+#ifndef _di_f_string_range_empty_c_
+  const f_string_range_t f_string_range_empty_c = { 1, 0 };
+#endif // _di_f_string_range_empty_c_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index bc6f8180f20d777ceb536d0df4dd2fc24fe0b7d5..5b050c7c7c91244e280f46bad76908763c002160 100644 (file)
@@ -42,6 +42,15 @@ extern "C" {
     range.stop = 0;
 #endif // _di_f_string_range_t_
 
+/**
+ * Provide a static empty range.
+ *
+ * This is intended to represent an empty or disabled range.
+ */
+#ifndef _di_f_string_range_empty_c_
+  extern const f_string_range_t f_string_range_empty_c;
+#endif // _di_f_string_range_empty_c_
+
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 204f28c79a8655be75b023160d47ba408c50e3e8..ce37ffd835ac67b737b77a40b17ca87c19f14015 100644 (file)
@@ -379,7 +379,7 @@ extern "C" {
 
     if (error) {
       if (error == EINVAL) return F_status_set_error(F_parameter);
-      if (error == ENOTSUP) return F_status_set_error(F_supported_not);
+      if (error == ENOTSUP) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -657,7 +657,7 @@ extern "C" {
     const int error = pthread_getcpuclockid(id_thread, id_clock);
 
     if (error) {
-      if (error == ENOENT) return F_status_set_error(F_supported_not);
+      if (error == ENOENT) return F_status_set_error(F_support_not);
       if (error == ESRCH) return F_status_set_error(F_found_not);
 
       return F_status_set_error(F_failure);
@@ -950,7 +950,7 @@ extern "C" {
     if (error) {
       if (error == EDEADLK) return F_status_set_error(F_deadlock);
       if (error == EINVAL) return F_status_set_error(F_parameter);
-      if (error == EPERM) return F_status_set_error(F_supported_not);
+      if (error == EPERM) return F_status_set_error(F_support_not);
       if (error == ESRCH) return F_status_set_error(F_found_not);
 
       return F_status_set_error(F_failure);
@@ -969,7 +969,7 @@ extern "C" {
       if (error == EBUSY) return F_busy;
       if (error == EDEADLK) return F_status_set_error(F_deadlock);
       if (error == EINVAL) return F_status_set_error(F_parameter);
-      if (error == EPERM) return F_status_set_error(F_supported_not);
+      if (error == EPERM) return F_status_set_error(F_support_not);
       if (error == ESRCH) return F_status_set_error(F_found_not);
 
       return F_status_set_error(F_failure);
@@ -988,7 +988,7 @@ extern "C" {
       if (error == EBUSY) return F_busy;
       if (error == EDEADLK) return F_status_set_error(F_deadlock);
       if (error == EINVAL) return F_status_set_error(F_parameter);
-      if (error == EPERM) return F_status_set_error(F_supported_not);
+      if (error == EPERM) return F_status_set_error(F_support_not);
       if (error == ESRCH) return F_status_set_error(F_found_not);
       if (error == ETIMEDOUT) return F_time;
 
@@ -1378,7 +1378,7 @@ extern "C" {
     if (error) {
       if (error == EINVAL) return F_status_set_error(F_parameter);
       if (error == EPERM) return F_status_set_error(F_prohibited);
-      if (error == ENOTSUP) return F_status_set_error(F_supported_not);
+      if (error == ENOTSUP) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -1642,7 +1642,7 @@ extern "C" {
     const int error = pthread_getschedparam(id, policy, parameter);
 
     if (error) {
-      if (error == ENOTSUP) return F_status_set_error(F_supported_not);
+      if (error == ENOTSUP) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -1695,7 +1695,7 @@ extern "C" {
 
     if (sem_init(semaphore, shared, value) == -1) {
       if (errno == EINVAL) return F_status_set_error(F_parameter);
-      if (errno == ENOSYS) return F_status_set_error(F_supported_not);
+      if (errno == ENOSYS) return F_status_set_error(F_support_not);
 
       return F_status_set_error(F_failure);
     }
@@ -1895,7 +1895,7 @@ extern "C" {
 
     if (error) {
       if (error == EAGAIN) return F_status_set_error(F_resource_not);
-      if (error == ENOSYS) return F_status_set_error(F_supported_not);
+      if (error == ENOSYS) return F_status_set_error(F_support_not);
       if (error == EINVAL) return F_status_set_error(F_parameter);
       if (error == ESRCH) return F_status_set_error(F_found_not);
 
index 964147a16964d823c9ec3c5b0b31240365bf3d3f..0af6d8ce956e58446541281eee3a6200083698e1 100644 (file)
@@ -492,7 +492,7 @@ extern "C" {
  *   F_none on success.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the scope is not supported by the current OS (such as Linux not supporting PTHREAD_SCOPE_PROCESS).
+ *   F_support_not (with error bit) if the scope is not supported by the current OS (such as Linux not supporting PTHREAD_SCOPE_PROCESS).
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -853,7 +853,7 @@ extern "C" {
  *   F_none on success.
  *
  *   F_found_not (with error bit) if no thread by the given ID was found.
- *   F_supported_not (with error bit) if per-CPU clocks are not supported by the OS.
+ *   F_support_not (with error bit) if per-CPU clocks are not supported by the OS.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -1238,7 +1238,7 @@ extern "C" {
  *   F_deadlock (with error bit) if operation would cause a deadlock.ead.
  *   F_found_not (with error bit) if no thread by the given ID was found.
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the thread is not joinable or is already being joined by another thread.
+ *   F_support_not (with error bit) if the thread is not joinable or is already being joined by another thread.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -1267,7 +1267,7 @@ extern "C" {
  *   F_deadlock (with error bit) if operation would cause a deadlock.ead.
  *   F_found_not (with error bit) if no thread by the given ID was found.
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the thread is not joinable or is already being joined by another thread.
+ *   F_support_not (with error bit) if the thread is not joinable or is already being joined by another thread.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -1301,7 +1301,7 @@ extern "C" {
  *   F_deadlock (with error bit) if operation would cause a deadlock.
  *   F_found_not (with error bit) if no thread by the given ID was found.
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the thread is not joinable or is already being joined by another thread.
+ *   F_support_not (with error bit) if the thread is not joinable or is already being joined by another thread.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -1800,7 +1800,7 @@ extern "C" {
  *
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_prohibited (with error bit) if not allowed to perform the operation.
- *   F_supported_not (with error bit) if the protocol is not supported.
+ *   F_support_not (with error bit) if the protocol is not supported.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -2129,7 +2129,7 @@ extern "C" {
  *   F_none on success.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the policy or scheduling parameter is invalid.
+ *   F_support_not (with error bit) if the policy or scheduling parameter is invalid.
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -2202,7 +2202,7 @@ extern "C" {
  *   F_none on success.
  *
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the system does not support the process shared semaphore (shared == true).
+ *   F_support_not (with error bit) if the system does not support the process shared semaphore (shared == true).
  *
  *   F_failure (with error bit) on any other error.
  *
@@ -2311,7 +2311,7 @@ extern "C" {
  *   F_file_found_not (with error bit) if the file was not found and the O_CREAT is not set.
  *   F_name_not (with error bit) if file name is too long.
  *   F_parameter (with error bit) if a parameter is invalid.
- *   F_supported_not (with error bit) if the system does not support the process shared semaphore (shared == true).
+ *   F_support_not (with error bit) if the system does not support the process shared semaphore (shared == true).
  *   F_memory_not (with error bit) if out of memory.
  *
  *   F_failure (with error bit) on any other error.
@@ -2481,7 +2481,7 @@ extern "C" {
  *   F_found_not (with error bit) if no thread by the given ID was found.
  *   F_parameter (with error bit) if a parameter is invalid.
  *   F_resource_not (with error bit) if the max signals is reached.
- *   F_supported_not (with error bit) if this action is not supported by the current OS.
+ *   F_support_not (with error bit) if this action is not supported by the current OS.
  *
  *   F_failure (with error bit) on any other error.
  *
index 949f7190462b9173ff33fba7c94303d371bddb36..b56cb16ebc959f067db888efc3833ec38752a530 100644 (file)
@@ -164,7 +164,7 @@ extern "C" {
 
     f_status_t status = f_file_clone(path_source, path_destination, recurse.size_block, recurse.flag);
 
-    if (F_status_is_error(status) || status == F_supported_not) {
+    if (F_status_is_error(status) || status == F_support_not) {
       if (status == F_status_set_error(F_memory_not)) {
         return F_status_set_error(status);
       }
@@ -376,7 +376,7 @@ extern "C" {
 
     f_status_t status = f_file_copy(path_source, path_destination, mode, recurse.size_block, recurse.flag);
 
-    if (F_status_is_error(status) || status == F_supported_not) {
+    if (F_status_is_error(status) || status == F_support_not) {
       if (status == F_status_set_error(F_memory_not)) {
         return F_status_set_error(status);
       }
index 7105da976920b8cffc7487f870c84c741dade131..9f81c053c32d0edcb35f1b6b48c68aeca1de0ff2 100644 (file)
@@ -220,7 +220,7 @@ extern "C" {
  *   If f_fss_complete_full_e, this will write any appropriate open and close aspects of this object.
  *   If f_fss_complete_full_trim_e, this will write any appropriate open and close aspects of this object, but will omit whitespace before and after the object (inside the quotes).
  *   If f_fss_complete_partial_e, this will write any appropriate open and close aspects of this object.
- *   If f_fss_complete_partial_tim, this will write any appropriate open and close aspects of this object, but will omit whitespace before and after the object (inside the quotes).
+ *   If f_fss_complete_partial_trim, this will write any appropriate open and close aspects of this object, but will omit whitespace before and after the object (inside the quotes).
  * @param state
  *   A state for providing flags and handling interrupts during long running operations.
  *   There is no print_error().
index 5c7738d088e46c84035b0db3044f424fcc03c110..69f3943b58a3614cb68b6e5c6238961fa726323b 100644 (file)
@@ -72,7 +72,7 @@ extern "C" {
     if (as.capability) {
       const f_status_t status = f_capability_process_set(as.capability);
 
-      if (F_status_is_error(status) && F_status_set_fine(status) != F_supported_not) {
+      if (F_status_is_error(status) && F_status_set_fine(status) != F_support_not) {
         if (parameter && parameter->option & FL_execute_parameter_option_exit_d) {
           exit(F_execute_capability);
         }
index 0da83004cb14aa057fb04d04296043526f3bdb0b..acf02803de81c6e2d78ae7d683cabc4165f761af 100644 (file)
@@ -1968,14 +1968,14 @@ extern "C" {
         return F_none;
       }
 
-      if (fl_string_dynamic_compare(name, f_status_supported_s) == F_equal_to) {
-        *code = F_supported;
+      if (fl_string_dynamic_compare(name, f_status_support_s) == F_equal_to) {
+        *code = F_support;
 
         return F_none;
       }
 
-      if (fl_string_dynamic_compare(name, f_status_supported_not_s) == F_equal_to) {
-        *code = F_supported_not;
+      if (fl_string_dynamic_compare(name, f_status_support_not_s) == F_equal_to) {
+        *code = F_support_not;
 
         return F_none;
       }
index 74953d40dd89456a498720d643079188e247a6b3..41e66ac8729bf981c83b2423ac8e2fb6a2bdc015 100644 (file)
@@ -111,7 +111,7 @@ extern "C" {
       if (main->pipe & fll_program_data_pipe_input_e) {
         control_print_error_pipe_supported_not(main);
 
-        status = F_status_set_error(F_supported_not);
+        status = F_status_set_error(F_support_not);
       }
       else if (main->parameters.remaining.used) {
         control_data_t data = control_data_t_initialize;
index 6cef297a1ec2d367dbeab4b3466264daf3ee9dab..0b2c3ae12691352e7fe2370a8aca2b74cb5bdfb4 100644 (file)
@@ -699,7 +699,7 @@ extern "C" {
       return F_status_set_error(F_number);
     }
 
-    if (status == F_parameter || status == F_found_not || status == F_interrupt || status == F_supported_not || status == F_critical) {
+    if (status == F_parameter || status == F_found_not || status == F_interrupt || status == F_support_not || status == F_critical) {
       return F_status_set_error(status);
     }
 
index 63177f2c20c1e051cce0b90ac0b4694ed83908f6..a1f12bb811dbd25ee0b48e55811a9fe9b994da8a 100644 (file)
@@ -445,7 +445,7 @@ extern "C" {
               }
               else {
                 if (action->status == F_none) {
-                  action->status = F_status_set_error(F_supported_not);
+                  action->status = F_status_set_error(F_support_not);
 
                   if (F_status_is_error_not(status_action)) {
                     status_action = action->status;
@@ -472,7 +472,7 @@ extern "C" {
           }
           else if (action->type == controller_entry_action_type_failsafe_e || action->type == controller_entry_action_type_item_e) {
             if (fl_string_dynamic_compare(controller_main_s, action->parameters.array[0]) == F_equal_to) {
-              action->status = F_status_set_error(F_supported_not);
+              action->status = F_status_set_error(F_support_not);
 
               if (F_status_is_error_not(status_action)) {
                 status_action = action->status;
@@ -501,7 +501,7 @@ extern "C" {
               action->code = controller_entry_timeout_code_stop_d;
             }
             else {
-              action->status = F_status_set_error(F_supported_not);
+              action->status = F_status_set_error(F_support_not);
 
               if (F_status_is_error_not(status_action)) {
                 status_action = action->status;
@@ -572,7 +572,7 @@ extern "C" {
                 action->code |= controller_entry_rule_code_wait_d;
               }
               else {
-                action->status = F_status_set_error(F_supported_not);
+                action->status = F_status_set_error(F_support_not);
 
                 if (global.main->error.verbosity > f_console_verbosity_quiet_e) {
                   f_file_stream_lock(global.main->error.to);
index 4d17383573ef3024fb5f7457a873e1621bedc66f..20910ec2495c1e83a01efb150d6518471f10576c 100644 (file)
@@ -2506,7 +2506,7 @@ extern "C" {
             controller_unlock_print_flush(global.main->error.to, global.thread);
           }
 
-          status = F_status_set_error(F_supported_not);
+          status = F_status_set_error(F_support_not);
           break;
         }
 
@@ -5006,7 +5006,7 @@ extern "C" {
 
           status = f_capability_from_text(cache->action.generic, &rule->capability);
 
-          if (F_status_is_error(status) && F_status_set_fine(status) != F_supported_not) {
+          if (F_status_is_error(status) && F_status_set_fine(status) != F_support_not) {
             if (F_status_set_fine(status) == F_memory_not) {
 
               // Get the current line number within the settings item.
index 94debe1731c57e257d0005ea51ec83234f476402..937123534f00022a5645a11fd6677aa0a609a776 100644 (file)
@@ -90,7 +90,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_basic_list_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -271,7 +271,7 @@ extern "C" {
                 fll_print_format("%r%[%QThe FSS-0002 (Basic List) standard only supports one content per object.%]%r", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
index 26623048862fd7316582ee8863e4d3c093547ad8..1bc27cc9eb56e6e4e1b286d0e6f56290a4644aa6 100644 (file)
@@ -90,7 +90,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_basic_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -115,7 +115,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_basic_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -273,7 +273,7 @@ extern "C" {
                 fll_print_format("%r%[%QThe FSS-0000 (Basic) standard only supports one content per object.%]%r", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
@@ -294,7 +294,7 @@ extern "C" {
             if (F_status_set_fine(status) == F_none_eol) {
               fss_basic_write_error_parameter_unsupported_eol_print(main);
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
index f9751ca99df2f6519089744d291d565259477217..d4bc709263ed40ff6d48c3e94c1dd55bb6b1532e 100644 (file)
@@ -96,7 +96,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_embedded_list_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -283,7 +283,7 @@ extern "C" {
                 fll_print_format("%r%[%QThe FSS-0008 (Embedded List) standard only supports one content per object.%]%r", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
index 94a943f25c8b137a8fbaf1a7665912561dec2f5c..3b3b40e6bb42be89812b12ffd7ed60e121080725 100644 (file)
@@ -90,7 +90,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_extended_list_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -274,7 +274,7 @@ extern "C" {
                 fll_print_format("%r%[%QThe FSS-0003 (Extended List) standard only supports one content per object.%]%r", main->error.to, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
               }
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
index 0482c33f04e7e046e9469a2eb4b1135eb4e424e9..798e2d7aec6257d00edfe25b8243351f97ac9d45 100644 (file)
@@ -96,7 +96,7 @@ extern "C" {
       if (F_status_set_fine(status) == F_none_eol) {
         fss_extended_write_error_parameter_unsupported_eol_print(main);
 
-        return F_status_set_error(F_supported_not);
+        return F_status_set_error(F_support_not);
       }
 
       if (F_status_is_error(status)) {
@@ -124,7 +124,7 @@ extern "C" {
           if (F_status_set_fine(status) == F_none_eol) {
             fss_extended_write_error_parameter_unsupported_eol_print(main);
 
-            return F_status_set_error(F_supported_not);
+            return F_status_set_error(F_support_not);
           }
 
           if (F_status_is_error(status)) {
@@ -324,7 +324,7 @@ extern "C" {
             if (F_status_set_fine(status) == F_none_eol) {
               fss_extended_write_error_parameter_unsupported_eol_print(main);
 
-              status = F_status_set_error(F_supported_not);
+              status = F_status_set_error(F_support_not);
 
               break;
             }
index 9f3a3a52e4082afbd34adde9d570f02c7369c241..21c039f4ed8f4d98bf8077b4985ffc6ca8e07abe 100644 (file)
@@ -8,12 +8,12 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_basic_process_content_
-  void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+  void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
-        *content,
-        f_fss_complete_none_e,
+        *macro_fss_write_setting(setting)->content,
+        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -21,7 +21,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -30,10 +30,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -55,11 +55,11 @@ extern "C" {
 #endif // _di_fss_write_basic_process_help_
 
 #ifndef _di_fss_write_basic_process_object_
-  void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+  void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
         f_fss_complete_none_e,
         macro_fss_write_setting(setting)->state,
@@ -69,7 +69,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
@@ -79,10 +79,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -94,43 +94,6 @@ extern "C" {
   }
 #endif // _di_fss_write_basic_process_object_
 
-#ifndef _di_fss_write_basic_process_normal_
-  void fss_write_basic_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    f_string_statics_t * const data = (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects : &macro_fss_write_setting(setting)->contents;
-
-    for (f_array_length_t i = 0; i < data->used; ++i) {
-
-      // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
-      if (!((++main->signal_check) % fss_write_signal_check_d)) {
-        if (fll_program_standard_signal_received(main)) {
-          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
-
-          return;
-        }
-
-        main->signal_check = 0;
-      }
-
-      fss_write_process_set(
-        main,
-        macro_fss_write_setting(setting),
-        (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects.array[i] : 0,
-        (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) ? &macro_fss_write_setting(setting)->contents.array[i] : 0
-      );
-
-      if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
-    } // for
-  }
-#endif // _di_fss_write_basic_process_normal_
-
-#ifndef _di_fss_write_basic_process_pipe_
-  void fss_write_basic_process_pipe(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_basic_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 416d2f12d2392f06b0d215f6ce48cac42580f9f8..6a05ea8d26aabe585dd0780a4e38a98e80e52f74 100644 (file)
@@ -63,11 +63,12 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param content
- *   The string representing the Content to write to the buffer.
+ * @param last
+ *   If TRUE, then this is the last Content in the Content set.
+ *   If FALSE, then this is not the last Content in the Content set.
  */
 #ifndef _di_fss_write_basic_process_content_
-  extern void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+  extern void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const bool last);
 #endif // _di_fss_write_basic_process_content_
 
 /**
@@ -90,25 +91,6 @@ extern "C" {
 #endif // _di_fss_write_basic_process_help_
 
 /**
- * Process normally, writing to the output for FSS-0000 (Basic).
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_basic_process_normal_
-  extern void fss_write_basic_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_basic_process_normal_
-
-/**
  * Process a single Object, printing the FSS-0000 (Basic) if valid or an error if invalid.
  *
  * @param main
@@ -119,34 +101,11 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param object
- *   The string representing the Object to write to the buffer.
  */
 #ifndef _di_fss_write_basic_process_object_
-  extern void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+  extern void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_basic_process_object_
 
-/**
- * Process the pipe, reading from the pipe and writing to the output for FSS-0000 (Basic).
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but pipe contained no relevant data.
- *     F_basic on success and the basic has been printed.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_basic_process_pipe_
-  extern void fss_write_basic_process_pipe(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_basic_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 9c1d28bc6a53e1022a83a56d0b213de2ae835277..c329c3c9b6af826acd809d9b0616780ef3f93574 100644 (file)
@@ -7,11 +7,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_basic_program_name_s;
   setting.program_name_long = &fss_write_basic_program_name_long_s;
+  setting.process_content = &fss_write_basic_process_content;
   setting.process_help = &fss_write_basic_process_help;
-  setting.process_pipe = &fss_write_basic_process_pipe;
   setting.process_normal = &fss_write_basic_process_normal;
   setting.process_object = &fss_write_basic_process_object;
-  setting.process_content = &fss_write_basic_process_content;
+  setting.process_pipe = &fss_write_process_pipe;
+  setting.process_set = &fss_write_process_normal;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 435c14d7d679b6d19b755cc447cc8396fc57f92d..f2d86a1207aa7829f63c458d3fd084b14ea1d521 100644 (file)
@@ -8,11 +8,11 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_basic_list_process_content_
-  void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+  void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         f_fss_complete_none_e,
         &macro_fss_write_setting(setting)->prepend,
         macro_fss_write_setting(setting)->state,
@@ -22,7 +22,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         &macro_fss_write_setting(setting)->prepend,
         macro_fss_write_setting(setting)->state,
@@ -32,10 +32,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -56,20 +56,13 @@ extern "C" {
   }
 #endif // _di_fss_write_basic_list_process_help_
 
-#ifndef _di_fss_write_basic_list_process_normal_
-  void fss_write_basic_list_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_basic_list_process_normal_
-
 #ifndef _di_fss_write_basic_list_process_object_
-  void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+  void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
-        *object,
-        f_fss_complete_none_e,
+        *macro_fss_write_setting(setting)->object,
+        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -77,7 +70,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -86,10 +79,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_basic_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -101,13 +94,6 @@ extern "C" {
   }
 #endif // _di_fss_write_basic_list_process_object_
 
-#ifndef _di_fss_write_basic_list_process_pipe_
-  void fss_write_basic_list_process_pipe(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_basic_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 6ea235fe013cd19fa500d16f156a9bce5fb26076..d27f6e02a286dff97f822bf53adca795e499f423 100644 (file)
@@ -64,11 +64,12 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param content
- *   The string representing the Content to write to the buffer.
+ * @param last
+ *   If TRUE, then this is the last Content in the Content set.
+ *   If FALSE, then this is not the last Content in the Content set.
  */
 #ifndef _di_fss_write_basic_list_process_content_
-  extern void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+  extern void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const bool last);
 #endif // _di_fss_write_basic_list_process_content_
 
 /**
@@ -91,25 +92,6 @@ extern "C" {
 #endif // _di_fss_write_basic_list_process_help_
 
 /**
- * Process normally, writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_basic_list_process_normal_
-  extern void fss_write_basic_list_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_basic_list_process_normal_
-
-/**
  * Process a single Object, printing the FSS-0002 (Basic List) if valid or an error if invalid.
  *
  * @param main
@@ -120,34 +102,11 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param object
- *   The string representing the Object to write to the buffer.
  */
 #ifndef _di_fss_write_basic_list_process_object_
-  extern void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+  extern void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_basic_list_process_object_
 
-/**
- * Process the pipe, reading from the pipe and writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but pipe contained no relevant data.
- *     F_basic_list on success and the basic_list has been printed.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_basic_list_process_pipe_
-  extern void fss_write_basic_list_process_pipe(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_basic_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index e8f6e86686f4680dca9642529cbc8a631d6682c0..2c5b01ff5afed8a5f4111ec61897cfd1ba86ed19 100644 (file)
@@ -7,11 +7,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_basic_list_program_name_s;
   setting.program_name_long = &fss_write_basic_list_program_name_long_s;
+  setting.process_content = &fss_write_basic_list_process_content;
   setting.process_help = &fss_write_basic_list_process_help;
-  setting.process_pipe = &fss_write_basic_list_process_pipe;
   setting.process_normal = &fss_write_basic_list_process_normal;
   setting.process_object = &fss_write_basic_list_process_object;
-  setting.process_content = &fss_write_basic_list_process_content;
+  setting.process_pipe = &fss_write_basic_list_process_pipe;
+  setting.process_set = &fss_write_process_normal;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 08d5669a9e51d01ed1925b7c27d332c6d93c70fe..69c27436c06f721c584765ca2d3e1f7e51064e3b 100644 (file)
@@ -8,14 +8,14 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_embedded_list_process_content_
-  void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+  void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
-        *content,
-        f_fss_complete_none_e,
+        *macro_fss_write_setting(setting)->content,
+        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
         &macro_fss_write_setting(setting)->prepend,
-        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->ignores,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -23,10 +23,10 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         &macro_fss_write_setting(setting)->prepend,
-        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->ignores,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -34,10 +34,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_embedded_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -58,19 +58,12 @@ extern "C" {
   }
 #endif // _di_fss_write_embedded_list_process_help_
 
-#ifndef _di_fss_write_embedded_list_process_normal_
-  void fss_write_embedded_list_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_embedded_list_process_normal_
-
 #ifndef _di_fss_write_embedded_list_process_object_
-  void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+  void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         f_fss_complete_none_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -79,7 +72,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -88,10 +81,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_embedded_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -103,13 +96,6 @@ extern "C" {
   }
 #endif // _di_fss_write_embedded_list_process_object_
 
-#ifndef _di_fss_write_embedded_list_process_pipe_
-  void fss_write_embedded_list_process_pipe(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_embedded_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index c94289a0eab1b6c1f9dd4fdaf73db55bae655a8c..a6f72758babc2d3c79834a8d818c6a4e1d2e7688 100644 (file)
@@ -63,11 +63,12 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param content
- *   The string representing the Content to write to the buffer.
+ * @param last
+ *   If TRUE, then this is the last Content in the Content set.
+ *   If FALSE, then this is not the last Content in the Content set.
  */
 #ifndef _di_fss_write_embedded_list_process_content_
-  extern void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+  extern void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const bool last);
 #endif // _di_fss_write_embedded_list_process_content_
 
 /**
@@ -90,25 +91,6 @@ extern "C" {
 #endif // _di_fss_write_embedded_list_process_help_
 
 /**
- * Process normally, writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_embedded_list_process_normal_
-  extern void fss_write_embedded_list_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_embedded_list_process_normal_
-
-/**
  * Process a single Object, printing the FSS-0008 (Embedded List) if valid or an error if invalid.
  *
  * @param main
@@ -119,34 +101,11 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param object
- *   The string representing the Object to write to the buffer.
  */
 #ifndef _di_fss_write_embedded_list_process_object_
-  extern void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+  extern void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_embedded_list_process_object_
 
-/**
- * Process the pipe, reading from the pipe and writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but pipe contained no relevant data.
- *     F_embedded_list on success and the embedded_list has been printed.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_embedded_list_process_pipe_
-  extern void fss_write_embedded_list_process_pipe(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_embedded_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 494543a76d558cf46b459bf5786c93a780a82d2e..253b605d7e5d073f69ab15d2f252b4b9d603b64c 100644 (file)
@@ -7,11 +7,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_embedded_list_program_name_s;
   setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
+  setting.process_content = &fss_write_embedded_list_process_content;
   setting.process_help = &fss_write_embedded_list_process_help;
-  setting.process_pipe = &fss_write_embedded_list_process_pipe;
   setting.process_normal = &fss_write_embedded_list_process_normal;
   setting.process_object = &fss_write_embedded_list_process_object;
-  setting.process_content = &fss_write_embedded_list_process_content;
+  setting.process_pipe = &fss_write_embedded_list_process_pipe;
+  setting.process_set = &fss_write_process_normal;
+  setting.flag |= fss_write_flag_ignore_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 447a899863365792cd9974b8edcaa3d68644d4e1..3883a9d25b32349dab1dd52764844e612a9e1af1 100644 (file)
@@ -8,13 +8,13 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_extended_process_content_
-  void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+  void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
-        f_fss_complete_none_e,
+        f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -22,7 +22,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
@@ -32,10 +32,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -56,19 +56,12 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_process_help_
 
-#ifndef _di_fss_write_extended_process_normal_
-  void fss_write_extended_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_extended_process_normal_
-
 #ifndef _di_fss_write_extended_process_object_
-  void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+  void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
         f_fss_complete_none_e,
         macro_fss_write_setting(setting)->state,
@@ -78,7 +71,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_single_e) ? f_fss_quote_type_single_e : f_fss_quote_type_double_e,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
@@ -88,10 +81,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -103,13 +96,6 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_process_object_
 
-#ifndef _di_fss_write_extended_process_pipe_
-  void fss_write_extended_process_pipe(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_extended_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 74fd129d534c78c7c2234ab0cb4c5069fcedc49e..d6dffa08829e790e78bdfcc8755f1c7ddfb3d475 100644 (file)
@@ -63,11 +63,12 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param content
- *   The string representing the Content to write to the buffer.
+ * @param last
+ *   If TRUE, then this is the last Content in the Content set.
+ *   If FALSE, then this is not the last Content in the Content set.
  */
 #ifndef _di_fss_write_extended_process_content_
-  extern void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+  extern void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const bool last);
 #endif // _di_fss_write_extended_process_content_
 
 /**
@@ -90,25 +91,6 @@ extern "C" {
 #endif // _di_fss_write_extended_process_help_
 
 /**
- * Process normally, writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_extended_process_normal_
-  extern void fss_write_extended_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_extended_process_normal_
-
-/**
  * Process a single Object, printing the FSS-0001 (Extended) if valid or an error if invalid.
  *
  * @param main
@@ -119,34 +101,11 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param object
- *   The string representing the Object to write to the buffer.
  */
 #ifndef _di_fss_write_extended_process_object_
-  extern void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+  extern void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_extended_process_object_
 
-/**
- * Process the pipe, reading from the pipe and writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but pipe contained no relevant data.
- *     F_extended on success and the extended has been printed.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_extended_process_pipe_
-  extern void fss_write_extended_process_pipe(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_extended_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0da93cc3b72bf3161300ad7f8847c5432b2afcd9..322f590f840c681c8e91e8e6130dc523ea26e9db 100644 (file)
@@ -7,11 +7,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_extended_program_name_s;
   setting.program_name_long = &fss_write_extended_program_name_long_s;
+  setting.process_content = &fss_write_exended_process_content;
   setting.process_help = &fss_write_extended_process_help;
-  setting.process_pipe = &fss_write_extended_process_pipe;
   setting.process_normal = &fss_write_extended_process_normal;
   setting.process_object = &fss_write_exended_process_object;
-  setting.process_content = &fss_write_exended_process_content;
+  setting.process_pipe = &fss_write_extended_process_pipe;
+  setting.process_set = &fss_write_process_normal;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index 202015615f2643e25b9e870a6a27a70e7984deaa..a0b587180eb8e8d29c9645e1916abab7de7796ef 100644 (file)
@@ -8,14 +8,14 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_extended_list_process_content_
-  void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content) {
+  void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
-        *content,
-        f_fss_complete_none_e,
+        *macro_fss_write_setting(setting)->content,
+        last ? f_fss_complete_partial_e : f_fss_complete_partial_trim_e, // @fixme each of these needs to have "partial", "trim", etc..
         &macro_fss_write_setting(setting)->prepend,
-        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->ignores,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -23,10 +23,10 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
-        *content,
+        *macro_fss_write_setting(setting)->content,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         &macro_fss_write_setting(setting)->prepend,
-        &macro_fss_write_setting(setting)->ignores,
+        macro_fss_write_setting(setting)->ignores,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
         &macro_fss_write_setting(setting)->buffer
@@ -34,10 +34,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -58,19 +58,12 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_list_process_help_
 
-#ifndef _di_fss_write_extended_list_process_normal_
-  void fss_write_extended_list_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_extended_list_process_normal_
-
 #ifndef _di_fss_write_extended_list_process_object_
-  void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object) {
+  void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting) {
 
     if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
       macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         f_fss_complete_none_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -79,7 +72,7 @@ extern "C" {
     }
     else {
       macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
-        *object,
+        *macro_fss_write_setting(setting)->object,
         (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
         macro_fss_write_setting(setting)->state,
         &macro_fss_write_setting(setting)->range,
@@ -88,10 +81,10 @@ extern "C" {
     }
 
     if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
-      macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+      macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
 
       fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error, fss_write_extended_list_standard_s);
+      fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
       fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
 
       return;
@@ -103,13 +96,6 @@ extern "C" {
   }
 #endif // _di_fss_write_extended_list_process_object_
 
-#ifndef _di_fss_write_extended_list_process_pipe_
-  void fss_write_extended_list_process_pipe(fll_program_data_t * const main, void * const setting) {
-
-    // @todo
-  }
-#endif // _di_fss_write_extended_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index 0197115bfcbba14965f0a9942bb001bc21671ca3..d7a9d414a5ea3dcc28ffebb30cffdaedb13b85cb 100644 (file)
@@ -63,11 +63,12 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param content
- *   The string representing the Content to write to the buffer.
+ * @param last
+ *   If TRUE, then this is the last Content in the Content set.
+ *   If FALSE, then this is not the last Content in the Content set.
  */
 #ifndef _di_fss_write_extended_list_process_content_
-  extern void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+  extern void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const bool last);
 #endif // _di_fss_write_extended_list_process_content_
 
 /**
@@ -90,25 +91,6 @@ extern "C" {
 #endif // _di_fss_write_extended_list_process_help_
 
 /**
- * Process normally, writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_extended_list_process_normal_
-  extern void fss_write_extended_list_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_extended_list_process_normal_
-
-/**
  * Process a single Object, printing the FSS-0003 (Extended List) if valid or an error if invalid.
  *
  * @param main
@@ -119,34 +101,11 @@ extern "C" {
  *
  *   This alters setting.status.
  *   This uses and alters setting.buffer.
- * @param object
- *   The string representing the Object to write to the buffer.
  */
 #ifndef _di_fss_write_extended_list_process_object_
-  extern void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
+  extern void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_extended_list_process_object_
 
-/**
- * Process the pipe, reading from the pipe and writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_data_not on success but pipe contained no relevant data.
- *     F_extended_list on success and the extended_list has been printed.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_extended_list_process_pipe_
-  extern void fss_write_extended_list_process_pipe(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_extended_list_process_pipe_
-
 #ifdef __cplusplus
 } // extern "C"
 #endif
index efd2e94df6ffb6525674418373de13adfe9ef6f9..8bd3e77783ad98dfb2996dc1666efbbb75821749 100644 (file)
@@ -7,11 +7,13 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_extended_list_program_name_s;
   setting.program_name_long = &fss_write_extended_list_program_name_long_s;
+  setting.process_content = &fss_write_exended_list_process_content;
   setting.process_help = &fss_write_extended_list_process_help;
-  setting.process_pipe = &fss_write_extended_list_process_pipe;
   setting.process_normal = &fss_write_extended_list_process_normal;
   setting.process_object = &fss_write_exended_list_process_object;
-  setting.process_content = &fss_write_exended_list_process_content;
+  setting.process_pipe = &fss_write_extended_list_process_pipe;
+  setting.process_set = &fss_write_process_normal;
+  setting.flag |= fss_write_flag_ignore_e;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;
index ab242a4cfda721e2117ed35a3d4bde8b91d0cae7..20553dd1cb85045724f832a65ab2b9810b325b3e 100644 (file)
@@ -55,13 +55,11 @@ extern "C" {
     f_string_dynamic_resize(0, &setting->escaped);
     f_string_dynamic_resize(0, &setting->block);
     f_string_dynamic_resize(0, &setting->buffer);
-    f_string_dynamic_resize(0, &setting->object);
-    f_string_dynamic_resize(0, &setting->content);
     f_string_dynamic_resize(0, &setting->prepend);
 
-    f_string_ranges_resize(0, &setting->ignores);
+    f_string_rangess_resize(0, &setting->ignoress);
     f_string_dynamics_resize(0, &setting->objects);
-    f_string_dynamics_resize(0, &setting->contents);
+    f_string_dynamicss_resize(0, &setting->contentss);
 
     return F_none;
   }
@@ -211,7 +209,7 @@ extern "C" {
         return;
       }
 
-      // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
+      // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
       for (f_array_length_t index = 0; setting->objects.used < values->used; ) {
 
         index = values->array[setting->objects.used];
@@ -234,27 +232,81 @@ extern "C" {
     }
 
     if ((main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_content_e].values.used) {
-      f_array_lengths_t * const values = &main->parameters.array[fss_write_parameter_content_e].values;
 
-      setting->contents.used = 0;
+        if (setting->flag & fss_write_flag_object_e) {
+        if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+          if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
+            setting->status = F_status_set_error(F_support_not);
 
-      setting->status = f_string_dynamics_resize(values->used, &setting->contents);
+            fss_write_print_error_one_content_only(setting, main->error);
+
+            return;
+          }
+        }
+      }
+
+      f_array_length_t stub_object_array[1] = { 0 };
+      f_array_lengths_t stub_object = macro_f_array_lengths_t_initialize(stub_object_array, 0, 1);
+
+      f_array_lengths_t * const values_content = &main->parameters.array[fss_write_parameter_content_e].values;
+      f_array_lengths_t * const values_object = main->parameters.array[fss_write_parameter_object_e].values.used
+        ? &main->parameters.array[fss_write_parameter_object_e].values
+        : &stub_object;
+
+      setting->contentss.used = 0;
+
+      setting->status = f_string_dynamicss_increase_by(values_object->used, &setting->contentss);
 
       if (F_status_is_error(setting->status)) {
-        fss_write_print_error(setting, main->error, "f_string_dynamics_resize");
+        fss_write_print_error(setting, main->error, "f_string_dynamicss_increase_by");
 
         return;
       }
 
-      // Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
-      for (f_array_length_t index = 0; setting->contents.used < values->used; ) {
+      f_array_length_t i = 0; // For Contents.
+      f_array_length_t j = 0; // For Objects.
+      f_array_length_t k = 0;
+      f_array_length_t total = 0;
+      f_array_length_t index = 0;
 
-        index = values->array[setting->contents.used];
+      // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
+      while (i < values_content->used) {
 
-        setting->contents.array[setting->contents.used].string = main->parameters.arguments.array[index].string;
-        setting->contents.array[setting->contents.used].used = main->parameters.arguments.array[index].used;
-        setting->contents.array[setting->contents.used++].size = 0;
-      } // for
+        // Determine the total Content associated with the given Object.
+        for (total = 0; i + total < values_content->used && (j + 1 >= values_object->used || values_content->array[i + total] < values_object->array[j + 1]); ++total) {
+          // Do nothing.
+        } // for
+
+
+        if (!total) {
+          ++setting->contentss.used;
+
+          if (++j < values_object->used) continue;
+
+          break;
+        }
+
+        setting->status = f_string_dynamics_increase_by(total, &setting->contentss.array[j]);
+
+        if (F_status_is_error(setting->status)) {
+          fss_write_print_error(setting, main->error, "f_string_dynamics_increase_by");
+
+          return;
+        }
+
+        for (k = 0; k < total; ++k) {
+
+          index = values_content->array[i++];
+
+          setting->contentss.array[j].array[setting->contentss.array[j].used].string = main->parameters.arguments.array[index].string;
+          setting->contentss.array[j].array[setting->contentss.array[j].used].used = main->parameters.arguments.array[index].used;
+          setting->contentss.array[j].array[setting->contentss.array[j].used++].size = 0;
+        } // for
+      } // while
+
+      if (total) {
+        ++setting->contentss.used;
+      }
 
       setting->flag |= fss_write_flag_content_e;
     }
@@ -318,7 +370,6 @@ extern "C" {
     }
 
     if ((main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_ignore_e].values.used) {
-
       if (main->parameters.array[fss_write_parameter_ignore_e].values.used % 2 != 0) {
         setting->status = F_status_set_error(F_parameter);
 
@@ -329,58 +380,160 @@ extern "C" {
         return;
       }
 
-      setting->ignores.used = 0;
+      // Only process if the standard designates that the ingore is supported.
+      if (setting->flag & fss_write_flag_ignore_e) {
+        f_array_length_t stub_data_array[1] = { 0 };
+        f_array_lengths_t stub_data = macro_f_array_lengths_t_initialize(stub_data_array, 0, 1);
 
-      setting->status = f_string_ranges_increase_by(main->parameters.array[fss_write_parameter_ignore_e].values.used / 2, &setting->ignores);
+        f_array_lengths_t * const values_ignore = &main->parameters.array[fss_write_parameter_ignore_e].values;
+        f_array_lengths_t * const values_data = main->parameters.array[fss_write_parameter_object_e].values.used
+          ? &main->parameters.array[fss_write_parameter_object_e].values
+          : main->parameters.array[fss_write_parameter_content_e].values.used
+            ? &main->parameters.array[fss_write_parameter_content_e].values
+            : &stub_data;
 
-      if (F_status_is_error(setting->status)) {
-        fss_write_print_error(setting, main->error, "f_string_ranges_increase_by");
+        setting->ignoress.used = 0;
 
-        return;
-      }
+        setting->status = f_string_rangess_increase_by(values_data->used, &setting->ignoress);
 
-      f_array_length_t index = 0;
+        if (F_status_is_error(setting->status)) {
+          fss_write_print_error(setting, main->error, "f_string_rangess_increase_by");
 
-      for (f_array_length_t i = 0; i < main->parameters.array[fss_write_parameter_ignore_e].values.used; i += 2) {
+          return;
+        }
 
-        index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i];
+        f_array_length_t i = 0; // For Ignores.
+        f_array_length_t j = 0; // For Objects/Contents.
+        f_array_length_t k = 0;
+        f_array_length_t total = 0;
+        f_array_length_t index = 0;
+        f_number_unsigned_t number_start = 0;
+        f_number_unsigned_t number_stop = 0;
 
-        setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignores.array[setting->ignores.used].start);
+        // Construct the array without allocating any more memory for the string data by setting this as a static string (used > 0, size = 0).
+        while (i < values_ignore->used) {
 
-        if (F_status_is_error(setting->status)) {
-          fss_write_print_line_first_locked(setting, main->error);
-          fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
-          fss_write_print_line_last_locked(setting, main->error);
+          // Determine the total Ignore associated with the given Object/Content.
+          for (total = 0; i + total < values_ignore->used && (j + 1 >= values_data->used || values_ignore->array[i + total] < values_data->array[j + 1]); ++total) {
+            // Do nothing.
+          } // for
 
-          return;
-        }
+          if (!total) {
+            ++setting->ignoress.used;
 
-        index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i + 1];
+            if (++j < values_data->used) continue;
 
-        setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignores.array[setting->ignores.used].stop);
+            break;
+          }
 
-        if (F_status_is_error(setting->status)) {
-          fss_write_print_line_first_locked(setting, main->error);
-          fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
-          fss_write_print_line_last_locked(setting, main->error);
+          setting->status = f_string_ranges_increase_by(total, &setting->ignoress.array[j]);
 
-          return;
-        }
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_ranges_increase_by");
 
-        if (setting->ignores.array[setting->ignores.used].stop > setting->ignores.array[setting->ignores.used].start) {
-          setting->status = F_status_set_error(F_parameter);
+            return;
+          }
 
-          fss_write_print_line_first_locked(setting, main->error);
-          fll_program_print_error_parameter_range_start_before_stop(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[main->parameters.array[fss_write_parameter_ignore_e].values.array[i]], main->parameters.arguments.array[index]);
-          fss_write_print_line_last_locked(setting, main->error);
+          for (k = 0; k < total; ++k) {
 
-          return;
+            index = values_ignore->array[i++];
+
+            setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].start);
+
+            if (F_status_is_error(setting->status)) {
+              fss_write_print_line_first_locked(setting, main->error);
+              fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
+              fss_write_print_line_last_locked(setting, main->error);
+
+              return;
+            }
+
+            index = values_ignore->array[i++];
+
+            setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop);
+
+            if (F_status_is_error(setting->status)) {
+              fss_write_print_line_first_locked(setting, main->error);
+              fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
+              fss_write_print_line_last_locked(setting, main->error);
+
+              return;
+            }
+
+            if (setting->ignoress.array[j].array[setting->ignoress.array[j].used].stop > setting->ignoress.array[j].array[setting->ignoress.array[j].used].start) {
+              setting->status = F_status_set_error(F_parameter);
+
+              fss_write_print_line_first_locked(setting, main->error);
+              fll_program_print_error_parameter_range_start_before_stop(
+                main->error,
+                f_console_symbol_long_normal_s,
+                fss_write_long_ignore_s,
+                main->parameters.arguments.array[values_ignore->array[i - 1]],
+                main->parameters.arguments.array[index]
+              );
+              fss_write_print_line_last_locked(setting, main->error);
+
+              return;
+            }
+
+            ++setting->ignoress.array[j].used;
+          } // for
+        } // while
+
+        if (total) {
+          ++setting->ignoress.used;
         }
+      }
+      else {
 
-        ++setting->ignores.used;
-      } // for
+        // Still validate the parameters, even if not being used.
+        f_array_length_t i = 0;
+        f_array_length_t index = 0;
+        f_string_range_t number = f_string_range_t_initialize;
+
+        while (i < main->parameters.array[fss_write_parameter_ignore_e].values.used) {
+
+          index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i++];
+
+          setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.start);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_line_first_locked(setting, main->error);
+            fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
+            fss_write_print_line_last_locked(setting, main->error);
 
-      setting->flag |= fss_write_flag_ignore_e;
+            return;
+          }
+
+          index = main->parameters.array[fss_write_parameter_ignore_e].values.array[i++];
+
+          setting->status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->parameters.arguments.array[index], &number.stop);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_line_first_locked(setting, main->error);
+            fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->parameters.arguments.array[index]);
+            fss_write_print_line_last_locked(setting, main->error);
+
+            return;
+          }
+
+          if (number.start > number.stop) {
+            setting->status = F_status_set_error(F_parameter);
+
+            fss_write_print_line_first_locked(setting, main->error);
+            fll_program_print_error_parameter_range_start_before_stop(
+              main->error,
+              f_console_symbol_long_normal_s,
+              fss_write_long_ignore_s,
+              main->parameters.arguments.array[main->parameters.array[fss_write_parameter_ignore_e].values.array[i - 1]],
+              main->parameters.arguments.array[index]
+            );
+            fss_write_print_line_last_locked(setting, main->error);
+
+            return;
+          }
+        } // while
+      }
     }
     else if (main->parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
       setting->status = F_status_set_error(F_parameter);
@@ -391,6 +544,13 @@ extern "C" {
 
       return;
     }
+    else {
+
+      // There is no Object or Content, so remove ignores if set.
+      if (setting->flag & fss_write_flag_ignore_e) {
+        setting->flag -= fss_write_flag_ignore_e;
+      }
+    }
 
     if (main->parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
       setting->flag |= fss_write_flag_partial_e;
@@ -418,12 +578,10 @@ extern "C" {
           return;
         }
 
-        if (main->parameters.array[fss_write_parameter_object_e].locations.used != main->parameters.array[fss_write_parameter_content_e].locations.used && !(setting->flag & fss_write_flag_partial_e)) {
+        if (main->parameters.array[fss_write_parameter_object_e].locations.used > main->parameters.array[fss_write_parameter_content_e].locations.used && !(setting->flag & fss_write_flag_partial_e)) {
           setting->status = F_status_set_error(F_parameter);
 
-          fss_write_print_line_first_locked(setting, main->error);
-          fll_program_print_error_parameter_both_specified_same_amount_without(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_object_s, fss_write_long_content_s, fss_write_long_partial_s);
-          fss_write_print_line_last_locked(setting, main->error);
+          fss_write_print_error_parameter_same_times_at_least(setting, main->error);
 
           return;
         }
index 1e4a8246bfc429edd5459dd0598f83e625318e8a..555a11692a3e4e3c9dd47ab904555ab9c72f0549 100644 (file)
@@ -240,35 +240,35 @@ extern "C" {
  * Flags used to represent flags passed to the main function.
  *
  * fss_write_flag_*_e:
- *   - none:    No modes in use.
- *   - content: The Content being written is specified.
- *   - double:  Operate using double quotes.
- *   - file_to: Using a specified destination file.
- *   - help:    Print help.
- *   - ignore:  Ignore a given range within a Content.
- *   - object:  The Object being written is specified.
- *   - partial: Do not write end of Object/Content character.
- *   - prepend: Prepend the given white space characters to the start of each multi-line Content.
- *   - printed: Designate that the first line has been print for the main output.
- *   - single:  Operate using single quotes.
- *   - trim:    Trim Object names.
- *   - version: Print version.
+ *   - none:             No modes in use.
+ *   - content:          The Content being written is specified.
+ *   - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object.
+ *   - double:           Operate using double quotes.
+ *   - file_to:          Using a specified destination file.
+ *   - help:             Print help.
+ *   - ignore:           Ignore a given range within a Content (specify flag before setting loading to designate ignores is supported by standard).
+ *   - object:           The Object being written is specified.
+ *   - partial:          Do not write end of Object/Content character.
+ *   - prepend:          Prepend the given white space characters to the start of each multi-line Content.
+ *   - single:           Operate using single quotes.
+ *   - trim:             Trim Object names.
+ *   - version:          Print version.
  */
 #ifndef _di_fss_write_flag_e_
   enum {
-    fss_write_flag_none_e    = 0x0,
-    fss_write_flag_content_e = 0x1,
-    fss_write_flag_double_e  = 0x2,
-    fss_write_flag_file_to_e = 0x4,
-    fss_write_flag_help_e    = 0x8,
-    fss_write_flag_ignore_e  = 0x10,
-    fss_write_flag_object_e  = 0x20,
-    fss_write_flag_partial_e = 0x40,
-    fss_write_flag_prepend_e = 0x80,
-    fss_write_flag_printed_e = 0x100,
-    fss_write_flag_single_e  = 0x200,
-    fss_write_flag_trim_e    = 0x400,
-    fss_write_flag_version_e = 0x800,
+    fss_write_flag_none_e             = 0x0,
+    fss_write_flag_content_e          = 0x1,
+    fss_write_flag_content_multiple_e = 0x2,
+    fss_write_flag_double_e           = 0x4,
+    fss_write_flag_file_to_e          = 0x8,
+    fss_write_flag_help_e             = 0x10,
+    fss_write_flag_ignore_e           = 0x20,
+    fss_write_flag_object_e           = 0x40,
+    fss_write_flag_partial_e          = 0x80,
+    fss_write_flag_prepend_e          = 0x100,
+    fss_write_flag_single_e           = 0x200,
+    fss_write_flag_trim_e             = 0x400,
+    fss_write_flag_version_e          = 0x800,
   };
 #endif // _di_fss_write_flag_e_
 
@@ -288,22 +288,32 @@ extern "C" {
  * line_first: A string expected to represent either "\n" or NULL to allow for easy handling of when to print first new line or not.
  * line_last:  A string expected to represent either "\n" or NULL to allow for easy handling of when to print last new line or not.
  *
- * quote: This holds the quote used during processing.
+ * quote:    This holds the quote used during processing.
+ * standard: A human-friendly string describing the standard in use, such as "FSS-0000 (Basic)".
  *
  * escaped: A buffer used for escaping strings during processing.
  * block:   A buffer used to storing one or more blocks while processing a file line by line.
  * buffer:  A buffer used during processing the file.
- * object:  A buffer used to hold an Object during processing.
- * content: A buffer used to hold a Content during processing.
  * prepend: A string to prepend to each multi-line Content.
  *
- * ignores:  An array of ranges passed as values to the "--ignore" parameter.
- * objects:  An array of objects passed as values to the "--object" parameter.
- * contents: An array of objects passed as values to the "--content" parameter and must match the length of objects.
+ * ignoress:  An array of range sets passed as values to the "--ignore" parameter or via the input pipe.
+ * objects:   An array of objects passed as values to the "--object" parameter or via the input pipe.
+ * contentss: An array of content sets passed as values to the "--content" parameter or via the input pipe.
  *
- * process_help:   Process help (generally printing help).
- * process_normal: Process normally (data from parameters and files).
- * process_pipe:   Process using the data from input pipe.
+ * object:   A pointer to a specific Object used during processing.
+ * content:  A pointer to a specific Content used during processing.
+ * contents: A pointer to a specific set of Content used during processing.
+ *
+ * content_separator: A standard format specific string used to separate Content.
+ * program_name:      The short name of the program.
+ * program_name_long: The human friendly name of the program.
+ *
+ * process_content: Process a single Content.
+ * process_help:    Process help (generally printing help).
+ * process_normal:  Process normally (data from parameters and files).
+ * process_object:  Process a single Object.
+ * process_pipe:    Process using the data from input pipe.
+ * process_set:     Process a set of Object and one or more Content.
  */
 #ifndef _di_fss_write_setting_t_
   typedef struct {
@@ -318,26 +328,32 @@ extern "C" {
     f_string_static_t line_last;
 
     f_string_static_t quote;
+    f_string_static_t standard;
 
     f_string_dynamic_t escaped;
     f_string_dynamic_t block;
     f_string_dynamic_t buffer;
-    f_string_dynamic_t object;
-    f_string_dynamic_t content;
     f_string_dynamic_t prepend;
 
-    f_string_ranges_t ignores;
+    f_string_rangess_t ignoress;
     f_string_dynamics_t objects;
-    f_string_dynamics_t contents;
+    f_string_dynamicss_t contentss;
 
+    f_string_ranges_t *ignores;
+    f_string_static_t *object;
+    f_string_static_t *content;
+    f_string_statics_t *contents;
+
+    const f_string_static_t *content_separator;
     const f_string_static_t *program_name;
     const f_string_static_t *program_name_long;
 
+    void (*process_content)(fll_program_data_t * const main, void * const setting, const bool last);
     void (*process_help)(fll_program_data_t * const main, void * const setting);
     void (*process_normal)(fll_program_data_t * const main, void * const setting);
+    void (*process_object)(fll_program_data_t * const main, void * const setting);
     void (*process_pipe)(fll_program_data_t * const main, void * const setting);
-    void (*process_object)(fll_program_data_t * const main, void * const setting, const f_string_static_t * const object);
-    void (*process_content)(fll_program_data_t * const main, void * const setting, const f_string_static_t * const content);
+    void (*process_set)(fll_program_data_t * const main, void * const setting);
   } fss_write_setting_t;
 
   #define fss_write_setting_t_initialize \
@@ -348,15 +364,20 @@ extern "C" {
       f_string_range_t_initialize, \
       f_string_static_t_initialize, \
       f_string_static_t_initialize, \
+      f_string_static_t_initialize, \
       f_string_dynamic_t_initialize, \
       f_string_dynamic_t_initialize, \
       f_string_dynamic_t_initialize, \
       f_string_dynamic_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_dynamic_t_initialize, \
-      f_string_ranges_t_initialize, \
-      f_string_dynamics_t_initialize, \
+      f_string_rangess_t_initialize, \
       f_string_dynamics_t_initialize, \
+      f_string_dynamicss_t_initialize, \
+      0, \
+      0, \
+      0, \
+      0, \
+      0, \
+      0, \
       0, \
       0, \
       0, \
index 1989ec4de1447e60a8bfc21004435b3552642f9a..ae13fce3377bb3c5c7f114dda2b12002a6392734 100644 (file)
@@ -42,48 +42,395 @@ extern "C" {
   }
 #endif // _di_fss_write_main_
 
-#ifndef _di_fss_write_process_set_
-  void fss_write_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t * const object, const f_string_static_t * const content) {
+#ifndef _di_fss_write_process_normal_
+  void fss_write_process_normal(fll_program_data_t * const main, void * const setting) {
 
-    setting->buffer.used = 0;
+    fss_write_process_normal_data(
+      main,
+      macro_fss_write_setting(setting),
+      (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e)
+        ? macro_fss_write_setting(setting)->objects.used
+        : macro_fss_write_setting(setting)->contentss.used
+    );
+  }
+#endif // _di_fss_write_process_normal_
 
-    if (object) {
-      if (object->used) {
-        setting->range.start = 0;
-        setting->range.stop = object->used - 1;
+#ifndef _di_fss_write_process_normal_data_
+  void fss_write_process_normal_data(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_array_length_t length) {
+
+    setting->ignores = 0;
+    setting->object = 0;
+    setting->content = 0;
+    setting->contents = 0;
+
+    for (f_array_length_t i = 0; i < length; ++i) {
+
+      // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
+      if (!((++main->signal_check) % fss_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          setting->status = F_status_set_error(F_interrupt);
+
+          return;
+        }
+
+        main->signal_check = 0;
+      }
+
+      if (setting->objects.used) {
+        setting->object = &setting->objects.array[i];
+      }
+
+      if (setting->contentss.used) {
+        setting->contents = &setting->contentss.array[i];
+      }
+
+      if (setting->ignoress.used) {
+        setting->ignores = &setting->ignoress.array[i];
+      }
+
+      setting->process_set(main, setting);
+      if (F_status_is_error(setting->status)) break;
+    } // for
+  }
+#endif // _di_fss_write_process_normal_data_
+
+#ifndef _di_fss_write_process_pipe_
+  void fss_write_process_pipe(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    f_status_t status_pipe = F_none;
+    f_file_t input = f_file_t_initialize;
+    input.id = F_type_descriptor_input_d;
+    input.size_read = setting->state.step_large;
+
+    f_array_length_t total = 0;
+    f_array_length_t length = 0;
+    f_array_length_t ignore_start = 0;
+    f_string_range_t range = f_string_range_t_initialize;
+
+    const f_array_length_t used_objects = setting->objects.used;
+    const f_array_length_t used_contentss = setting->contentss.used;
+    const f_array_length_t used_ignoress = setting->ignoress.used;
+
+    // 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object.
+    uint8_t flag = 0;
+
+    // 0x0 = start new object/content set, 0x1 = processing object, 0x2 = processing content, 0x3 = end object/content set.
+    uint8_t state = 0;
+
+    // This is processed in a single set, so there is only ever one Object added.
+    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+      return;
+    }
+
+    // This is processed in a single set, so there is only ever one Content added.
+    setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamicss_increase");
+
+      return;
+    }
+
+    // This is processed in a single set, so there is only ever one Ignores added.
+    setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_rangess_increase");
+
+      return;
+    }
+
+    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+      return;
+    }
+
+    for (;;) {
+
+      if (!((++main->signal_check) % fss_write_signal_check_d)) {
+        if (fll_program_standard_signal_received(main)) {
+          fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
+
+          setting->status = F_status_set_error(F_interrupt);
+
+          break;
+        }
+
+        main->signal_check = 0;
+      }
+
+      if (range.start > range.stop) {
+        if (status_pipe == F_none_eof) break;
+
+        setting->block.used = 0;
+
+        status_pipe = f_file_read_block(input, &setting->block);
+
+        if (F_status_is_error(status_pipe)) {
+          fss_write_print_error(setting, main->error, "f_file_read_block");
+
+          status_pipe = F_status_set_error(F_pipe);
+
+          break;
+        }
+
+        if (!setting->block.used) break;
+
+        range.start = 0;
+        range.stop = setting->block.used - 1;
+      }
+
+      // Start Object.
+      if (!state || state == 0x1) {
+        if (!state) {
+          setting->objects.array[used_objects].used = 0;
+
+          state = 0x1;
+        }
+
+        // Reset the "has Content for Object" flag and associated contents array used length.
+        flag -= flag | 0x4;
+        setting->contentss.array[used_contentss].used = 0;
+
+        if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
+          setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+
+            break;
+          }
+        }
+
+        for (; range.start <= range.stop; ++range.start) {
+
+          if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+            state = 0x2;
+            ++range.start;
+
+            break;
+          }
+
+          if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+            state = 0x3;
+            ++range.start;
+
+            break;
+          }
+
+          if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+
+            // @todo implement this, populating the ignores array, continue until no ignores is found, so set a new state to represent this.
+            continue;
+          }
+
+          setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
+        } // for
+
+        if (F_status_is_error(setting->status)) break;
+
+        // If the start of Content is not found, then fetch the next block.
+        if (state == 0x1) continue;
+
+        // If the end of the current block is reached, fetch the next block.
+        if (range.start > range.stop) continue;
+      }
+
+      // Start Content.
+      if (state == 0x2) {
+
+        // Check to see if the Content supports multiple Content per Object.
+        if (flag & 0x4) {
+          if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+            setting->status = F_status_set_error(F_support_not);
+
+            fss_write_print_error_one_content_only(setting, main->error);
+
+            break;
+          }
+
+          setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+            break;
+          }
+        }
+
+        if (range.start <= range.stop) {
+          total = (range.stop - range.start) + 1;
+        }
+        else {
+          total = 0;
+        }
+
+        if (total) {
+          setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used]);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+
+            break;
+          }
+
+          for (; range.start <= range.stop; ++range.start) {
+
+            if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+              setting->status = F_status_set_error(F_support_not);
+
+              fss_write_print_error_one_content_only(setting, main->error);
+
+              break;
+            }
+
+            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+              state = 0x3;
+              ++range.start;
+
+              break;
+            }
+
+            if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+
+              // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
+              continue;
+            }
+
+            setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].string[setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].used++] = setting->block.string[range.start];
+          } // for
+
+          if (F_status_is_error(setting->status)) break;
+
+          ++setting->contentss.array[used_contentss].used;
+          flag |= 0x4;
+        }
+        else {
+          state = 0x3;
+        }
+      }
+
+      // End Object or Content set.
+      if (state == 0x3) {
+        if (setting->flag & fss_write_flag_partial_e) {
+          if (setting->flag & fss_write_flag_content_e) {
+            setting->object = 0;
+            setting->contents = &setting->contentss.array[used_contentss];
+          }
+          else {
+            setting->object = &setting->objects.array[used_objects];
+            setting->contents = 0;
+          }
+        }
+        else {
+          setting->object = &setting->objects.array[used_objects];
+          setting->contents = &setting->contentss.array[used_contentss];
+        }
+
+        setting->ignores = &setting->ignoress.array[used_contentss];
+
+        setting->process_set(main, void_setting);
+        if (F_status_is_error(setting->status)) break;
+
+        state = 0;
+        flag |= 0x1;
+
+        continue;
+      }
+    } // for
+
+    // If the pipe ended before finishing, then attempt to wrap up.
+    if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
+      if (setting->flag & fss_write_flag_partial_e) {
+        if (setting->flag & fss_write_flag_content_e) {
+          setting->object = 0;
+          setting->contents = &setting->contentss.array[used_contentss];
+        }
+        else {
+          setting->object = &setting->objects.array[used_objects];
+          setting->contents = 0;
+        }
       }
       else {
-        setting->range.start = 1;
-        setting->range.stop = 0;
+        setting->object = &setting->objects.array[used_objects];
+        setting->contents = &setting->contentss.array[used_contentss];
       }
 
-      setting->process_object(main, (void *) setting, object);
-      if (F_status_is_error(setting->status)) return;
+      setting->ignores = &setting->ignoress.array[used_contentss];
+
+      setting->process_set(main, void_setting);
+
+      flag |= 0x1;
     }
 
-    if (content) {
-      if (content->used) {
+    setting->block.used = 0;
+    setting->buffer.used = 0;
+    setting->ignoress.used = used_ignoress;
+    setting->objects.used = used_objects;
+    setting->contentss.used = used_contentss;
+
+    if (F_status_is_error_not(setting->status)) {
+      setting->status = (flag & 0x1) ? F_none : F_data_not;
+
+      // Print newline character to separate data printed from pipe.
+      if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
+        fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
+      }
+    }
+  }
+#endif // _di_fss_write_process_pipe_
+
+#ifndef _di_fss_write_process_set_
+  void fss_write_process_set(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+    setting->buffer.used = 0;
+
+    if (setting->object) {
+      if (setting->object->used) {
         setting->range.start = 0;
-        setting->range.stop = content->used - 1;
+        setting->range.stop = setting->object->used - 1;
       }
       else {
         setting->range.start = 1;
         setting->range.stop = 0;
       }
 
-      setting->process_content(main, (void *) setting, content);
+      setting->process_object(main, void_setting);
       if (F_status_is_error(setting->status)) return;
     }
 
-    if (setting->buffer.used) {
-      fss_write_print_line_first_locked(setting, main->message);
+    if (setting->contents) {
+      for (f_array_length_t i = 0; i < setting->contents->used; ++i) {
+
+        if (setting->contents->array[i].used) {
+          setting->range.start = 0;
+          setting->range.stop = setting->contents->array[i].used - 1;
+        }
+        else {
+          setting->range.start = 1;
+          setting->range.stop = 0;
+        }
 
-      f_file_stream_lock(main->output.to);
+        setting->content = &setting->contents->array[i];
 
-      f_print_dynamic(setting->buffer, main->output.to);
-      f_print_dynamic_raw(f_string_eol_s, main->output.to);
+        setting->process_content(main, void_setting, i + 1 == setting->contents->used);
+        if (F_status_is_error(setting->status)) return;
+      } // for
+    }
 
-      f_file_stream_unlock(main->output.to);
+    if (setting->buffer.used) {
+      fll_print_dynamic(setting->buffer, main->output.to);
     }
   }
 #endif // _di_fss_write_process_set_
index a5727a08412fab412068bf33b247d5e33f9e7423..795a1cc1250f4a2bf4955f59cff21a056b175ca9 100644 (file)
@@ -78,12 +78,76 @@ extern "C" {
 #endif // _di_fss_write_main_
 
 /**
+ * Process normally, writing to the output for the assigned FSS format.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status:
+ *     status from fss_write_process_normal_data().
+ *
+ *     Errors (with error bit) from fss_write_process_normal_data().
+ *
+ * @see fss_write_process_normal_data()
+ */
+#ifndef _di_fss_write_process_normal_
+  extern void fss_write_process_normal(fll_program_data_t * const main, void * const setting);
+#endif // _di_fss_write_process_normal_
+
+/**
+ * Process the data normally, writing to the output for the assigned FSS format.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_interrupt on (exit) signal received.
+ *
+ *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ */
+#ifndef _di_fss_write_process_normal_data_
+  void fss_write_process_normal_data(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_array_length_t length);
+#endif // _di_fss_write_process_normal_data_
+
+/**
+ * Process the pipe, reading from the pipe and writing to the output for the assigned FSS format.
+ *
+ * @param main
+ *   The main program data.
+ * @param setting
+ *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   This alters setting.status:
+ *     F_none on success.
+ *     F_data_not on success but pipe contained no relevant data.
+ *     F_basic on success and the basic has been printed.
+ *     F_interrupt on (exit) signal received.
+ *
+ *     F_parameter (with error bit) if main is NULL or setting is NULL.
+ */
+#ifndef _di_fss_write_process_pipe_
+  extern void fss_write_process_pipe(fll_program_data_t * const main, void * const setting);
+#endif // _di_fss_write_process_pipe_
+
+/**
  * Process a given Object and Content, printing the assigned FSS format if valid or an error if invalid.
  *
  * @param main
  *   The main program data.
  * @param setting
  *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   Set setting.object to 0 to not use an Object.
+ *   Set setting.contents to 0 to not use an Content set.
  *
  *   This alters setting.status:
  *     F_none on success.
@@ -92,13 +156,13 @@ extern "C" {
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
  * @param object
  *   The object to validate and print.
- *   Set pointer address to 0 to not use.
+ *   Set to setting.objects.used to not use.
  * @param content
  *   The content to escape and print.
- *   Set pointer address to 0 to not use.
+ *   Set start to 1 and stop to 0 to not use.
  */
 #ifndef _di_fss_write_process_set_
-  extern void fss_write_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t * const object, const f_string_static_t * const content);
+  extern void fss_write_process_set(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_process_set_
 
 #ifdef __cplusplus
index f7ccea3900fede973892e67e65b480befc33f634..b1d92318824af970718a2ec77e904bcf90c578d8 100644 (file)
@@ -56,13 +56,15 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 
     if (!main || !setting || F_status_is_error(setting->status) || (setting->flag & fss_write_flag_version_e)) return;
 
+    setting->standard = fss_write_basic_standard_s;
     setting->program_name = &fss_write_program_name_s;
     setting->program_name_long = &fss_write_program_name_long_s;
+    setting->process_content = &fss_write_basic_process_content;
     setting->process_help = &fss_write_main_process_help;
-    setting->process_pipe = &fss_write_basic_process_pipe;
-    setting->process_normal = &fss_write_basic_process_normal;
     setting->process_object = &fss_write_basic_process_object;
-    setting->process_content = &fss_write_basic_process_content;
+    setting->process_pipe = &fss_write_process_pipe;
+    setting->process_normal = &fss_write_process_normal;
+    setting->process_set = &fss_write_process_set;
 
     if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_as_e].values.used) {
 
@@ -77,73 +79,98 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
             fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0000_s) == F_equal_to ||
             fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0000_s) == F_equal_to) {
 
+          setting->standard = fss_write_basic_standard_s;
           setting->program_name = &fss_write_basic_program_name_s;
           setting->program_name_long = &fss_write_basic_program_name_long_s;
+          setting->process_content = &fss_write_basic_process_content;
           setting->process_help = &fss_write_basic_process_help;
-          setting->process_pipe = &fss_write_basic_process_pipe;
-          setting->process_normal = &fss_write_basic_process_normal;
           setting->process_object = &fss_write_basic_process_object;
-          setting->process_content = &fss_write_basic_process_content;
+          setting->process_pipe = &fss_write_process_pipe;
+          setting->process_normal = &fss_write_process_normal;
+          setting->process_set = &fss_write_process_set;
+          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic.
+          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by payload.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
 
+          setting->standard = fss_write_extended_standard_s;
+          setting->content_separator = 0; // Not used by extended.
           setting->program_name = &fss_write_extended_program_name_s;
           setting->program_name_long = &fss_write_extended_program_name_long_s;
+          setting->process_content = &fss_write_extended_process_content;
           setting->process_help = &fss_write_extended_process_help;
-          setting->process_pipe = &fss_write_extended_process_pipe;
-          setting->process_normal = &fss_write_extended_process_normal;
           setting->process_object = &fss_write_extended_process_object;
-          setting->process_content = &fss_write_extended_process_content;
+          setting->process_pipe = &fss_write_process_pipe;
+          setting->process_normal = &fss_write_process_normal;
+          setting->process_set = &fss_write_process_set;
+          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by extended.
+          setting->flag |= fss_write_flag_content_multiple_e;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0002_s) == F_equal_to) {
 
+          setting->standard = fss_write_basic_list_standard_s;
           setting->program_name = &fss_write_basic_list_program_name_s;
           setting->program_name_long = &fss_write_basic_list_program_name_long_s;
+          setting->process_content = &fss_write_basic_list_process_content;
           setting->process_help = &fss_write_basic_list_process_help;
-          setting->process_pipe = &fss_write_basic_list_process_pipe;
-          setting->process_normal = &fss_write_basic_list_process_normal;
           setting->process_object = &fss_write_basic_list_process_object;
-          setting->process_content = &fss_write_basic_list_process_content;
+          setting->process_pipe = &fss_write_process_pipe;
+          setting->process_normal = &fss_write_process_normal;
+          setting->process_set = &fss_write_process_set;
+          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by basic list.
+          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by basic list.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0003_s) == F_equal_to) {
 
+          setting->standard = fss_write_extended_list_standard_s;
           setting->program_name = &fss_write_extended_list_program_name_s;
           setting->program_name_long = &fss_write_extended_list_program_name_long_s;
+          setting->process_content = &fss_write_extended_list_process_content;
           setting->process_help = &fss_write_extended_list_process_help;
-          setting->process_pipe = &fss_write_extended_list_process_pipe;
-          setting->process_normal = &fss_write_extended_list_process_normal;
           setting->process_object = &fss_write_extended_list_process_object;
-          setting->process_content = &fss_write_extended_list_process_content;
+          setting->process_pipe = &fss_write_process_pipe;
+          setting->process_normal = &fss_write_process_normal;
+          setting->process_set = &fss_write_process_set;
+          setting->flag |= fss_write_flag_ignore_e;
+          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by extended list.
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0008_s) == F_equal_to) {
 
+          setting->standard = fss_write_embedded_list_standard_s;
           setting->program_name = &fss_write_embedded_list_program_name_s;
           setting->program_name_long = &fss_write_embedded_list_program_name_long_s;
+          setting->process_content = &fss_write_embedded_list_process_content;
           setting->process_help = &fss_write_embedded_list_process_help;
-          setting->process_pipe = &fss_write_embedded_list_process_pipe;
-          setting->process_normal = &fss_write_embedded_list_process_normal;
           setting->process_object = &fss_write_embedded_list_process_object;
-          setting->process_content = &fss_write_embedded_list_process_content;
+          setting->process_pipe = &fss_write_process_pipe;
+          setting->process_normal = &fss_write_process_normal;
+          setting->process_set = &fss_write_process_set;
+          setting->flag |= fss_write_flag_ignore_e;
+          setting->flag |= fss_write_flag_content_multiple_e;
         }
         else if (fl_string_dynamic_compare(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
                  fl_string_dynamic_compare(argv[index], fss_write_format_code_human_000e_s) == F_equal_to) {
 
+          setting->standard = fss_write_payload_standard_s;
           setting->program_name = &fss_write_payload_program_name_s;
           setting->program_name_long = &fss_write_payload_program_name_long_s;
+          setting->process_content = 0; // Not used by payload.
           setting->process_help = &fss_write_payload_process_help;
-          setting->process_pipe = &fss_write_payload_process_pipe;
-          setting->process_normal = &fss_write_payload_process_normal;
+          setting->process_normal = &fss_write_process_normal;
           setting->process_object = 0; // Not used by payload.
-           setting->process_content = 0; // Not used by payload.
+          setting->process_pipe = &fss_write_payload_process_pipe;
+          setting->process_set = &fss_write_payload_process_set;
+          setting->flag -= setting->flag & fss_write_flag_ignore_e; // Not supported by payload.
+          setting->flag -= setting->flag & fss_write_flag_content_multiple_e; // Not supported by payload.
         }
         else {
           if (setting->flag & fss_write_flag_help_e) {
index 3cee7a831382fd652feec8e54e3ddad44e0aa33f..cac7e2d9333b69c23a4b631bccb4ce643066a83a 100644 (file)
@@ -31,8 +31,8 @@ extern "C" {
   }
 #endif // _di_fss_write_print_error_file_
 
-#ifndef _di_fss_write_print_error_parameter_same_times_
-  f_status_t fss_write_print_error_parameter_same_times(fss_write_setting_t * const setting, const fl_print_t print) {
+#ifndef _di_fss_write_print_error_parameter_same_times_at_least_
+  f_status_t fss_write_print_error_parameter_same_times_at_least(fss_write_setting_t * const setting, const fl_print_t print) {
 
     if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
@@ -43,7 +43,7 @@ extern "C" {
     fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_object_s, print.notable);
     fl_print_format("%[' parameter and the '%]", print.to, print.context, print.context);
     fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_content_s, print.notable);
-    fl_print_format("%[' parameter the same number of times when not specifying the '%]", print.to, print.context, print.context);
+    fl_print_format("%[' parameter at least the same number of times when not specifying the '%]", print.to, print.context, print.context);
     fl_print_format("%[%r%r%]", print.to, print.notable, f_console_symbol_long_normal_s, fss_write_long_partial_s, print.notable);
     fl_print_format("%[' parameter.%]%r", print.to, print.context, print.context, f_string_eol_s);
     fss_write_print_line_last_unlocked(setting, print);
@@ -52,40 +52,25 @@ extern "C" {
 
     return F_none;
   }
-#endif // _di_fss_write_print_error_parameter_same_times_
+#endif // _di_fss_write_print_error_parameter_same_times_at_least_
 
-// @todo replace fss_basic_write_error_parameter_value_missing_print with fll_program_print_error_parameter_missing_value.
-
-#ifndef _di_fss_write_print_error_parameter_unsupported_eol_object_
-  f_status_t fss_write_print_error_parameter_unsupported_eol_object(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard) {
+#ifndef _di_fss_write_print_error_one_content_only_
+  f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print) {
 
     if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
     fss_write_print_line_first_unlocked(setting, print);
-    fl_print_format("%[%QThe %r standard does not support end of line character '%]", print.to, print.context, print.prefix, standard, print.context);
-    fl_print_format("%[\\n%]", print.to, print.notable, print.notable);
-    fl_print_format("%[' (%]", print.to, print.context, print.context);
-    fl_print_format("%[U+000A%]", print.to, print.notable, print.notable);
-    fl_print_format("%[) in objects.%]%r", print.to, print.context, print.context, f_string_eol_s);
+    fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
+    fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
+    fl_print_format(" %[standard only supports one Content per Object.%]%r", print.to, print.context, print.context, f_string_eol_s);
     fss_write_print_line_last_unlocked(setting, print);
 
     f_file_stream_unlock(print.to);
 
     return F_none;
   }
-#endif // _di_fss_write_print_error_parameter_unsupported_eol_object_
-
-#ifndef _di_fss_write_print_error_one_content_only_
-  f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard) {
-
-    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-
-    fll_print_format("%r%[%QThe %Q standard only supports one content per object.%]%r", print.to, f_string_eol_s, print.set->error, print.prefix, print.set->error, standard, f_string_eol_s);
-
-    return F_none;
-  }
 #endif // _di_fss_write_print_error_one_content_only_
 
 #ifndef _fss_write_print_error_prepend_only_whitespace_
@@ -106,17 +91,22 @@ extern "C" {
 #endif // _fss_write_print_error_prepend_only_whitespace_
 
 #ifndef _di_fss_write_print_error_unsupported_eol_
-  f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard) {
+  f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print) {
 
     if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
     f_file_stream_lock(print.to);
 
-    fl_print_format("%r%[%QThe %Q standard does not support end of line character '%]", print.to, f_string_eol_s, print.set->error, print.prefix, standard, print.set->error);
+    fss_write_print_line_first_unlocked(setting, print);
+    fl_print_format("%[%QThe%] ", print.to, print.context, print.prefix, print.context);
+    fl_print_format("%[%r%]", print.to, print.notable, setting->standard, print.notable);
+    fl_print_format(" %[standard does not support end of line character '%]", print.to, print.context, print.context);
+    fss_write_print_line_last_unlocked(setting, print);
+
     fl_print_format("%[\\n%]", print.to, print.set->notable, print.set->notable);
     fl_print_format("%[' (%]", print.to, print.set->error, print.set->error);
     fl_print_format("%[U+000A%]", print.to, print.set->notable, print.set->notable);
-    fl_print_format("%[) in objects.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
+    fl_print_format("%[) in Objects.%]%r", print.to, print.set->error, print.set->error, f_string_eol_s);
 
     f_file_stream_unlock(print.to);
 
@@ -161,18 +151,11 @@ extern "C" {
 #ifndef _di_fss_write_print_line_first_locked_
   f_status_t fss_write_print_line_first_locked(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (setting->flag & fss_write_flag_printed_e) return F_output_not;
-
-    if (F_status_is_error(setting->status)) {
-      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-    }
-    else {
-
-      // Always set to true to regardless of whether printed actually happened for non-errors.
-      setting->flag |= fss_write_flag_printed_e;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!F_status_is_error(setting->status)) {
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
+      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
 
     f_print_dynamic_raw(setting->line_first, print.to);
@@ -184,18 +167,11 @@ extern "C" {
 #ifndef _di_fss_write_print_line_first_unlocked_
   f_status_t fss_write_print_line_first_unlocked(fss_write_setting_t * const setting, const fl_print_t print) {
 
-    if (setting->flag & fss_write_flag_printed_e) return F_output_not;
-
-    if (F_status_is_error(setting->status)) {
-      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
-    }
-    else {
-
-      // Always set to true to regardless of whether printed actually happened for non-errors.
-      setting->flag |= fss_write_flag_printed_e;
+    if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
 
-      if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not;
+    if (!F_status_is_error(setting->status)) {
       if (print.verbosity == f_console_verbosity_error_e) return F_output_not;
+      if (setting->flag & fss_write_flag_file_to_e) return F_output_not;
     }
 
     fll_print_dynamic_raw(setting->line_first, print.to);
index 5740c9c360c8ed69d25286a117e9b5158536a915..6ac12f829dc670a3a36902356e5312738ea3e9a7 100644 (file)
@@ -62,7 +62,7 @@ extern "C" {
 #endif // _di_fss_write_print_error_file_
 
 /**
- * Print an error message about the object and content parameters not being specified the same number of times.
+ * Print an error message about the object and content parameters not being specified at least the same number of times when partial is not requested.
  *
  * @param setting
  *   The main program settings.
@@ -77,12 +77,12 @@ extern "C" {
  *
  * @see fll_error_print()
  */
-#ifndef _di_fss_write_print_error_parameter_same_times_
-  extern f_status_t fss_write_print_error_parameter_same_times(fss_write_setting_t * const setting, const fl_print_t print);
-#endif // _di_fss_write_print_error_parameter_same_times_
+#ifndef _di_fss_write_print_error_parameter_same_times_at_least_
+  extern f_status_t fss_write_print_error_parameter_same_times_at_least(fss_write_setting_t * const setting, const fl_print_t print);
+#endif // _di_fss_write_print_error_parameter_same_times_at_least_
 
 /**
- * Print an error message about a parameter a new line character '\n' (U+000A) being unsupported for an Object for the given standard.
+ * Print an message about a multiple Content being unsupported for a particular standard.
  *
  * @param setting
  *   The main program settings.
@@ -90,37 +90,13 @@ extern "C" {
  *   This does not alter setting.status.
  * @param print
  *   Designates the how and where to print.
- * @param standard
- *   The string used to communicate the standad that does not support the EOL character.
- *
- * @return
- *   F_none on success.
- *   F_output_not on success, but no printing is performed.
- *
- * @see fll_error_print()
- */
-#ifndef _di_fss_write_print_error_parameter_unsupported_eol_object_
-  extern f_status_t fss_write_print_error_parameter_unsupported_eol_object(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard);
-#endif // _di_fss_write_print_error_parameter_unsupported_eol_object_
-
-/**
- * Print an message about a multiple Content being unsupported.
- *
- * @param setting
- *   The main program settings.
- *
- *   This does not alter setting.status.
- * @param print
- *   Designates the how and where to print.
- * @param standard
- *   A string representing the standard name, such as "FSS-0000 (Basic)".
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fss_write_print_error_one_content_only_
-  extern f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard);
+  extern f_status_t fss_write_print_error_one_content_only(fss_write_setting_t * const setting, const fl_print_t print);
 #endif // _di_fss_write_print_error_one_content_only_
 
 /**
@@ -150,15 +126,13 @@ extern "C" {
  *   This does not alter setting.status.
  * @param print
  *   Designates the how and where to print.
- * @param standard
- *   A string representing the standard name, such as "FSS-0000 (Basic)".
  *
  * @return
  *   F_none on success.
  *   F_output_not on success, but no printing is performed.
  */
 #ifndef _di_fss_write_print_error_unsupported_eol_
-  extern f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print, const f_string_static_t standard);
+  extern f_status_t fss_write_print_error_unsupported_eol(fss_write_setting_t * const setting, const fl_print_t print);
 #endif // _di_fss_write_print_error_unsupported_eol_
 
 /**
index 63b8feeb77869cfbd1c562fe574c0812f8a01097..740344fd26e155e002ef0686e29dbdb12a4426d2 100644 (file)
@@ -14,61 +14,66 @@ extern "C" {
   }
 #endif // _di_fss_write_payload_process_help_
 
-#ifndef _di_fss_write_payload_process_normal_
-  void fss_write_payload_process_normal(fll_program_data_t * const main, void * const setting) {
-
-    f_string_statics_t * const data = (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects : &macro_fss_write_setting(setting)->contents;
-
-    for (f_array_length_t i = 0; i < data->used; ++i) {
-
-      // @todo replace all signal checks with forked main process that independently checks and assigns main->signal_received.
-      if (!((++main->signal_check) % fss_write_signal_check_d)) {
-        if (fll_program_standard_signal_received(main)) {
-          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
-
-          return;
-        }
-
-        main->signal_check = 0;
-      }
-
-      fss_write_payload_process_set(
-        main,
-        macro_fss_write_setting(setting),
-        (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e) ? &macro_fss_write_setting(setting)->objects.array[i] : 0,
-        (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) ? &macro_fss_write_setting(setting)->contents.array[i] : 0
-      );
-
-      if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
-    } // for
-  }
-#endif // _di_fss_write_payload_process_normal_
-
 #ifndef _di_fss_write_payload_process_pipe_
-  void fss_write_payload_process_pipe(fll_program_data_t * const main, void * const setting) {
+  void fss_write_payload_process_pipe(fll_program_data_t * const main, void * const void_setting) {
 
     f_status_t status_pipe = F_none;
     f_file_t input = f_file_t_initialize;
     input.id = F_type_descriptor_input_d;
     input.size_read = fss_write_common_allocation_large_d;
 
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
     f_array_length_t total = 0;
     f_array_length_t length = 0;
     f_string_range_t range = f_string_range_t_initialize;
 
-    // 0x0 = nothing printed, 0x1 = something printed, 0x2 = "payload" matched.
-    uint8_t printed = 0;
+    const f_array_length_t used_objects = setting->objects.used;
+    const f_array_length_t used_contentss = setting->contentss.used;
+    const f_array_length_t used_ignoress = setting->ignoress.used;
+
+    // 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object, 0x8 = "payload" matched.
+    uint8_t flag = 0;
 
     // 0x0 = start new object/content set, 0x1 = processing object, 0x2 = processing content, 0x3 = end object/content set, 0x4 = processing payload content.
     uint8_t state = 0;
 
+    setting->objects.used = 0;
+    setting->contentss.used = 0;
+
+    // This is processed in a set, so there is only ever one Object.
+    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+      return;
+    }
+
+    // This is processed in a set, so there is only ever one Content set.
+    setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamicss_increase");
+
+      return;
+    }
+
+    setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[0]);
+
+    if (F_status_is_error(setting->status)) {
+      fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+      return;
+    }
+
     for (;;) {
 
       if (!((++main->signal_check) % fss_write_signal_check_d)) {
         if (fll_program_standard_signal_received(main)) {
-          fll_program_print_signal_received(main->warning, macro_fss_write_setting(setting)->line_first, main->signal_received);
+          fll_program_print_signal_received(main->warning, setting->line_first, main->signal_received);
 
-          macro_fss_write_setting(setting)->status = F_status_set_error(F_interrupt);
+          setting->status = F_status_set_error(F_interrupt);
 
           break;
         }
@@ -79,37 +84,41 @@ extern "C" {
       if (range.start > range.stop) {
         if (status_pipe == F_none_eof) break;
 
-        macro_fss_write_setting(setting)->block.used = 0;
+        setting->block.used = 0;
 
-        status_pipe = f_file_read_block(input, &macro_fss_write_setting(setting)->block);
+        status_pipe = f_file_read_block(input, &setting->block);
 
         if (F_status_is_error(status_pipe)) {
-          fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_file_read_block");
+          fss_write_print_error(setting, main->error, "f_file_read_block");
 
           status_pipe = F_status_set_error(F_pipe);
 
           break;
         }
 
-        if (!macro_fss_write_setting(setting)->block.used) break;
+        if (!setting->block.used) break;
 
         range.start = 0;
-        range.stop = macro_fss_write_setting(setting)->block.used - 1;
+        range.stop = setting->block.used - 1;
       }
 
+      // Begin Object.
       if (!state || state == 0x1) {
         if (!state) {
-          macro_fss_write_setting(setting)->object.used = 0;
-          macro_fss_write_setting(setting)->content.used = 0;
+          setting->objects.array[used_objects].used = 0;
 
           state = 0x1;
         }
 
-        if (macro_fss_write_setting(setting)->object.used + macro_fss_write_setting(setting)->block.used > macro_fss_write_setting(setting)->object.size) {
-          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(macro_fss_write_setting(setting)->block.used, &macro_fss_write_setting(setting)->object);
+        // Reset the "has Content for Object" flag and associated contents array used length.
+        flag -= flag | 0x4;
+        setting->contentss.array[used_contentss].used = 0;
+
+        if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
+          setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
 
-          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
-            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
@@ -117,39 +126,60 @@ extern "C" {
 
         for (; range.start <= range.stop; ++range.start) {
 
-          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+          if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
             state = 0x2;
             ++range.start;
 
             break;
           }
 
-          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+          if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
             state = 0x3;
             ++range.start;
 
             break;
           }
 
-          if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+          if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-            // This is not used by objects.
+            // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
             continue;
           }
 
-          macro_fss_write_setting(setting)->object.string[macro_fss_write_setting(setting)->object.used++] = macro_fss_write_setting(setting)->block.string[range.start];
+          setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
         } // for
 
-        if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
+        if (F_status_is_error(setting->status)) break;
 
-        // If the start of content was not found, then fetch the next block.
+        // If the start of Content was not found, then fetch the next block.
         if (state == 0x1) continue;
 
         // If the end of the current block is reached, fetch the next block.
         if (range.start > range.stop) continue;
       }
 
+      // Begin Content.
       if (state == 0x2) {
+
+        // Check to see if the Content supports multiple Content per Object.
+        if (flag & 0x4) {
+          if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+            setting->status = F_status_set_error(F_support_not);
+
+            fss_write_print_error_one_content_only(setting, main->error);
+
+            break;
+          }
+
+          setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+
+            break;
+          }
+        }
+
         if (range.start <= range.stop) {
           total = (range.stop - range.start) + 1;
         }
@@ -158,113 +188,120 @@ extern "C" {
         }
 
         // When payload is provided, all data at this point is part of the payload until the end of the pipe.
-        if (fl_string_dynamic_compare(f_fss_string_payload_s, macro_fss_write_setting(setting)->object) == F_equal_to) {
+        if (fl_string_dynamic_compare(f_fss_string_payload_s, setting->objects.array[used_objects]) == F_equal_to) {
           if (total > 1) {
-            macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(total, &macro_fss_write_setting(setting)->content);
+            setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
 
-            if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
-              fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
+            if (F_status_is_error(setting->status)) {
+              fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
               break;
             }
 
-            memcpy(macro_fss_write_setting(setting)->content.string, macro_fss_write_setting(setting)->block.string + range.start, sizeof(f_char_t) * total);
+            memcpy(setting->contentss.array[used_contentss].array[0].string, setting->block.string + range.start, sizeof(f_char_t) * total);
 
-            macro_fss_write_setting(setting)->content.used += total;
+            setting->contentss.array[used_contentss].array[0].used += total;
           }
 
           state = 0x4;
-          printed |= 0x2;
+          flag |= 0x8;
 
           // Designate to read next block from pipe.
-          range.start = 1; // fss_write_payload_process_set ??
+          range.start = 1;
           range.stop = 0;
 
           continue;
         }
 
         if (total) {
-          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(total, &macro_fss_write_setting(setting)->content);
+          setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
 
-          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
-            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
 
           for (; range.start <= range.stop; ++range.start) {
 
-            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
-              macro_fss_write_setting(setting)->status = F_status_set_error(F_supported_not);
+            if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+              setting->status = F_status_set_error(F_support_not);
 
-              if (main->error.verbosity > f_console_verbosity_quiet_e) {
-                fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
-                fss_write_print_error_one_content_only(macro_fss_write_setting(setting), main->error, fss_write_payload_standard_s);
-                fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
-              }
+              fss_write_print_error_one_content_only(setting, main->error);
 
               break;
             }
 
-            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+            if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
               state = 0x3;
               ++range.start;
 
               break;
             }
 
-            if (macro_fss_write_setting(setting)->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
+            if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
 
-              // This is not used by this program.
+              // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit).
               continue;
             }
 
-            macro_fss_write_setting(setting)->content.string[macro_fss_write_setting(setting)->content.used++] = macro_fss_write_setting(setting)->block.string[range.start];
+            setting->contentss.array[used_contentss].array[0].string[setting->contentss.array[used_contentss].array[0].used++] = setting->block.string[range.start];
           } // for
 
-          if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
+          if (F_status_is_error(setting->status)) break;
+
+          ++setting->contentss.array[used_contentss].used;
+          flag |= 0x4;
         }
         else {
           state = 0x3;
         }
       }
 
+      // End Object or Content set.
       if (state == 0x3) {
-        if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-          if (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) {
-            fss_write_payload_process_set(main, macro_fss_write_setting(setting), 0, &macro_fss_write_setting(setting)->content);
+        if (setting->flag & fss_write_flag_partial_e) {
+          if (setting->flag & fss_write_flag_content_e) {
+            setting->object = 0;
+            setting->contents = &setting->contentss.array[used_contentss];
           }
           else {
-            fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, 0);
+            setting->object = &setting->objects.array[used_objects];
+            setting->contents = 0;
           }
         }
         else {
-          fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, &macro_fss_write_setting(setting)->content);
+          setting->object = &setting->objects.array[used_objects];
+          setting->contents = &setting->contentss.array[used_contentss];
         }
 
-        if (F_status_is_error(macro_fss_write_setting(setting)->status)) break;
+        setting->ignores = &setting->ignoress.array[used_ignoress];
+
+        fss_write_payload_process_set(main, void_setting);
+        if (F_status_is_error(setting->status)) break;
 
         state = 0;
-        printed |= 0x1;
+        flag |= 0x1;
 
         continue;
       }
 
+      // Payload Object.
       if (state == 0x4) {
-        if (macro_fss_write_setting(setting)->block.used && range.start <= range.stop) {
+        if (setting->block.used && range.start <= range.stop) {
           length = (range.stop - range.start) + 1;
 
-          macro_fss_write_setting(setting)->status = f_string_dynamic_increase_by(length + 1, &macro_fss_write_setting(setting)->content);
+          setting->status = f_string_dynamic_increase_by(length + 1, &setting->contentss.array[used_contentss].array[0]);
 
-          if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
-            fss_write_print_error(macro_fss_write_setting(setting), main->error, "f_string_dynamic_increase_by");
+          if (F_status_is_error(setting->status)) {
+            fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
 
             break;
           }
 
-          memcpy(macro_fss_write_setting(setting)->content.string + range.start, macro_fss_write_setting(setting)->block.string, sizeof(f_char_t) * length);
+          memcpy(setting->contentss.array[used_contentss].array[0].string + range.start, setting->block.string, sizeof(f_char_t) * length);
 
-          macro_fss_write_setting(setting)->content.used += length;
+          setting->contentss.array[used_contentss].array[0].used += length;
         }
 
         // Designate to read next block from pipe.
@@ -274,72 +311,84 @@ extern "C" {
     } // for
 
     // If the pipe ended before finishing, then attempt to wrap up.
-    if (F_status_is_error_not(macro_fss_write_setting(setting)->status) && status_pipe == F_none_eof && state) {
-      if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
-        if (macro_fss_write_setting(setting)->flag & fss_write_flag_content_e) {
-          fss_write_payload_process_set(main, macro_fss_write_setting(setting), 0, &macro_fss_write_setting(setting)->content);
+    if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
+      if (setting->flag & fss_write_flag_partial_e) {
+        if (setting->flag & fss_write_flag_content_e) {
+          setting->object = 0;
+          setting->contents = &setting->contentss.array[used_contentss];
         }
         else {
-          fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, 0);
+          setting->object = &setting->objects.array[used_objects];
+          setting->contents = 0;
         }
       }
       else {
-        fss_write_payload_process_set(main, macro_fss_write_setting(setting), &macro_fss_write_setting(setting)->object, &macro_fss_write_setting(setting)->content);
+        setting->object = &setting->objects.array[used_objects];
+        setting->contents = &setting->contentss.array[used_contentss];
       }
 
-      printed |= 0x1;
-    }
+      setting->ignores = &setting->ignoress.array[used_ignoress];
+
+      fss_write_payload_process_set(main, void_setting);
 
-    macro_fss_write_setting(setting)->block.used = 0;
-    macro_fss_write_setting(setting)->object.used = 0;
-    macro_fss_write_setting(setting)->content.used = 0;
-    macro_fss_write_setting(setting)->buffer.used = 0;
+      flag |= 0x1;
+    }
 
-    if (F_status_is_error_not(macro_fss_write_setting(setting)->status)) {
-      if (printed & 0x1) {
-        if (printed & 0x2) {
-          macro_fss_write_setting(setting)->status = F_payload;
+    setting->block.used = 0;
+    setting->buffer.used = 0;
+    setting->objects.used = used_objects;
+    setting->contentss.used = used_contentss;
+    setting->ignoress.used = used_ignoress;
+
+    if (F_status_is_error_not(setting->status)) {
+      if (flag & 0x1) {
+        if (flag & 0x8) {
+          setting->status = F_payload;
         }
         else {
-          macro_fss_write_setting(setting)->status = F_none;
+          setting->status = F_none;
         }
       }
       else {
-        macro_fss_write_setting(setting)->status = F_data_not;
+        setting->status = F_data_not;
       }
 
       // Print newline character to separate data printed from pipe.
-      if ((macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) && macro_fss_write_setting(setting)->objects.used) {
-        fll_print_dynamic(f_string_eol_s, main->output.to);
+      if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
+        fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
       }
-      else if (macro_fss_write_setting(setting)->contents.used) {
-        fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
+      else if (setting->contentss.used) {
+        if (flag & 0x8) {
+          fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
+        }
       }
     }
   }
 #endif // _di_fss_write_payload_process_pipe_
 
 #ifndef _di_fss_write_payload_process_set_
-  void fss_write_payload_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t *object, const f_string_static_t *content) {
+  void fss_write_payload_process_set(fll_program_data_t * const main, void * const void_setting) {
+
+    fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
-    if (object) {
-      if (content) {
-        if (object->used) {
+    if (setting->object) {
+      if (setting->contents && setting->contents->used) {
+        if (setting->object->used) {
           setting->range.start = 0;
-          setting->range.stop = object->used - 1;
+          setting->range.stop = setting->object->used - 1;
         }
         else {
           setting->range.start = 1;
           setting->range.stop = 0;
         }
 
-        setting->status = fll_fss_payload_write(*object, *content, setting->flag & fss_write_flag_trim_e, setting->flag & fss_write_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
+        setting->status = fll_fss_payload_write(*setting->object, setting->contents->array[0], setting->flag & fss_write_flag_trim_e, setting->flag & fss_write_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
 
         if (F_status_set_fine(setting->status) == F_none_eol) {
-          setting->status = F_status_set_error(F_supported_not);
+          setting->status = F_status_set_error(F_support_not);
 
           fss_write_print_line_first_locked(setting, main->error);
-          fss_write_print_error_unsupported_eol(setting, main->error, fss_write_payload_standard_s);
+          fss_write_print_error_unsupported_eol(setting, main->error);
           fss_write_print_line_last_locked(setting, main->error);
 
           return;
@@ -354,16 +403,16 @@ extern "C" {
       else {
         bool complete = f_fss_complete_none_e;
 
-        if (object->used) {
+        if (setting->object->used) {
           setting->range.start = 0;
-          setting->range.stop = object->used - 1;
+          setting->range.stop = setting->object->used - 1;
         }
         else {
           setting->range.start = 1;
           setting->range.stop = 0;
         }
 
-        if (content) {
+        if (setting->contents && setting->contents->used) {
           if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
             complete = f_fss_complete_full_trim_e;
           }
@@ -372,13 +421,13 @@ extern "C" {
           }
         }
 
-        setting->status = fl_fss_basic_list_object_write(*object, complete, setting->state, &setting->range, &setting->buffer);
+        setting->status = fl_fss_basic_list_object_write(*setting->object, complete, setting->state, &setting->range, &setting->buffer);
 
         if (F_status_set_fine(setting->status) == F_none_eol) {
-          setting->status = F_status_set_error(F_supported_not);
+          setting->status = F_status_set_error(F_support_not);
 
           fss_write_print_line_first_locked(setting, main->error);
-          fss_write_print_error_unsupported_eol(setting, main->error, fss_write_payload_standard_s);
+          fss_write_print_error_unsupported_eol(setting, main->error);
           fss_write_print_line_last_locked(setting, main->error);
 
           return;
@@ -391,9 +440,9 @@ extern "C" {
         }
       }
     }
-    else if (content && content->used) {
+    else if (setting->contents && setting->contents->used && setting->contents->array[0].used) {
       setting->range.start = 0;
-      setting->range.stop = content->used - 1;
+      setting->range.stop = setting->contents->array[0].used - 1;
 
       const f_string_static_t *prepend = 0;
 
@@ -403,7 +452,7 @@ extern "C" {
         prepend = &main->parameters.arguments.array[index];
       }
 
-      setting->status = fl_fss_basic_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, setting->state, &setting->range, &setting->buffer);
+      setting->status = fl_fss_basic_list_content_write(setting->contents->array[0], setting->object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, setting->state, &setting->range, &setting->buffer);
 
       if (F_status_is_error(setting->status)) {
         fss_write_print_error(setting, main->error, "fl_fss_payload_content_write");
@@ -412,7 +461,7 @@ extern "C" {
       }
     }
 
-    if (!object || !content) {
+    if (!setting->object || !(setting->contents && setting->contents->used)) {
       setting->status = f_string_dynamic_append(f_string_eol_s, &setting->buffer);
 
       if (F_status_is_error(setting->status)) {
index eb342b05d6c0cf77f73784926004f91dceb32b3c..12da9c622873d176ccbfaed9e72dcc600dbc4bc8 100644 (file)
@@ -73,25 +73,6 @@ extern "C" {
 #endif // _di_fss_write_payload_process_help_
 
 /**
- * Process normally, writing to the output.
- *
- * @param main
- *   The main program data.
- * @param setting
- *   The main program settings.
- *   Must be of type (fss_write_setting_t *).
- *
- *   This alters setting.status:
- *     F_none on success.
- *     F_interrupt on (exit) signal received.
- *
- *     F_parameter (with error bit) if main is NULL or setting is NULL.
- */
-#ifndef _di_fss_write_payload_process_normal_
-  extern void fss_write_payload_process_normal(fll_program_data_t * const main, void * const setting);
-#endif // _di_fss_write_payload_process_normal_
-
-/**
  * Process the pipe, reading from the pipe and writing to the output.
  *
  * @param main
@@ -119,21 +100,22 @@ extern "C" {
  *   The main program data.
  * @param setting
  *   The main program settings.
+ *   Must be of type (fss_write_setting_t *).
+ *
+ *   Set setting.object to 0 to not use an Object.
+ *   Set setting.contents to 0 to not use an Content set.
+ *
+ *   This standard only supports a single Content per Object.
+ *   The setting.contents.array[0] must exist (settings.contents.used == 1), or it is treated as if (settings.contents == 0).
  *
  *   This alters setting.status:
  *     F_none on success.
  *     F_interrupt on (exit) signal received.
  *
  *     F_parameter (with error bit) if main is NULL or setting is NULL.
- * @param object
- *   The object to validate and print.
- *   Set pointer address to 0 to not use.
- * @param content
- *   The content to escape and print.
- *   Set pointer address to 0 to not use.
  */
 #ifndef _di_fss_write_payload_process_set_
-  extern void fss_write_payload_process_set(fll_program_data_t * const main, fss_write_setting_t * const setting, const f_string_static_t *object, const f_string_static_t *content);
+  extern void fss_write_payload_process_set(fll_program_data_t * const main, void * const setting);
 #endif // _di_fss_write_payload_process_set_
 
 /**
index eae873bd7e2dc3eb1285363d4aadf37637abd441..7f9344fc1b7762af2ecc31addeb27b89c7551d74 100644 (file)
@@ -8,11 +8,12 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   setting.state.data = (void *) &data;
   setting.program_name = &fss_write_payload_program_name_s;
   setting.program_name_long = &fss_write_payload_program_name_long_s;
+  setting.process_content = 0; // Not used by payload.
   setting.process_help = &fss_write_payload_process_help;
-  setting.process_pipe = &fss_write_payload_process_pipe;
-  setting.process_normal = &fss_write_payload_process_normal;
+  setting.process_normal = &fss_write_process_normal;
   setting.process_object = 0; // Not used by payload.
-  setting.process_content = 0; // Not used by payload.
+  setting.process_pipe = &fss_write_payload_process_pipe;
+  setting.process_set = &fss_write_payload_process_set;
 
   f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
   data.parameters.array = parameters;