build_libraries-level_threadless -lfll_1 -lfll_0
build_libraries_shared
build_libraries_static
-build_sources_library control_group.c error.c error-common.c private-error.c execute.c private-execute.c file.c private-file.c fss.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c fss_payload.c fss_status_string.c iki.c private-iki.c path.c print.c program.c status_string.c
+build_sources_library control_group.c error.c error-common.c private-error.c execute.c private-execute.c file.c private-file.c fss.c private-fss.c fss_basic.c fss_basic_list.c fss_embedded_list.c fss_extended.c fss_extended_list.c fss_payload.c fss_status_string.c iki.c private-iki.c path.c print.c program.c program-common.c status_string.c
build_sources_library-level
build_sources_library_shared
build_sources_library_static
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers control_group.h error.h error-common.h execute.h file.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_payload.h fss_status_string.h iki.h path.h print.h program.h status_string.h
+build_sources_headers control_group.h error.h error-common.h execute.h file.h fss.h fss_basic.h fss_basic_list.h fss_embedded_list.h fss_extended.h fss_extended_list.h fss_payload.h fss_status_string.h iki.h path.h print.h program.h program-common.h status_string.h
build_sources_headers-level
build_sources_headers_shared
build_sources_headers_static
build_libraries-monolithic_threadless
build_libraries_shared
build_libraries_static
-build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print_to.c level_0/print-common.c level_0/private-print.c level_0/private-print_to.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/status_string.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_string.c level_0/utf_triple.c level_0/private-utf.c level_0/private-utf-is_unassigned.c level_0/private-utf_string.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/directory-common.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/print-common.c level_1/private-print.c level_1/signal.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_payload.c level_2/fss_status_string.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/status_string.c
+build_sources_library level_0/account.c level_0/private-account.c level_0/capability.c level_0/color.c level_0/color-common.c level_0/console.c level_0/console-common.c level_0/control_group.c level_0/control_group-common.c level_0/conversion.c level_0/conversion-common.c level_0/private-conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/execute.c level_0/file.c level_0/file-common.c level_0/private-file.c level_0/fss.c level_0/private-fss.c level_0/fss-common.c level_0/fss_named.c level_0/fss_nest.c level_0/fss_set.c level_0/iki.c level_0/iki-common.c level_0/private-iki.c level_0/limit.c level_0/memory.c level_0/memory_structure.c level_0/private-memory.c level_0/path.c level_0/path-common.c level_0/private-path.c level_0/pipe.c level_0/print.c level_0/print_to.c level_0/print-common.c level_0/private-print.c level_0/private-print_to.c level_0/serialize.c level_0/serialize-common.c level_0/private-serialize.c level_0/signal.c level_0/socket.c level_0/status_string.c level_0/string.c level_0/string-common.c level_0/private-string.c level_0/string_dynamic.c level_0/string_map.c level_0/string_quantity.c level_0/string_range.c level_0/string_triple.c level_0/type_array.c level_0/private-type_array.c level_0/utf.c level_0/utf-common.c level_0/utf_dynamic.c level_0/utf_map.c level_0/utf_string.c level_0/utf_triple.c level_0/private-utf.c level_0/private-utf-is_unassigned.c level_0/private-utf_string.c level_1/console.c level_1/control_group.c level_1/conversion.c level_1/private-conversion.c level_1/directory.c level_1/directory-common.c level_1/private-directory.c level_1/environment.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_embedded_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/iki.c level_1/print.c level_1/print-common.c level_1/private-print.c level_1/signal.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/control_group.c level_2/error.c level_2/error-common.c level_2/private-error.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/private-file.c level_2/fss.c level_2/private-fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_embedded_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_payload.c level_2/fss_status_string.c level_2/iki.c level_2/private-iki.c level_2/path.c level_2/print.c level_2/program.c level_2/program-common.c level_2/status_string.c
build_sources_library-monolithic level_0/thread.c level_0/private-thread.c
build_sources_library_shared
build_sources_library_static
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print_to.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_string.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_string.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/directory-common.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/iki.h level_1/print.h level_1/print-common.h level_1/signal.h level_1/signal-common.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_payload.h level_2/fss_status_string.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/status_string.h
+build_sources_headers level_0/account.h level_0/account-common.h level_0/capability.h level_0/capability-common.h level_0/color.h level_0/color-common.h level_0/console.h level_0/console-common.h level_0/control_group.h level_0/control_group-common.h level_0/conversion.h level_0/conversion-common.h level_0/directory.h level_0/directory_type.h level_0/directory-common.h level_0/environment.h level_0/environment-common.h level_0/execute.h level_0/execute-common.h level_0/file.h level_0/file-common.h level_0/fss.h level_0/fss-common.h level_0/fss_comment.h level_0/fss_delimit.h level_0/fss_named.h level_0/fss_nest.h level_0/fss_quote.h level_0/fss_set.h level_0/iki.h level_0/iki-common.h level_0/limit.h level_0/limit-common.h level_0/memory.h level_0/memory_structure.h level_0/memory-common.h level_0/path.h level_0/path-common.h level_0/pipe.h level_0/print.h level_0/print_to.h level_0/print-common.h level_0/serialize.h level_0/serialize-common.h level_0/signal.h level_0/signal-common.h level_0/socket.h level_0/socket-common.h level_0/status.h level_0/status_string.h level_0/string.h level_0/string-common.h level_0/string_dynamic.h level_0/string_map.h level_0/string_quantity.h level_0/string_range.h level_0/string_triple.h level_0/type.h level_0/type_array.h level_0/type_array-common.h level_0/utf.h level_0/utf-common.h level_0/utf_dynamic.h level_0/utf_map.h level_0/utf_string.h level_0/utf_triple.h level_1/console.h level_1/control_group.h level_1/conversion.h level_1/directory.h level_1/directory-common.h level_1/environment.h level_1/execute.h level_1/execute-common.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_embedded_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/iki.h level_1/print.h level_1/print-common.h level_1/signal.h level_1/signal-common.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/control_group.h level_2/error.h level_2/error-common.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_embedded_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_payload.h level_2/fss_status_string.h level_2/iki.h level_2/path.h level_2/print.h level_2/program.h level_2/program-common.h level_2/status_string.h
build_sources_headers-monolithic level_0/thread.h level_0/thread-common.h
build_sources_headers_shared
build_sources_headers_static
const f_color_set_t f_color_set_empty_s = macro_f_color_set_t_initialize(&f_string_empty_s, &f_string_empty_s);
#endif // _di_f_color_set_string_empty_s_
+#ifndef _di_f_color_context_delete_
+ f_status_t f_color_context_delete(f_color_context_t * const context) {
+ #ifndef _di_level_0_parameters_checking_
+ if (!context) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameters_checking_
+
+ f_status_t status = F_none;
+
+ status = f_string_dynamic_resize(0, &context->reset);
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->warning);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->error);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->title);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->notable);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->important);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->standout);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->success);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->normal);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_resize(0, &context->normal_reset);
+ }
+
+ if (F_status_is_error(status)) return status;
+
+ macro_f_color_context_t_clear((*context))
+
+ return F_none;
+ }
+#endif // _di_f_color_context_delete_
+
+#ifndef _di_f_color_context_destroy_
+ f_status_t f_color_context_destroy(f_color_context_t * const context) {
+ #ifndef _di_level_0_parameters_checking_
+ if (!context) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameters_checking_
+
+ f_status_t status = F_none;
+
+ status = f_string_dynamic_adjust(0, &context->reset);
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->warning);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->error);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->title);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->notable);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->important);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->standout);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->success);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->normal);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_adjust(0, &context->normal_reset);
+ }
+
+ if (F_status_is_error(status)) return status;
+
+ macro_f_color_context_t_clear((*context))
+
+ return F_none;
+ }
+#endif // _di_f_color_context_destroy_
+
#ifdef __cplusplus
} // extern "C"
#endif
macro_f_color_context_t_clear(context)
#endif // _di_f_color__context_t_
+/**
+ * Delete any dynamic allocated data on the color context object.
+ *
+ * @param context
+ * The context object.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_string_dynamic_resize().
+ *
+ * @see f_string_dynamic_resize()
+ */
+#ifndef _di_f_color_context_delete_
+ extern f_status_t f_color_context_delete(f_color_context_t * const context);
+#endif // _di_f_color_context_delete_
+
+/**
+ * Destroy any dynamic allocated data on the color context object.
+ *
+ * @param context
+ * The context object.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_string_dynamic_adjust().
+ *
+ * @see f_string_dynamic_adjust()
+ */
+#ifndef _di_f_color_context_destroy_
+ extern f_status_t f_color_context_destroy(f_color_context_t * const context);
+#endif // _di_f_color_context_destroy_
+
#ifdef __cplusplus
} // extern "C"
#endif
// Switch to the appropriate terminal color mode.
{
- char *environment = getenv("TERM");
+ char *environment = getenv("TERM"); // @todo make these strings static!
if (!environment || strncmp(environment, "linux", 6) == 0) {
macro_f_color_t_set_linux(context->list);
build_libraries-individual -lf_memory -lf_string -lf_color
build_libraries-level -lfll_0
build_libraries-monolithic -lfll
-build_sources_program test-color-load_context.c test-color-save_1.c test-color-save_2.c test-color-save_3.c test-color-save_4.c test-color-save_5.c test-color.c
+build_sources_program test-color-context_delete.c test-color-context_destroy.c test-color-load_context.c test-color-save_1.c test-color-save_2.c test-color-save_3.c test-color-save_4.c test-color-save_5.c test-color.c
build_script no
build_shared yes
build_static no
--- /dev/null
+#include "test-color.h"
+#include "test-color-context_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_color_context_delete__frees_memory(void **state) {
+
+ const f_array_length_t size = 3;
+
+ f_color_context_t context = f_color_context_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.reset);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.reset.size, 0);
+ assert_non_null(context.reset.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.warning);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.warning.size, 0);
+ assert_non_null(context.warning.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.error);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.error.size, 0);
+ assert_non_null(context.error.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.title);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.title.size, 0);
+ assert_non_null(context.title.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.notable);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.notable.size, 0);
+ assert_non_null(context.notable.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.important);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.important.size, 0);
+ assert_non_null(context.important.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.standout);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.standout.size, 0);
+ assert_non_null(context.standout.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.success);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.success.size, 0);
+ assert_non_null(context.success.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.normal);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.normal.size, 0);
+ assert_non_null(context.normal.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.normal_reset);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.normal_reset.size, 0);
+ assert_non_null(context.normal_reset.string);
+ }
+
+ {
+ const f_status_t status = f_color_context_delete(&context);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(context.reset.size, 0);
+ assert_int_equal(context.warning.size, 0);
+ assert_int_equal(context.error.size, 0);
+ assert_int_equal(context.title.size, 0);
+ assert_int_equal(context.notable.size, 0);
+ assert_int_equal(context.important.size, 0);
+ assert_int_equal(context.standout.size, 0);
+ assert_int_equal(context.success.size, 0);
+ assert_int_equal(context.normal.size, 0);
+ assert_int_equal(context.normal_reset.size, 0);
+ }
+}
+
+#ifndef _di_level_0_parameter_checking_
+ void test__f_color_context_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_color_context_delete(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Color
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the color project.
+ */
+#ifndef _TEST__F_color__delete
+#define _TEST__F_color__delete
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_color_context_delete()
+ */
+extern void test__f_color_context_delete__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_color_context_delete()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_color_context_delete__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_color__delete
--- /dev/null
+#include "test-color.h"
+#include "test-color-context_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_color_context_destroy__frees_memory(void **state) {
+
+ const f_array_length_t size = 3;
+
+ f_color_context_t context = f_color_context_t_initialize;
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.reset);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.reset.size, 0);
+ assert_non_null(context.reset.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.warning);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.warning.size, 0);
+ assert_non_null(context.warning.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.error);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.error.size, 0);
+ assert_non_null(context.error.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.title);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.title.size, 0);
+ assert_non_null(context.title.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.notable);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.notable.size, 0);
+ assert_non_null(context.notable.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.important);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.important.size, 0);
+ assert_non_null(context.important.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.standout);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.standout.size, 0);
+ assert_non_null(context.standout.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.success);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.success.size, 0);
+ assert_non_null(context.success.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.normal);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.normal.size, 0);
+ assert_non_null(context.normal.string);
+ }
+
+ {
+ const f_status_t status = f_string_dynamic_resize(size, &context.normal_reset);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(context.normal_reset.size, 0);
+ assert_non_null(context.normal_reset.string);
+ }
+
+ {
+ const f_status_t status = f_color_context_destroy(&context);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(context.reset.size, 0);
+ assert_int_equal(context.warning.size, 0);
+ assert_int_equal(context.error.size, 0);
+ assert_int_equal(context.title.size, 0);
+ assert_int_equal(context.notable.size, 0);
+ assert_int_equal(context.important.size, 0);
+ assert_int_equal(context.standout.size, 0);
+ assert_int_equal(context.success.size, 0);
+ assert_int_equal(context.normal.size, 0);
+ assert_int_equal(context.normal_reset.size, 0);
+ }
+}
+
+#ifndef _di_level_0_parameter_checking_
+ void test__f_color_context_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_color_context_destroy(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Color
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the color project.
+ */
+#ifndef _TEST__F_color__destroy
+#define _TEST__F_color__destroy
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_color_context_destroy()
+ */
+extern void test__f_color_context_destroy__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_color_context_destroy()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_color_context_destroy__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_color__destroy
// f_color_save_5() only returns failures by other functions that have their own tests.
cmocka_unit_test(test__f_color_save_5_works),
+ cmocka_unit_test(test__f_color_context_delete__frees_memory),
+
+ cmocka_unit_test(test__f_color_context_destroy__frees_memory),
+
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_color_load_context__parameter_checking),
cmocka_unit_test(test__f_color_save_1_parameter_checking),
cmocka_unit_test(test__f_color_save_3_parameter_checking),
cmocka_unit_test(test__f_color_save_4_parameter_checking),
cmocka_unit_test(test__f_color_save_5_parameter_checking),
+ cmocka_unit_test(test__f_color_context_delete__parameter_checking),
+ cmocka_unit_test(test__f_color_context_destroy__parameter_checking),
#endif // _di_level_0_parameter_checking_
};
#include "test-color-save_3.h"
#include "test-color-save_4.h"
#include "test-color-save_5.h"
+#include "test-color-context_delete.h"
+#include "test-color-context_destroy.h"
#ifdef __cplusplus
extern "C" {
if (F_status_is_error(status)) return status;
} // for
- return f_string_dynamics_resize(0, ¶meters->arguments);
+ status = f_string_dynamics_resize(0, ¶meters->arguments);
+ if (F_status_is_error(status)) return status;
+
+ status = f_type_array_lengths_resize(0, ¶meters->remaining);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
}
#endif // _di_f_console_parameters_delete_
if (F_status_is_error(status)) return status;
} // for
- return f_string_dynamics_adjust(0, ¶meters->arguments);
+ status = f_string_dynamics_adjust(0, ¶meters->arguments);
+ if (F_status_is_error(status)) return status;
+
+ status = f_type_array_lengths_adjust(0, ¶meters->remaining);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
}
#endif // _di_f_console_parameters_destroy_
*
* array: Intended to be populated with an array of f_console_parameter_t whose size is defined by the "used" property.
* arguments: An array of arguments pointing to the argv[] strings with the string lengths already calculated (This is a dynamic array of f_string_static_t).
+ * remaining: An array of indexes within the arguments representing unmatched parameters.
* length: The total number of parameters in the parameters array.
*/
#ifndef _di_f_console_parameters_t_
f_console_parameter_t *array;
f_string_dynamics_t arguments;
+ f_array_lengths_t remaining;
f_array_length_t used;
} f_console_parameters_t;
- #define f_console_parameters_t_initialize {0, f_string_dynamics_t_initialize, 0 }
+ #define f_console_parameters_t_initialize {0, f_string_dynamics_t_initialize, f_array_lengths_t_initialize, 0 }
- #define macro_f_console_parameters_t_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, used }
+ #define macro_f_console_parameters_t_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, f_array_lengths_t_initialize, used }
#endif // _di_f_console_parameters_t_
/**
#endif // _di_f_console_parameter_prioritize_right_
#ifndef _di_f_console_parameter_process_
- f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, f_array_lengths_t *remaining) {
+ f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters) {
#ifndef _di_level_0_parameter_checking_
- if (!remaining) return F_status_set_error(F_parameter);
+ if (!parameters) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
f_status_t status = F_none;
if (!found) {
// Populate list of remaining parameters->array that are not associated with anything.
- if (remaining->used == remaining->size) {
- status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, remaining);
- if (F_status_is_error(status)) break;
- }
+ status = f_type_array_lengths_increase(F_memory_default_allocation_small_d, ¶meters->remaining);
+ if (F_status_is_error(status)) break;
- remaining->array[remaining->used++] = location;
+ parameters->remaining.array[parameters->remaining.used++] = location;
}
++location;
* Licenses: lgpl-2.1-or-later
*
* Some console input/output commands.
- *
- * @todo It may be a good idea to provide a standard parameter process process disable sequence.
- * This does not yet exist, so "--help" would always be a parameter, but would if there was something like "-/ --help" where this help does not designate the help option?
*/
#ifndef _F_console_h
#define _F_console_h
* The parameters passed to the process.
* @param parameters
* The console parameters to look for.
- * @param remaining
- * A list of remaining parameters not associated with anything.
*
* @return
* F_none on success.
* @see f_string_dynamics_increase_by()
*/
#ifndef _di_f_console_parameter_process_
- extern f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, f_array_lengths_t *remaining);
+ extern f_status_t f_console_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters);
#endif // _di_f_console_parameter_process_
#ifdef __cplusplus
};
f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(parameter, 9);
- f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters);
assert_int_equal(status, F_none);
assert_int_equal(parameter[8].location, 0);
assert_int_equal(parameter[8].location_sub, 0);
- assert_int_equal(remaining.used, 0);
+ assert_int_equal(parameters.remaining.used, 0);
}
- f_type_array_lengths_resize(0, &remaining);
+ f_console_parameters_delete(¶meters);
}
void test__f_console_parameter_process__only_remaining(void **state) {
};
f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(parameter, 9);
- f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters);
assert_int_equal(status, F_none);
assert_int_equal(parameter[8].location, 0);
assert_int_equal(parameter[8].location_sub, 0);
- assert_int_equal(remaining.used, 6);
+ assert_int_equal(parameters.remaining.used, 6);
}
- f_type_array_lengths_resize(0, &remaining);
+ f_console_parameters_delete(¶meters);
}
#ifndef _di_level_0_parameter_checking_
void test__f_console_parameter_process__parameter_checking(void **state) {
const f_console_arguments_t arguments = f_console_arguments_t_initialize;
- f_console_parameters_t parameters = f_console_parameters_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, ¶meters, 0);
+ const f_status_t status = f_console_parameter_process(arguments, 0);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
};
f_console_parameters_t parameters = macro_f_console_parameters_t_initialize(parameter, 9);
- f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters);
assert_int_equal(status, F_none);
assert_int_equal(parameter[8].locations.array[0], 6);
assert_int_equal(parameter[8].locations.array[1], 15);
- assert_int_equal(remaining.used, 2);
- assert_string_equal(argv[remaining.array[0]], "free");
- assert_string_equal(argv[remaining.array[1]], "-4");
+ assert_int_equal(parameters.remaining.used, 2);
+ assert_string_equal(argv[parameters.remaining.array[0]], "free");
+ assert_string_equal(argv[parameters.remaining.array[1]], "-4");
}
- f_type_array_lengths_resize(0, &remaining);
+ f_console_parameters_delete(¶meters);
}
#ifdef __cplusplus
--- /dev/null
+#include "program.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fll_program_parameters_
+ const f_string_static_t fll_program_parameter_filename_s = macro_f_string_static_t_initialize(FLL_program_parameter_filename_s, 0, FLL_program_parameter_filename_s_length);
+ const f_string_static_t fll_program_parameter_filenames_s = macro_f_string_static_t_initialize(FLL_program_parameter_filenames_s, 0, FLL_program_parameter_filenames_s_length);
+#endif // _di_fll_program_parameters_
+
+#ifndef _di_fll_program_data_delete_
+ f_status_t fll_program_data_delete(fll_program_data_t * const data) {
+ #ifndef _di_level_2_parameters_checking_
+ if (!data) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameters_checking_
+
+ f_status_t status = F_none;
+
+ status = f_console_parameters_delete(&data->parameters);
+ if (F_status_is_error(status)) return status;
+
+ status = f_color_context_delete(&data->context);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fll_program_data_delete_
+
+#ifndef _di_fll_program_data_destroy_
+ f_status_t fll_program_data_destroy(fll_program_data_t * const data) {
+ #ifndef _di_level_2_parameters_checking_
+ if (!data) return F_status_set_error(F_parameter);
+ #endif // _di_level_2_parameters_checking_
+
+ f_status_t status = F_none;
+
+ status = f_console_parameters_destroy(&data->parameters);
+ if (F_status_is_error(status)) return status;
+
+ status = f_color_context_destroy(&data->context);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fll_program_data_destroy_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: Program
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Defines common data to be used for/by project program.
+ *
+ * This is auto-included by program.h and should not need to be explicitly included.
+ */
+#ifndef _FLL_program_common_h
+#define _FLL_program_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fll_program_parameters_
+ #define FLL_program_parameter_filename_s "filename"
+ #define FLL_program_parameter_filenames_s "filename(s)"
+
+ #define FLL_program_parameter_filename_s_length 8
+ #define FLL_program_parameter_filenames_s_length 11
+
+ extern const f_string_static_t fll_program_parameter_filename_s;
+ extern const f_string_static_t fll_program_parameter_filenames_s;
+#endif // _di_fll_program_parameters_
+
+/**
+ * A common program structure to be used by simple programs needing no special structure.
+ *
+ * Complex programs or programs that need more data passed via the main should implement their own version of this.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * signal_check: A counter used to map to for reducing the amount of actual signal check calls.
+ * context: The color context.
+ */
+#ifndef _di_fll_program_data_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ uint16_t signal_check;
+ bool process_pipe;
+
+ fl_print_t output;
+ fl_print_t error;
+ fl_print_t warning;
+
+ f_signal_t signal;
+
+ f_color_context_t context;
+ } fll_program_data_t;
+
+ #define fll_program_data_t_initialize \
+ { \
+ f_console_parameters_t_initialize, \
+ 0, \
+ F_false, \
+ fl_print_t_initialize, \
+ macro_fl_print_t_initialize_error(), \
+ macro_fl_print_t_initialize_warning(), \
+ f_signal_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fll_program_data_t_
+
+/**
+ * Delete any dynamic allocated data on the program data object.
+ *
+ * @param data
+ * The program data object.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_console_parameters_delete().
+ *
+ * @see f_console_parameters_delete()
+ */
+#ifndef _di_fll_program_data_delete_
+ extern f_status_t fll_program_data_delete(fll_program_data_t * const data);
+#endif // _di_fll_program_data_delete_
+
+/**
+ * Destroy any dynamic allocated data on the program data object.
+ *
+ * @param data
+ * The program data object.
+ *
+ * @return
+ * F_none on success.
+ *
+ * F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_console_parameters_destroy().
+ *
+ * @see f_console_parameters_destroy()
+ */
+#ifndef _di_fll_program_data_destroy_
+ extern f_status_t fll_program_data_destroy(fll_program_data_t * const data);
+#endif // _di_fll_program_data_destroy_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _FLL_program_common_h
#endif // _di_fll_program_print_version_
#ifndef _di_fll_program_parameter_process_
- f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context) {
+ f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_color_context_t *context) {
f_status_t status = F_none;
- status = f_console_parameter_process(arguments, parameters, remaining);
+ status = f_console_parameter_process(arguments, parameters);
if (F_status_is_error(status)) return status;
f_console_parameter_id_t decision = choices.id[2];
#include <fll/level_1/string.h>
#include <fll/level_1/print.h>
+// fll-2 program includes
+#include <fll/level_2/program-common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
* This must have its used size set to 3 and the ids are expected to be in this order: no_color, light, and dark.
* @param right
* Set to TRUE for right priortization and FALSE for left prioritization.
- * @param remaining
- * A list of remaining parameters not associated with anything.
* @param context
* The color context.
*
* @see f_color_load_context()
*/
#ifndef _di_fll_program_parameter_process_
- extern f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_array_lengths_t *remaining, f_color_context_t *context);
+ extern f_status_t fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t * const parameters, const f_console_parameter_ids_t choices, const bool right, f_color_context_t *context);
#endif // _di_fll_program_parameter_process_
/**
build_libraries-individual -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_print -lf_signal -lf_string -lf_type_array -lf_utf
build_libraries_shared
build_libraries_static
-build_sources_library program.c
+build_sources_library program.c program-common.c
build_sources_library_shared
build_sources_library_static
build_sources_program
build_sources_program_shared
build_sources_program_static
-build_sources_headers program.h
+build_sources_headers program.h program-common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
fll_program_print_help_option_long(file, context, byte_dump_long_simple_s, f_console_symbol_long_enable_s, " Display spaces for ASCII control codes.");
fll_program_print_help_option_long(file, context, byte_dump_long_classic_s, f_console_symbol_long_enable_s, "Display periods for ASCII control codes.");
- fll_program_print_help_usage(file, context, byte_dump_program_name_s, byte_dump_program_help_parameters_s);
+ fll_program_print_help_usage(file, context, byte_dump_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" When using the %[%r%r%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_text_s, context.set.notable, f_string_eol_s, f_string_eol_s);
f_console_parameter_id_t ids[3] = { byte_dump_parameter_no_color_e, byte_dump_parameter_light_e, byte_dump_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
return F_none;
}
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
if (main->parameters.array[byte_dump_parameter_width_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
}
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
// Pre-process remaining arguments to ensure that they all files exist before processing.
{
f_status_t missing_files = F_none;
- for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) {
+ for (f_array_length_t counter = 0; counter < main->parameters.remaining.used; ++counter) {
- status = f_file_exists(argv[main->remaining.array[counter]]);
+ status = f_file_exists(argv[main->parameters.remaining.array[counter]]);
if (status == F_false) {
status = F_status_set_error(F_file_found_not);
missing_files = status;
}
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, argv[main->remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_exists", F_true, argv[main->parameters.remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e);
}
} // for
f_file_t file = f_file_t_initialize;
- for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) {
+ for (f_array_length_t counter = 0; counter < main->parameters.remaining.used; ++counter) {
- status = f_file_stream_open(argv[main->remaining.array[counter]], f_string_empty_s, &file);
+ status = f_file_stream_open(argv[main->parameters.remaining.array[counter]], f_string_empty_s, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, argv[main->remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, argv[main->parameters.remaining.array[counter]], f_file_operation_open_s, fll_error_file_type_file_e);
byte_dump_main_delete(main);
flockfile(main->output.to.stream);
fl_print_format("%r%[Byte Dump of: %]%[", main->output.to.stream, f_string_eol_s, main->context.set.title, main->context.set.title, main->context.set.notable);
- fl_print_format("%Q%] %[(in ", main->output.to.stream, argv[main->remaining.array[counter]], main->context.set.notable, main->context.set.title);
+ fl_print_format("%Q%] %[(in ", main->output.to.stream, argv[main->parameters.remaining.array[counter]], main->context.set.notable, main->context.set.title);
if (main->mode == byte_dump_mode_hexidecimal_e) {
f_print_dynamic_raw(byte_dump_print_strings_hexidecimal_s, main->output.to.stream);
funlockfile(main->output.to.stream);
- status = byte_dump_file(main, argv[main->remaining.array[counter]], file);
+ status = byte_dump_file(main, argv[main->parameters.remaining.array[counter]], file);
f_file_stream_close(F_true, &file);
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_error_file_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true, argv[main->remaining.array[counter]], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "byte_dump_file", F_true, argv[main->parameters.remaining.array[counter]], f_file_operation_process_s, fll_error_file_type_file_e);
}
}
const f_string_static_t byte_dump_program_name_long_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_name_long_s, 0, BYTE_DUMP_program_name_long_s_length);
#endif // _di_byte_dump_program_name_
-#ifndef _di_byte_dump_program_help_parameters_
- const f_string_static_t byte_dump_program_help_parameters_s = macro_f_string_static_t_initialize(BYTE_DUMP_program_help_parameters_s, 0, BYTE_DUMP_program_help_parameters_s_length);
-#endif // _di_byte_dump_program_help_parameters_
-
#ifndef _di_byte_dump_print_strings_
const f_string_static_t byte_dump_print_strings_hexidecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_print_strings_hexidecimal_s, 0, BYTE_DUMP_print_strings_hexidecimal_s_length);
const f_string_static_t byte_dump_print_strings_duodecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_print_strings_duodecimal_s, 0, BYTE_DUMP_print_strings_duodecimal_s_length);
const f_string_static_t byte_dump_character_placeholder_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_placeholder_s, 0, BYTE_DUMP_character_placeholder_s_length);
const f_string_static_t byte_dump_character_incomplete_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_incomplete_s, 0, BYTE_DUMP_character_incomplete_s_length);
const f_string_static_t byte_dump_character_unused_s = macro_f_string_static_t_initialize(BYTE_DUMP_character_unused_s, 0, BYTE_DUMP_character_unused_s_length);
+#endif // _di_byte_dump_defines_
+#ifndef _di_byte_dump_parameters_
const f_string_static_t byte_dump_short_binary_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_binary_s, 0, BYTE_DUMP_short_binary_s_length);
const f_string_static_t byte_dump_short_decimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_decimal_s, 0, BYTE_DUMP_short_decimal_s_length);
const f_string_static_t byte_dump_short_duodecimal_s = macro_f_string_static_t_initialize(BYTE_DUMP_short_duodecimal_s, 0, BYTE_DUMP_short_duodecimal_s_length);
const f_string_static_t byte_dump_long_normal_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_normal_s, 0, BYTE_DUMP_long_normal_s_length);
const f_string_static_t byte_dump_long_simple_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_simple_s, 0, BYTE_DUMP_long_simple_s_length);
const f_string_static_t byte_dump_long_classic_s = macro_f_string_static_t_initialize(BYTE_DUMP_long_classic_s, 0, BYTE_DUMP_long_classic_s_length);
-#endif // _di_byte_dump_defines_
+#endif // _di_byte_dump_parameters_
#ifndef _di_byte_dump_main_delete_
f_status_t byte_dump_main_delete(byte_dump_main_t * const main) {
f_console_parameters_delete(&main->parameters);
- f_type_array_lengths_resize(0, &main->remaining);
-
macro_f_color_context_t_delete_simple(main->context);
macro_f_color_context_t_clear(main->context)
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_byte_dump_program_version_
#define BYTE_DUMP_program_version_major_s F_string_ascii_0_s
#define BYTE_DUMP_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t byte_dump_program_version_s;
#endif // _di_byte_dump_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_byte_dump_program_name_
#define BYTE_DUMP_program_name_s "byte_dump"
#define BYTE_DUMP_program_name_long_s "Byte Dump"
extern const f_string_static_t byte_dump_program_name_long_s;
#endif // _di_byte_dump_program_name_
-#ifndef _di_byte_dump_program_help_parameters_
- #define BYTE_DUMP_program_help_parameters_s "filename(s)"
- #define BYTE_DUMP_program_help_parameters_s_length 11
-
- extern const f_string_static_t byte_dump_program_help_parameters_s;
-#endif // _di_byte_dump_program_help_parameters_
-
+/**
+ * The program strings for printing.
+ */
#ifndef _di_byte_dump_print_strings_
#define BYTE_DUMP_print_strings_hexidecimal_s "Hexidecimal"
#define BYTE_DUMP_print_strings_duodecimal_s "Duodecimal"
#endif // _di_byte_dump_default_allocation_step_
/**
- * Byte Dump defines.
+ * The program defines.
*
* byte_dump_mode_*:
* - hexidecimal: Display using hexidecimal notation (base 16).
#define BYTE_DUMP_character_incomplete_s "�"
#define BYTE_DUMP_character_unused_s "�"
+ #define BYTE_DUMP_character_wall_s_length 1
+ #define BYTE_DUMP_character_placeholder_s_length 3
+ #define BYTE_DUMP_character_incomplete_s_length 3
+ #define BYTE_DUMP_character_unused_s_length 3
+
+ extern const f_string_static_t byte_dump_character_wall_s;
+ extern const f_string_static_t byte_dump_character_placeholder_s;
+ extern const f_string_static_t byte_dump_character_incomplete_s;
+ extern const f_string_static_t byte_dump_character_unused_s;
+#endif // _di_byte_dump_defines_
+
+/**
+ * The program parameters.
+ *
+ * byte_dump_long_*:
+ * - first: First offset byte size.
+ * - last: Last offset byte size.
+ *
+ * - narrow: Each character in the displyed text will take at least 1 columns.
+ * - placeholder: Display (colored) placeholders to signify codes that are UTF-8 fragments.
+ * - text: Display text
+ * - wide: Each character in the displyed text will take at least 2 columns.
+ * - width: Number of characters to display per row.
+ *
+ * - binary: Display using binary format.
+ * - decimal: Display using decimal format.
+ * - duodecimal: Display using duodecimal format.
+ * - hexidecimal: Display using hexidecimal format.
+ * - octal: Display using octal format.
+ * - unicode: Display using Unicode format.
+ *
+ * - normal: Use normal presentation, displaying UTF-8 sequence codes for ASCII special codes.
+ * - simple: Use simple presentation, displaying spaces for ASCII special codes instead of UTF-8 sequence codes.
+ * - classic: Use classic presentation, displaying periods for ASCII special codes instead of UTF-8 sequence codes.
+ */
+#ifndef _di_byte_dump_parameters_
#define BYTE_DUMP_short_binary_s "b"
#define BYTE_DUMP_short_decimal_s "d"
#define BYTE_DUMP_short_duodecimal_s "D"
#define BYTE_DUMP_long_octal_s "octal"
#define BYTE_DUMP_long_unicode_s "unicode"
- #define BYTE_DUMP_long_first_s "first" // First offset byte size.
- #define BYTE_DUMP_long_last_s "last" // Last offset byte size.
+ #define BYTE_DUMP_long_first_s "first"
+ #define BYTE_DUMP_long_last_s "last"
- #define BYTE_DUMP_long_narrow_s "narrow" // Each character in the displyed text will take at least 1 columns.
- #define BYTE_DUMP_long_placeholder_s "placeholder" // Display (colored) placeholders to signify codes that are UTF-8 fragments.
- #define BYTE_DUMP_long_text_s "text" // Display text
- #define BYTE_DUMP_long_wide_s "wide" // Each character in the displyed text will take at least 2 columns.
- #define BYTE_DUMP_long_width_s "width" // Number of characters to display per row.
+ #define BYTE_DUMP_long_narrow_s "narrow"
+ #define BYTE_DUMP_long_placeholder_s "placeholder"
+ #define BYTE_DUMP_long_text_s "text"
+ #define BYTE_DUMP_long_wide_s "wide"
+ #define BYTE_DUMP_long_width_s "width"
- #define BYTE_DUMP_long_normal_s "normal" // Use normal presentation, displaying UTF-8 sequence codes for ASCII special codes.
- #define BYTE_DUMP_long_simple_s "simple" // Use simple presentation, displaying spaces for ASCII special codes instead of UTF-8 sequence codes.
- #define BYTE_DUMP_long_classic_s "classic" // Use classic presentation, displaying periods for ASCII special codes instead of UTF-8 sequence codes.
-
- #define BYTE_DUMP_character_wall_s_length 1
- #define BYTE_DUMP_character_placeholder_s_length 3
- #define BYTE_DUMP_character_incomplete_s_length 3
- #define BYTE_DUMP_character_unused_s_length 3
+ #define BYTE_DUMP_long_normal_s "normal"
+ #define BYTE_DUMP_long_simple_s "simple"
+ #define BYTE_DUMP_long_classic_s "classic"
#define BYTE_DUMP_short_binary_s_length 1
#define BYTE_DUMP_short_decimal_s_length 1
#define BYTE_DUMP_long_simple_s_length 6
#define BYTE_DUMP_long_classic_s_length 7
- extern const f_string_static_t byte_dump_character_wall_s;
- extern const f_string_static_t byte_dump_character_placeholder_s;
- extern const f_string_static_t byte_dump_character_incomplete_s;
- extern const f_string_static_t byte_dump_character_unused_s;
-
extern const f_string_static_t byte_dump_short_binary_s;
extern const f_string_static_t byte_dump_short_decimal_s;
extern const f_string_static_t byte_dump_short_duodecimal_s;
}
#define byte_dump_total_parameters_d 25
-#endif // _di_byte_dump_defines_
+#endif // _di_byte_dump_parameters_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_byte_dump_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
fl_print_t output;
#define byte_dump_main_t_initialize \
{ \
f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
F_false, \
fl_print_t_initialize, \
macro_fl_print_t_initialize_error(), \
const f_string_static_t control_program_name_long_s = macro_f_string_static_t_initialize(CONTROL_program_name_long_s, 0, CONTROL_program_name_long_s_length);
#endif // _di_control_program_name_
-#ifndef _di_control_defines_
+#ifndef _di_control_parameters_
const f_string_static_t control_short_name_s = macro_f_string_static_t_initialize(CONTROL_short_name_s, 0, CONTROL_short_name_s_length);
const f_string_static_t control_short_settings_s = macro_f_string_static_t_initialize(CONTROL_short_settings_s, 0, CONTROL_short_settings_s_length);
const f_string_static_t control_short_socket_s = macro_f_string_static_t_initialize(CONTROL_short_socket_s, 0, CONTROL_short_socket_s_length);
const f_string_static_t control_long_name_s = macro_f_string_static_t_initialize(CONTROL_long_name_s, 0, CONTROL_long_name_s_length);
const f_string_static_t control_long_settings_s = macro_f_string_static_t_initialize(CONTROL_long_settings_s, 0, CONTROL_long_settings_s_length);
const f_string_static_t control_long_socket_s = macro_f_string_static_t_initialize(CONTROL_long_socket_s, 0, CONTROL_long_socket_s_length);
-#endif // _di_control_defines_
+#endif // _di_control_parameters_
#ifndef _di_control_main_delete_
- f_status_t control_main_delete(control_main_t * const main) {
+ f_status_t control_main_delete(fll_program_data_t * const main) {
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_control_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_control_program_version_
#define CONTROL_program_version_major_s F_string_ascii_0_s
#define CONTROL_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t control_program_version_s;
#endif // _di_control_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_control_program_name_
#define CONTROL_program_name_s "control"
#define CONTROL_program_name_long_s "Control Program"
extern const f_string_static_t control_program_name_long_s;
#endif // _di_control_program_name_
-#ifndef _di_control_defines_
+/**
+ * The main program parameters.
+ */
+#ifndef _di_control_parameters_
#define CONTROL_short_name_s "n"
#define CONTROL_short_settings_s "s"
#define CONTROL_short_socket_s "k"
}
#define control_total_parameters_d 12
-#endif // _di_control_defines_
-
-#ifndef _di_control_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- uint16_t signal_check;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } control_main_t;
-
- #define control_main_initialize \
- { \
- f_console_parameters_t_initialize, \
- 0, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_control_main_t_
+#endif // _di_control_parameters_
/**
* Deallocate main.
* @see control_main()
*/
#ifndef _di_control_main_delete_
- extern f_status_t control_main_delete(control_main_t * const main);
+ extern f_status_t control_main_delete(fll_program_data_t * const main);
#endif // _di_control_main_delete_
#ifdef __cplusplus
#endif
#ifndef _di_control_print_help_
- f_status_t control_print_help(control_main_t * const main) {
+ f_status_t control_print_help(fll_program_data_t * const main) {
flockfile(main->output.to.stream);
#endif // _di_control_print_help_
#ifndef _di_control_main_
- f_status_t control_main(control_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t control_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { control_parameter_no_color_e, control_parameter_light_e, control_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
status = F_status_set_error(F_supported_not);
}
- else if (main->remaining.used) {
+ else if (main->parameters.remaining.used) {
control_data_t data = control_data_t_initialize;
data.argv = main->parameters.arguments.array;
// Verify commands before attempting to connect to the socket.
- if (control_command_identify(main, &data, data.argv[main->remaining.array[0]]) == F_found) {
+ if (control_command_identify(main, &data, data.argv[main->parameters.remaining.array[0]]) == F_found) {
status = control_command_verify(main, &data);
}
else {
- control_print_error_parameter_command_not(main, data.argv[main->remaining.array[0]]);
+ control_print_error_parameter_command_not(main, data.argv[main->parameters.remaining.array[0]]);
status = F_status_set_error(F_parameter);
}
* @see control_main()
*/
#ifndef _di_control_print_help_
- extern f_status_t control_print_help(control_main_t * const main);
+ extern f_status_t control_print_help(fll_program_data_t * const main);
#endif // _di_control_print_help_
/**
* @see control_main_delete()
*/
#ifndef _di_control_main_
- extern f_status_t control_main(control_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t control_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_control_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- control_main_t data = control_main_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_control_data_delete_
#ifndef _di_control_signal_received_
- f_status_t control_signal_received(control_main_t * const main) {
+ f_status_t control_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
return F_interrupt_not;
}
- control_main_t * const main = (control_main_t *) state_ptr->custom;
+ fll_program_data_t * const main = (fll_program_data_t *) state_ptr->custom;
if (!((++main->signal_check) % control_signal_check_d)) {
if (control_signal_received(main)) {
* command: The command type code.
* cache: A cache.
* socket: A socket used to connect to the controller.
- * argv: The argument structure in control_main_t.parameters for simplifying syntax.
+ * argv: The argument structure in fll_program_data_t.parameters for simplifying syntax.
*/
#ifndef _di_control_data_t_
typedef struct {
* @see f_signal_read()
*/
#ifndef _di_control_signal_received_
- extern f_status_t control_signal_received(control_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t control_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_control_signal_received_
/**
#endif
#ifndef _di_control_command_identify_
- f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_static_t command) {
+ f_status_t control_command_identify(fll_program_data_t * const main, control_data_t * const data, const f_string_static_t command) {
if (fl_string_dynamic_compare(command, control_freeze_s) == F_equal_to) {
data->command = control_command_type_freeze_e;
#endif // _di_control_command_identify_
#ifndef _di_control_command_verify_
- f_status_t control_command_verify(control_main_t * const main, control_data_t * const data) {
+ f_status_t control_command_verify(fll_program_data_t * const main, control_data_t * const data) {
switch (data->command) {
case control_command_type_freeze_e:
case control_command_type_start_e:
case control_command_type_stop_e:
case control_command_type_thaw_e:
- if (main->remaining.used < 2) {
- control_print_error_parameter_command_rule_not(main, data->argv[main->remaining.array[0]]);
+ if (main->parameters.remaining.used < 2) {
+ control_print_error_parameter_command_rule_not(main, data->argv[main->parameters.remaining.array[0]]);
return F_status_set_error(F_parameter);
}
- else if (main->remaining.used > 3) {
- control_print_error_parameter_command_rule_too_many(main, data->argv[main->remaining.array[0]]);
+ else if (main->parameters.remaining.used > 3) {
+ control_print_error_parameter_command_rule_too_many(main, data->argv[main->parameters.remaining.array[0]]);
return F_status_set_error(F_parameter);
}
- if (!data->argv[main->remaining.array[1]].used) {
- if (main->remaining.used == 2) {
- control_print_error_parameter_command_rule_empty(main, data->argv[main->remaining.array[0]]);
+ if (!data->argv[main->parameters.remaining.array[1]].used) {
+ if (main->parameters.remaining.used == 2) {
+ control_print_error_parameter_command_rule_empty(main, data->argv[main->parameters.remaining.array[0]]);
}
else {
- control_print_error_parameter_command_rule_directory_empty(main, data->argv[main->remaining.array[0]]);
+ control_print_error_parameter_command_rule_directory_empty(main, data->argv[main->parameters.remaining.array[0]]);
}
return F_status_set_error(F_parameter);
}
- if (main->remaining.used == 3) {
- if (!data->argv[main->remaining.array[2]].used) {
- control_print_error_parameter_command_rule_basename_empty(main, data->argv[main->remaining.array[0]]);
+ if (main->parameters.remaining.used == 3) {
+ if (!data->argv[main->parameters.remaining.array[2]].used) {
+ control_print_error_parameter_command_rule_basename_empty(main, data->argv[main->parameters.remaining.array[0]]);
return F_status_set_error(F_parameter);
}
#endif // _di_control_command_verify_
#ifndef _di_control_settings_load_
- f_status_t control_settings_load(control_main_t * const main, control_data_t * const data) {
+ f_status_t control_settings_load(fll_program_data_t * const main, control_data_t * const data) {
f_status_t status = F_none;
* F_found_not if name is unknown.
*/
#ifndef _di_control_command_identify_
- extern f_status_t control_command_identify(control_main_t * const main, control_data_t * const data, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern f_status_t control_command_identify(fll_program_data_t * const main, control_data_t * const data, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_command_identify_
/**
* The control data.
*/
#ifndef _di_control_command_verify_
- extern f_status_t control_command_verify(control_main_t * const main, control_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t control_command_verify(fll_program_data_t * const main, control_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_control_command_verify_
/**
* Load and process the control settings file.
* @see fll_fss_extended_read()
*/
#ifndef _di_control_settings_load_
- extern f_status_t control_settings_load(control_main_t * const main, control_data_t * const data) F_attribute_visibility_internal_d;
+ extern f_status_t control_settings_load(fll_program_data_t * const main, control_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_control_settings_load_
#ifdef __cplusplus
#endif
#ifndef _di_control_print_error_parameter_command_not_
- void control_print_error_parameter_command_not(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_not(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_not_
#ifndef _di_control_print_error_parameter_command_rule_basename_empty_
- void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_rule_basename_empty(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_rule_basename_empty_
#ifndef _di_control_print_error_parameter_command_rule_directory_empty_
- void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_rule_directory_empty(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_rule_directory_empty_
#ifndef _di_control_print_error_parameter_command_rule_empty_
- void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_rule_empty(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_rule_empty_
#ifndef _di_control_print_error_parameter_command_rule_not_
- void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_rule_not(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_rule_not_
#ifndef _di_control_print_error_parameter_command_rule_too_many_
- void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_static_t command) {
+ void control_print_error_parameter_command_rule_too_many(fll_program_data_t * const main, const f_string_static_t command) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_command_rule_too_many_
#ifndef _di_control_print_error_commands_none_
- void control_print_error_commands_none(control_main_t * const main) {
+ void control_print_error_commands_none(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_commands_none_
#ifndef _di_control_print_error_parameter_value_empty_
- void control_print_error_parameter_value_empty(control_main_t * const main, const f_string_static_t parameter) {
+ void control_print_error_parameter_value_empty(fll_program_data_t * const main, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_value_empty_
#ifndef _di_control_print_error_parameter_value_not_
- void control_print_error_parameter_value_not(control_main_t * const main, const f_string_static_t parameter) {
+ void control_print_error_parameter_value_not(fll_program_data_t * const main, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_parameter_value_not_
#ifndef _di_control_print_error_pipe_supported_not_
- void control_print_error_pipe_supported_not(control_main_t * const main) {
+ void control_print_error_pipe_supported_not(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_pipe_supported_not_
#ifndef _di_control_print_error_socket_file_failed_
- void control_print_error_socket_file_failed(control_main_t * const main, const f_string_static_t path_socket) {
+ void control_print_error_socket_file_failed(fll_program_data_t * const main, const f_string_static_t path_socket) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_socket_file_failed_
#ifndef _di_control_print_error_socket_file_missing_
- void control_print_error_socket_file_missing(control_main_t * const main, const f_string_static_t path_socket) {
+ void control_print_error_socket_file_missing(fll_program_data_t * const main, const f_string_static_t path_socket) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_socket_file_missing_
#ifndef _di_control_print_error_socket_file_not_
- void control_print_error_socket_file_not(control_main_t * const main, const f_string_static_t path_socket) {
+ void control_print_error_socket_file_not(fll_program_data_t * const main, const f_string_static_t path_socket) {
if (main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_control_print_error_socket_file_not_
#ifndef _di_control_print_signal_received_
- void control_print_signal_received(control_main_t * const main, const f_status_t signal) {
+ void control_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_not_
- extern void control_print_error_parameter_command_not(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_not(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_not_
/**
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_rule_basename_empty_
- extern void control_print_error_parameter_command_rule_basename_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_rule_basename_empty(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_rule_basename_empty_
/**
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_rule_directory_empty_
- extern void control_print_error_parameter_command_rule_directory_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_rule_directory_empty(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_rule_directory_empty_
/**
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_rule_empty_
- extern void control_print_error_parameter_command_rule_empty(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_rule_empty(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_rule_empty_
/**
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_rule_not_
- extern void control_print_error_parameter_command_rule_not(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_rule_not(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_rule_not_
/**
* The parameter representing a command.
*/
#ifndef _di_control_print_error_parameter_command_rule_too_many_
- extern void control_print_error_parameter_command_rule_too_many(control_main_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_command_rule_too_many(fll_program_data_t * const main, const f_string_static_t command) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_command_rule_too_many_
/**
* The main program data.
*/
#ifndef _di_control_print_error_commands_none_
- extern void control_print_error_commands_none(control_main_t * const main) F_attribute_visibility_internal_d;
+ extern void control_print_error_commands_none(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_commands_none_
/**
* The parameter name.
*/
#ifndef _di_control_print_error_parameter_value_empty_
- extern void control_print_error_parameter_value_empty(control_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_value_empty(fll_program_data_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_value_empty_
/**
* The parameter name.
*/
#ifndef _di_control_print_error_parameter_value_not_
- extern void control_print_error_parameter_value_not(control_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ extern void control_print_error_parameter_value_not(fll_program_data_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_parameter_value_not_
/**
* The main program data.
*/
#ifndef _di_control_print_error_pipe_supported_not_
- extern void control_print_error_pipe_supported_not(control_main_t * const main) F_attribute_visibility_internal_d;
+ extern void control_print_error_pipe_supported_not(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_pipe_supported_not_
/**
* The socket file path.
*/
#ifndef _di_control_print_error_socket_file_failed_
- extern void control_print_error_socket_file_failed(control_main_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
+ extern void control_print_error_socket_file_failed(fll_program_data_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_socket_file_failed_
/**
* The socket file path.
*/
#ifndef _di_control_print_error_socket_file_missing_
- extern void control_print_error_socket_file_missing(control_main_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
+ extern void control_print_error_socket_file_missing(fll_program_data_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_socket_file_missing_
/**
* The socket file path.
*/
#ifndef _di_control_print_error_socket_file_not_
- extern void control_print_error_socket_file_not(control_main_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
+ extern void control_print_error_socket_file_not(fll_program_data_t * const main, const f_string_static_t path_socket) F_attribute_visibility_internal_d;
#endif // _di_control_print_error_socket_file_not_
/**
* The signal received.
*/
#ifndef _di_control_print_signal_received_
- extern void control_print_signal_received(control_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void control_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_control_print_signal_received_
#ifdef __cplusplus
const f_string_static_t controller_path_socket_init_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_init_s, 0, CONTROLLER_path_socket_s_length);
const f_string_static_t controller_path_socket_prefix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_prefix_s, 0, CONTROLLER_path_socket_prefix_s_length);
const f_string_static_t controller_path_socket_suffix_s = macro_f_string_static_t_initialize(CONTROLLER_path_socket_suffix_s, 0, CONTROLLER_path_socket_suffix_s_length);
+#endif // _di_controller_defines_
+#ifndef _di_controller_parameters_
const f_string_static_t controller_short_cgroup_s = macro_f_string_static_t_initialize(CONTROLLER_short_cgroup_s, 0, CONTROLLER_short_cgroup_s_length);
const f_string_static_t controller_short_daemon_s = macro_f_string_static_t_initialize(CONTROLLER_short_daemon_s, 0, CONTROLLER_short_daemon_s_length);
const f_string_static_t controller_short_init_s = macro_f_string_static_t_initialize(CONTROLLER_short_init_s, 0, CONTROLLER_short_init_s_length);
const f_string_static_t controller_long_socket_s = macro_f_string_static_t_initialize(CONTROLLER_long_socket_s, 0, CONTROLLER_long_socket_s_length);
const f_string_static_t controller_long_uninterruptible_s = macro_f_string_static_t_initialize(CONTROLLER_long_uninterruptible_s, 0, CONTROLLER_long_uninterruptible_s_length);
const f_string_static_t controller_long_validate_s = macro_f_string_static_t_initialize(CONTROLLER_long_validate_s, 0, CONTROLLER_long_validate_s_length);
-#endif // _di_controller_defines_
+#endif // _di_controller_parameters_
#ifndef _di_controller_main_delete_
f_status_t controller_main_delete(controller_main_t * const main) {
f_console_parameters_delete(&main->parameters);
- f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
return F_none;
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_controller_program_version_
#define CONTROLLER_program_version_major_s F_string_ascii_0_s
#define CONTROLLER_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t controller_program_version_s;
#endif // _di_controller_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_controller_program_name_
#define CONTROLLER_program_name_s "controller"
#define CONTROLLER_program_name_long_s "Controller Program"
extern const f_string_static_t controller_program_name_init_long_s;
#endif // _di_controller_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_controller_defines_
// The pid path is a system-specific path and needs to be more easily contolled at compile time.
extern const f_string_static_t controller_path_socket_init_s;
extern const f_string_static_t controller_path_socket_prefix_s;
extern const f_string_static_t controller_path_socket_suffix_s;
+#endif // _di_controller_defines_
+/**
+ * The main program parameters.
+ */
+#ifndef _di_controller_parameters_
#define CONTROLLER_short_cgroup_s "c"
#define CONTROLLER_short_daemon_s "d"
#define CONTROLLER_short_init_s "I"
}
#define controller_total_parameters_d 19
-#endif // _di_controller_defines_
+#endif // _di_controller_parameters_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * remaining: The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_controller_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
bool as_init;
#define controller_main_t_initialize \
{ \
f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
F_false, \
F_false, \
fl_print_t_initialize, \
f_console_parameter_id_t ids[3] = { controller_parameter_no_color_e, controller_parameter_light_e, controller_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
memset(&address, 0, setting.control_socket.length);
- if (main->remaining.used) {
- status = f_string_dynamic_append(argv[main->remaining.array[0]], &setting.name_entry);
+ if (main->parameters.remaining.used) {
+ status = f_string_dynamic_append(argv[main->parameters.remaining.array[0]], &setting.name_entry);
}
else {
status = f_string_dynamic_append(controller_default_s, &setting.name_entry);
const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length);
#endif // _di_fake_build_version_
-#ifndef _di_fake_defines_
+#ifndef _di_fake_parameters_
const f_string_static_t fake_short_define_s = macro_f_string_static_t_initialize(FAKE_short_define_s, 0, FAKE_short_define_s_length);
const f_string_static_t fake_short_fakefile_s = macro_f_string_static_t_initialize(FAKE_short_fakefile_s, 0, FAKE_short_fakefile_s_length);
const f_string_static_t fake_short_mode_s = macro_f_string_static_t_initialize(FAKE_short_mode_s, 0, FAKE_short_mode_s_length);
const f_string_static_t fake_other_operation_clean_s = macro_f_string_static_t_initialize(FAKE_other_operation_clean_s, 0, FAKE_other_operation_clean_s_length);
const f_string_static_t fake_other_operation_make_s = macro_f_string_static_t_initialize(FAKE_other_operation_make_s, 0, FAKE_other_operation_make_s_length);
const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length);
-#endif // _di_fake_defines_
+#endif // _di_fake_parameters_
#ifndef _di_fake_main_delete_
f_status_t fake_main_delete(fake_main_t * const main) {
f_console_parameters_delete(&main->parameters);
- f_type_array_lengths_resize(0, &main->remaining);
-
f_string_dynamics_resize(0, &main->define);
f_string_dynamic_resize(0, &main->fakefile);
f_string_dynamics_resize(0, &main->mode);
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fake_program_version_
#define FAKE_program_version_major_s F_string_ascii_0_s
#define FAKE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fake_program_version_s;
#endif // _di_fake_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fake_program_name_
#define FAKE_program_name_s "fake"
#define FAKE_program_name_long_s "Featureless Make"
extern const f_string_static_t fake_program_name_long_s;
#endif // _di_fake_program_name_
+/**
+ * The program help related data.
+ */
#ifndef _di_fake_program_help_parameters_
#define FAKE_program_help_parameters_s "operation"
#define FAKE_program_help_parameters_s_length 9
extern const f_string_static_t fake_path_part_static_s;
#endif // _di_fake_path_
+/**
+ * The file settings.
+ */
#ifndef _di_fake_file_
#define FAKE_file_defines_s "defines"
#define FAKE_file_dependencies_s "dependencies"
extern const f_string_static_t fake_default_settings_s;
#endif // _di_fake_defaults_
+/**
+ * The build languages.
+ */
#ifndef _di_fake_build_language_
enum {
fake_build_language_type_bash_e = 1,
extern const f_string_static_t fake_build_language_cpp_s;
#endif // _di_fake_build_language_
+/**
+ * The program version.
+ */
#ifndef _di_fake_build_version_
enum {
fake_build_version_type_major_e = 1,
extern const f_string_static_t fake_build_version_nano_s;
#endif // _di_fake_build_version_
+/**
+ * The program defines.
+ */
#ifndef _di_fake_defines_
enum {
fake_operation_build_e = 1,
#define fake_operations_total_d 4
#define fake_operations_initialize { 0, 0, 0, 0 }
+#endif // _di_fake_defines_
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fake_parameters_
#define FAKE_short_define_s "d"
#define FAKE_short_fakefile_s "f"
#define FAKE_short_mode_s "m"
}
#define fake_total_parameters_d 28
-#endif // _di_fake_defines_
-
+#endif // _di_fake_parameters_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_fake_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
fl_print_t output;
#define fake_main_t_initialize \
{ \
f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
F_false, \
fl_print_t_initialize, \
macro_fl_print_t_initialize_error(), \
f_console_parameter_id_t ids[3] = { fake_parameter_no_color_e, fake_parameter_light_e, fake_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
f_console_parameters_delete(&main->parameters);
f_string_dynamics_resize(0, &main->chains);
- f_type_array_lengths_resize(0, &main->remaining);
f_string_dynamics_resize(0, &main->devices);
macro_f_color_context_t_delete_simple(main->context);
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_firewall_program_version_
#define FIREWALL_program_version_major_s F_string_ascii_0_s
#define FIREWALL_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t firewall_program_version_s;
#endif // _di_firewall_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_firewall_program_name_
#define FIREWALL_program_name_s "firewall"
#define FIREWALL_program_name_long_s "Kevux Firewall Manager"
extern const f_string_static_t firewall_program_name_long_s;
#endif // _di_firewall_program_name_
+/**
+ * The program help related data.
+ */
#ifndef _di_firewall_program_help_parameters_
#define FIREWALL_program_help_parameters_s "command"
#define FIREWALL_program_help_parameters_s_length 7
extern const f_string_static_t firewall_program_help_parameters_s;
#endif // _di_firewall_program_help_parameters_
+/**
+ * The program paths.
+ */
#ifndef _di_firewall_paths_
#define FIREWALL_file_first_s "firewall-first"
#define FIREWALL_file_last_s "firewall-last"
extern const f_string_static_t firewall_network_devices_s;
#endif // _di_firewall_paths_
+/**
+ * Default allocations.
+ */
#ifndef _di_firewall_default_allocation_step_
#define firewall_default_allocation_step_d F_memory_default_allocation_small_d
#endif // _di_firewall_default_allocation_step_
+/**
+ * The program defines.
+ */
#ifndef _di_firewall_defines_
#define firewall_signal_check_d 10000
+#endif // _di_firewall_defines_
+/**
+ * The main program parameters.
+ */
+#ifndef _di_firewall_parameters_
#define FIREWALL_action_s "action"
#define FIREWALL_action_append_s "append"
#define FIREWALL_action_insert_s "insert"
#define firewall_total_parameters_d 14
#endif // _di_firewall_defines_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_firewall_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
int child;
#define firewall_main_t_initialize \
{ \
f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
F_false, \
0, \
fl_print_t_initialize, \
f_console_parameter_id_t ids[3] = { firewall_parameter_no_color_e, firewall_parameter_light_e, firewall_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
int return_code = 0;
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
show_nat = F_false;
show_mangle = F_false;
show_ports = F_false;
f_array_length_t index = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
- index = main->remaining.array[i];
+ index = main->parameters.remaining.array[i];
if (fl_string_dynamic_compare(firewall_show_nat_s, argv[index]) == F_equal_to) {
show_nat = F_true;
const f_string_static_t fss_basic_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_program_name_long_s, 0, FSS_BASIC_LIST_READ_program_name_long_s_length);
#endif // _di_fss_basic_list_read_program_name_
-#ifndef _di_fss_basic_list_read_main_delete_
- f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_basic_list_read_defines_
+ const f_string_static_t fss_basic_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_end_s, 0, FSS_BASIC_LIST_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_basic_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_ignore_s, 0, FSS_BASIC_LIST_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_basic_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_pipe_content_start_s, 0, FSS_BASIC_LIST_READ_pipe_content_start_s_length);
+#endif // _di_fss_basic_list_read_defines_
+
+#ifndef _di_fss_basic_list_read_parameters_
+ const f_string_static_t fss_basic_list_read_short_at_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_at_s, 0, FSS_BASIC_LIST_READ_short_at_s_length);
+ const f_string_static_t fss_basic_list_read_short_content_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_content_s, 0, FSS_BASIC_LIST_READ_short_content_s_length);
+ const f_string_static_t fss_basic_list_read_short_columns_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_columns_s, 0, FSS_BASIC_LIST_READ_short_columns_s_length);
+ const f_string_static_t fss_basic_list_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_delimit_s, 0, FSS_BASIC_LIST_READ_short_delimit_s_length);
+ const f_string_static_t fss_basic_list_read_short_depth_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_depth_s, 0, FSS_BASIC_LIST_READ_short_depth_s_length);
+ const f_string_static_t fss_basic_list_read_short_empty_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_empty_s, 0, FSS_BASIC_LIST_READ_short_empty_s_length);
+ const f_string_static_t fss_basic_list_read_short_line_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_line_s, 0, FSS_BASIC_LIST_READ_short_line_s_length);
+ const f_string_static_t fss_basic_list_read_short_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_name_s, 0, FSS_BASIC_LIST_READ_short_name_s_length);
+ const f_string_static_t fss_basic_list_read_short_object_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_object_s, 0, FSS_BASIC_LIST_READ_short_object_s_length);
+ const f_string_static_t fss_basic_list_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_pipe_s, 0, FSS_BASIC_LIST_READ_short_pipe_s_length);
+ const f_string_static_t fss_basic_list_read_short_raw_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_raw_s, 0, FSS_BASIC_LIST_READ_short_raw_s_length);
+ const f_string_static_t fss_basic_list_read_short_select_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_select_s, 0, FSS_BASIC_LIST_READ_short_select_s_length);
+ const f_string_static_t fss_basic_list_read_short_total_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_total_s, 0, FSS_BASIC_LIST_READ_short_total_s_length);
+ const f_string_static_t fss_basic_list_read_short_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_short_trim_s, 0, FSS_BASIC_LIST_READ_short_trim_s_length);
+
+ const f_string_static_t fss_basic_list_read_long_at_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_at_s, 0, FSS_BASIC_LIST_READ_long_at_s_length);
+ const f_string_static_t fss_basic_list_read_long_content_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_content_s, 0, FSS_BASIC_LIST_READ_long_content_s_length);
+ const f_string_static_t fss_basic_list_read_long_columns_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_columns_s, 0, FSS_BASIC_LIST_READ_long_columns_s_length);
+ const f_string_static_t fss_basic_list_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_delimit_s, 0, FSS_BASIC_LIST_READ_long_delimit_s_length);
+ const f_string_static_t fss_basic_list_read_long_depth_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_depth_s, 0, FSS_BASIC_LIST_READ_long_depth_s_length);
+ const f_string_static_t fss_basic_list_read_long_empty_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_empty_s, 0, FSS_BASIC_LIST_READ_long_empty_s_length);
+ const f_string_static_t fss_basic_list_read_long_line_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_line_s, 0, FSS_BASIC_LIST_READ_long_line_s_length);
+ const f_string_static_t fss_basic_list_read_long_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_name_s, 0, FSS_BASIC_LIST_READ_long_name_s_length);
+ const f_string_static_t fss_basic_list_read_long_object_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_object_s, 0, FSS_BASIC_LIST_READ_long_object_s_length);
+ const f_string_static_t fss_basic_list_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_pipe_s, 0, FSS_BASIC_LIST_READ_long_pipe_s_length);
+ const f_string_static_t fss_basic_list_read_long_raw_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_raw_s, 0, FSS_BASIC_LIST_READ_long_raw_s_length);
+ const f_string_static_t fss_basic_list_read_long_select_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_select_s, 0, FSS_BASIC_LIST_READ_long_select_s_length);
+ const f_string_static_t fss_basic_list_read_long_total_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_total_s, 0, FSS_BASIC_LIST_READ_long_total_s_length);
+ const f_string_static_t fss_basic_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_READ_long_trim_s, 0, FSS_BASIC_LIST_READ_long_trim_s_length);
+#endif // _di_fss_basic_list_read_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_basic_list_read_main_delete_
+ f_status_t fss_basic_list_read_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_basic_list_read_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_basic_list_read_program_version_
#define FSS_BASIC_LIST_READ_program_version_major_s F_string_ascii_0_s
#define FSS_BASIC_LIST_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_basic_list_program_version_s;
#endif // _di_fss_basic_list_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_basic_list_read_program_name_
#define FSS_BASIC_LIST_READ_program_name_s "fss_basic_list_read"
#define FSS_BASIC_LIST_READ_program_name_long_s "FSS Basic List Read"
extern const f_string_static_t fss_basic_list_program_name_long_s;
#endif // _di_fss_basic_list_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_basic_list_read_defines_
#define fss_basic_list_read_signal_check_d 10000
- #define fss_basic_list_read_pipe_content_end_s '\f'
- #define fss_basic_list_read_pipe_content_ignore_s '\v'
- #define fss_basic_list_read_pipe_content_start_s '\b'
-
- #define fss_basic_list_read_short_at_s "a"
- #define fss_basic_list_read_short_content_s "c"
- #define fss_basic_list_read_short_columns_s "C"
- #define fss_basic_list_read_short_delimit_s "D"
- #define fss_basic_list_read_short_depth_s "d"
- #define fss_basic_list_read_short_empty_s "e"
- #define fss_basic_list_read_short_line_s "l"
- #define fss_basic_list_read_short_name_s "n"
- #define fss_basic_list_read_short_object_s "o"
- #define fss_basic_list_read_short_pipe_s "p"
- #define fss_basic_list_read_short_raw_s "R"
- #define fss_basic_list_read_short_select_s "s"
- #define fss_basic_list_read_short_total_s "t"
- #define fss_basic_list_read_short_trim_s "T"
-
- #define fss_basic_list_read_long_at_s "at"
- #define fss_basic_list_read_long_content_s "content"
- #define fss_basic_list_read_long_columns_s "columns"
- #define fss_basic_list_read_long_delimit_s "delimit"
- #define fss_basic_list_read_long_depth_s "depth"
- #define fss_basic_list_read_long_empty_s "empty"
- #define fss_basic_list_read_long_line_s "line"
- #define fss_basic_list_read_long_name_s "name"
- #define fss_basic_list_read_long_object_s "object"
- #define fss_basic_list_read_long_pipe_s "pipe"
- #define fss_basic_list_read_long_raw_s "raw"
- #define fss_basic_list_read_long_select_s "select"
- #define fss_basic_list_read_long_total_s "total"
- #define fss_basic_list_read_long_trim_s "trim"
+ #define FSS_BASIC_LIST_READ_pipe_content_end_s "\f"
+ #define FSS_BASIC_LIST_READ_pipe_content_ignore_s "\v"
+ #define FSS_BASIC_LIST_READ_pipe_content_start_s "\b"
+
+ #define FSS_BASIC_LIST_READ_pipe_content_end_s_length 1
+ #define FSS_BASIC_LIST_READ_pipe_content_ignore_s_length 1
+ #define FSS_BASIC_LIST_READ_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_basic_list_read_pipe_content_end_s;
+ extern const f_string_static_t fss_basic_list_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_basic_list_read_pipe_content_start_s;
+#endif // _di_fss_basic_list_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_basic_list_read_parameters_
+ #define FSS_BASIC_LIST_READ_short_at_s "a"
+ #define FSS_BASIC_LIST_READ_short_content_s "c"
+ #define FSS_BASIC_LIST_READ_short_columns_s "C"
+ #define FSS_BASIC_LIST_READ_short_delimit_s "D"
+ #define FSS_BASIC_LIST_READ_short_depth_s "d"
+ #define FSS_BASIC_LIST_READ_short_empty_s "e"
+ #define FSS_BASIC_LIST_READ_short_line_s "l"
+ #define FSS_BASIC_LIST_READ_short_name_s "n"
+ #define FSS_BASIC_LIST_READ_short_object_s "o"
+ #define FSS_BASIC_LIST_READ_short_pipe_s "p"
+ #define FSS_BASIC_LIST_READ_short_raw_s "R"
+ #define FSS_BASIC_LIST_READ_short_select_s "s"
+ #define FSS_BASIC_LIST_READ_short_total_s "t"
+ #define FSS_BASIC_LIST_READ_short_trim_s "T"
+
+ #define FSS_BASIC_LIST_READ_long_at_s "at"
+ #define FSS_BASIC_LIST_READ_long_content_s "content"
+ #define FSS_BASIC_LIST_READ_long_columns_s "columns"
+ #define FSS_BASIC_LIST_READ_long_delimit_s "delimit"
+ #define FSS_BASIC_LIST_READ_long_depth_s "depth"
+ #define FSS_BASIC_LIST_READ_long_empty_s "empty"
+ #define FSS_BASIC_LIST_READ_long_line_s "line"
+ #define FSS_BASIC_LIST_READ_long_name_s "name"
+ #define FSS_BASIC_LIST_READ_long_object_s "object"
+ #define FSS_BASIC_LIST_READ_long_pipe_s "pipe"
+ #define FSS_BASIC_LIST_READ_long_raw_s "raw"
+ #define FSS_BASIC_LIST_READ_long_select_s "select"
+ #define FSS_BASIC_LIST_READ_long_total_s "total"
+ #define FSS_BASIC_LIST_READ_long_trim_s "trim"
+
+ #define FSS_BASIC_LIST_READ_short_at_s_length 1
+ #define FSS_BASIC_LIST_READ_short_content_s_length 1
+ #define FSS_BASIC_LIST_READ_short_columns_s_length 1
+ #define FSS_BASIC_LIST_READ_short_delimit_s_length 1
+ #define FSS_BASIC_LIST_READ_short_depth_s_length 1
+ #define FSS_BASIC_LIST_READ_short_empty_s_length 1
+ #define FSS_BASIC_LIST_READ_short_line_s_length 1
+ #define FSS_BASIC_LIST_READ_short_name_s_length 1
+ #define FSS_BASIC_LIST_READ_short_object_s_length 1
+ #define FSS_BASIC_LIST_READ_short_pipe_s_length 1
+ #define FSS_BASIC_LIST_READ_short_raw_s_length 1
+ #define FSS_BASIC_LIST_READ_short_select_s_length 1
+ #define FSS_BASIC_LIST_READ_short_total_s_length 1
+ #define FSS_BASIC_LIST_READ_short_trim_s_length 1
+
+ #define FSS_BASIC_LIST_READ_long_at_s_length 2
+ #define FSS_BASIC_LIST_READ_long_content_s_length 7
+ #define FSS_BASIC_LIST_READ_long_columns_s_length 8
+ #define FSS_BASIC_LIST_READ_long_delimit_s_length 7
+ #define FSS_BASIC_LIST_READ_long_depth_s_length 5
+ #define FSS_BASIC_LIST_READ_long_empty_s_length 5
+ #define FSS_BASIC_LIST_READ_long_line_s_length 4
+ #define FSS_BASIC_LIST_READ_long_name_s_length 4
+ #define FSS_BASIC_LIST_READ_long_object_s_length 6
+ #define FSS_BASIC_LIST_READ_long_pipe_s_length 4
+ #define FSS_BASIC_LIST_READ_long_raw_s_length 3
+ #define FSS_BASIC_LIST_READ_long_select_s_length 6
+ #define FSS_BASIC_LIST_READ_long_total_s_length 5
+ #define FSS_BASIC_LIST_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_basic_list_read_short_at_s;
+ extern const f_string_static_t fss_basic_list_read_short_content_s;
+ extern const f_string_static_t fss_basic_list_read_short_columns_s;
+ extern const f_string_static_t fss_basic_list_read_short_delimit_s;
+ extern const f_string_static_t fss_basic_list_read_short_depth_s;
+ extern const f_string_static_t fss_basic_list_read_short_empty_s;
+ extern const f_string_static_t fss_basic_list_read_short_line_s;
+ extern const f_string_static_t fss_basic_list_read_short_name_s;
+ extern const f_string_static_t fss_basic_list_read_short_object_s;
+ extern const f_string_static_t fss_basic_list_read_short_pipe_s;
+ extern const f_string_static_t fss_basic_list_read_short_raw_s;
+ extern const f_string_static_t fss_basic_list_read_short_select_s;
+ extern const f_string_static_t fss_basic_list_read_short_total_s;
+ extern const f_string_static_t fss_basic_list_read_short_trim_s;
+
+ extern const f_string_static_t fss_basic_list_read_long_at_s;
+ extern const f_string_static_t fss_basic_list_read_long_content_s;
+ extern const f_string_static_t fss_basic_list_read_long_columns_s;
+ extern const f_string_static_t fss_basic_list_read_long_delimit_s;
+ extern const f_string_static_t fss_basic_list_read_long_depth_s;
+ extern const f_string_static_t fss_basic_list_read_long_empty_s;
+ extern const f_string_static_t fss_basic_list_read_long_line_s;
+ extern const f_string_static_t fss_basic_list_read_long_name_s;
+ extern const f_string_static_t fss_basic_list_read_long_object_s;
+ extern const f_string_static_t fss_basic_list_read_long_pipe_s;
+ extern const f_string_static_t fss_basic_list_read_long_raw_s;
+ extern const f_string_static_t fss_basic_list_read_long_select_s;
+ extern const f_string_static_t fss_basic_list_read_long_total_s;
+ extern const f_string_static_t fss_basic_list_read_long_trim_s;
enum {
fss_basic_list_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_at_s.string, fss_basic_list_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s.string, fss_basic_list_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s.string, fss_basic_list_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s.string, fss_basic_list_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s.string, fss_basic_list_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s.string, fss_basic_list_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s.string, fss_basic_list_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s.string, fss_basic_list_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s.string, fss_basic_list_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s.string, fss_basic_list_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s.string, fss_basic_list_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s.string, fss_basic_list_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s.string, fss_basic_list_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s.string, fss_basic_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_basic_list_total_parameters_d 23
-#endif // _di_fss_basic_list_read_defines_
+#endif // _di_fss_basic_list_read_parameters_
/**
* FSS Delimit Parameter data.
};
#endif // _di_fss_basic_list_read_delimit_modes_
-#ifndef _di_fss_basic_list_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_basic_list_read_main_t;
-
- #define fss_basic_list_read_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_list_read_main_t_
-
/**
* Deallocate main.
*
* @see fss_basic_list_read_main()
*/
#ifndef _di_fss_basic_list_read_main_delete_
- extern f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main);
+ extern f_status_t fss_basic_list_read_main_delete(fll_program_data_t * const main);
#endif // _di_fss_basic_list_read_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_basic_list_program_version_
- const f_string_static_t fss_basic_list_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_version_s, 0, FSS_BASIC_LIST_program_version_s_length);
-#endif // _di_fss_basic_list_program_version_
-
-#ifndef _di_fss_basic_list_program_name_
- const f_string_static_t fss_basic_list_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_name_s, 0, FSS_BASIC_LIST_program_name_s_length);
- const f_string_static_t fss_basic_list_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_program_name_long_s, 0, FSS_BASIC_LIST_program_name_long_s_length);
-#endif // _di_fss_basic_list_program_name_
-
#ifndef _di_fss_basic_list_read_print_help_
f_status_t fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_basic_list_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_basic_list_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
#endif // _di_fss_basic_list_read_print_help_
#ifndef _di_fss_basic_list_read_main_
- f_status_t fss_basic_list_read_main(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_basic_list_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_basic_list_read_parameter_no_color_e, fss_basic_list_read_parameter_light_e, fss_basic_list_read_parameter_dark_e };
const f_console_parameter_ids_t choices = { ids, 3 };
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
- fss_basic_list_read_file_t files_array[main->remaining.used + 1];
+ fss_basic_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_list_read_data_t data = fss_basic_list_read_data_t_initialize;
data.files.array = files_array;
data.files.used = 1;
- data.files.size = main->remaining.used + 1;
+ data.files.size = main->parameters.remaining.used + 1;
data.files.array[0].name = "(pipe)";
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
{
const f_array_length_t parameter_code[] = {
fss_basic_list_read_parameter_at_e,
}
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
uint16_t signal_check = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_basic_list_read_signal_check_d)) {
if (fss_basic_list_read_signal_received(main)) {
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
else if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->remaining.array[i]];
+ data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
*
* This is the FSS Basic List Read program
* This program utilizes the Featureless Linux Library.
- * This program processes files or other input in fss format and stores the results in the fss_basic_list_read_main_t.
+ * This program processes files or other input in fss format and stores the results in the fll_program_data_t.
*
* This processes in accordance to the FSS-0002 Basic List specification.
*/
* @see fss_basic_list_read_main_delete()
*/
#ifndef _di_fss_basic_list_read_main_
- extern f_status_t fss_basic_list_read_main(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_basic_list_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_list_read_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fss_basic_list_read_main_t data = fss_basic_list_read_main_t_initialize;
+ fll_program_data_t data = fss_basic_list_read_main_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_basic_list_read_depths_resize_
#ifndef _di_fss_basic_list_read_print_signal_received_
- void fss_basic_list_read_print_signal_received(fss_basic_list_read_main_t * const main, const f_status_t signal) {
+ void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_basic_list_read_print_signal_received_
#ifndef _di_fss_basic_list_read_signal_received_
- f_status_t fss_basic_list_read_signal_received(fss_basic_list_read_main_t * const main) {
+ f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_basic_list_read_print_signal_received_
- extern void fss_basic_list_read_print_signal_received(fss_basic_list_read_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_basic_list_read_signal_received_
- extern f_status_t fss_basic_list_read_signal_received(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_basic_list_read_print_at_
- void fss_basic_list_read_print_at(fss_basic_list_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_list_read_data_t * const data) {
+ void fss_basic_list_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_list_read_data_t * const data) {
if (at >= data->contents.used) {
return;
#endif // _di_fss_basic_list_read_print_at_
#ifndef _di_fss_basic_list_read_print_at_object_
- void fss_basic_list_read_print_at_object(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
+ void fss_basic_list_read_print_at_object(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
if (at >= data->objects.used) {
return;
#endif // _di_fss_basic_list_read_print_at_object_
#ifndef _di_fss_basic_list_read_print_content_ignore_
- void fss_basic_list_read_print_content_ignore(fss_basic_list_read_main_t * const main) {
+ void fss_basic_list_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_basic_list_read_pipe_content_ignore_s, main->output.to.stream);
#endif // _di_fss_basic_list_read_print_content_ignore_
#ifndef _di_fss_basic_list_read_print_object_end_
- void fss_basic_list_read_print_object_end(fss_basic_list_read_main_t * const main) {
+ void fss_basic_list_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_basic_list_read_pipe_content_start_s, main->output.to.stream);
#endif // _di_fss_basic_list_read_print_object_end_
#ifndef _di_fss_basic_list_read_print_set_end_
- void fss_basic_list_read_print_set_end(fss_basic_list_read_main_t * const main) {
+ void fss_basic_list_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_basic_list_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_basic_list_read_print_set_end_
#ifndef _di_fss_basic_list_read_print_one_
- void fss_basic_list_read_print_one(fss_basic_list_read_main_t * const main) {
+ void fss_basic_list_read_print_one(fll_program_data_t * const main) {
f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#endif // _di_fss_basic_list_read_print_one_
#ifndef _di_fss_basic_list_read_print_zero_
- void fss_basic_list_read_print_zero(fss_basic_list_read_main_t * const main) {
+ void fss_basic_list_read_print_zero(fll_program_data_t * const main) {
f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
* The program data.
*/
#ifndef _di_fss_basic_list_read_print_at_
- extern void fss_basic_list_read_print_at(fss_basic_list_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_at_
/**
* The delimits to be applied to an Object.
*/
#ifndef _di_fss_basic_list_read_print_at_object_
- extern void fss_basic_list_read_print_at_object(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_at_object(fll_program_data_t * const main, fss_basic_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_at_object_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_read_print_content_ignore_
- extern void fss_basic_list_read_print_content_ignore(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_content_ignore(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_content_ignore_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_read_print_object_end_
- extern void fss_basic_list_read_print_object_end(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_object_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_object_end_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_read_print_one_
- extern void fss_basic_list_read_print_one(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_one(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_one_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_read_print_set_end_
- extern void fss_basic_list_read_print_set_end(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_set_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_set_end_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_read_print_zero_
- extern void fss_basic_list_read_print_zero(fss_basic_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_zero(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_zero_
#ifdef __cplusplus
#endif // _di_fss_basic_list_read_delimit_object_is_
#ifndef _di_fss_basic_list_read_depth_process_
- f_status_t fss_basic_list_read_depth_process(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_basic_list_read_file_identify_
#ifndef _di_fss_basic_list_read_load_
- f_status_t fss_basic_list_read_load(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t *data) {
f_state_t state = macro_f_state_t_initialize(fss_basic_list_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#endif // _di_fss_basic_list_read_load_
#ifndef _di_fss_basic_list_read_load_number_
- f_status_t fss_basic_list_read_load_number(fss_basic_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
#endif // _di_fss_basic_list_read_load_number_
#ifndef _di_fss_basic_list_read_process_
- f_status_t fss_basic_list_read_process(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
f_status_t status = fss_basic_list_read_process_option(main, arguments, data);
if (F_status_is_error(status)) return status;
#endif // _di_fss_basic_list_read_process_
#ifndef _di_fss_basic_list_read_process_at_
- f_status_t fss_basic_list_read_process_at(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_basic_list_read_data_option_columns_d | fss_basic_list_read_data_option_total_d)) {
#endif // _di_fss_basic_list_read_process_at_
#ifndef _di_fss_basic_list_read_process_at_line_
- f_status_t fss_basic_list_read_process_at_line(fss_basic_list_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_basic_list_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_basic_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_basic_list_read_data_t *data, f_array_length_t *line) {
if (data->option & fss_basic_list_read_data_option_object_d) {
if (*line == data->line) {
#endif // _di_fss_basic_list_read_process_at_line_
#ifndef _di_fss_basic_list_read_process_columns_
- f_status_t fss_basic_list_read_process_columns(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
if (!(data->option & fss_basic_list_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_basic_list_read_process_columns_
#ifndef _di_fss_basic_list_read_process_line_
- f_status_t fss_basic_list_read_process_line(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_basic_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
#endif // _di_fss_basic_list_read_process_name_
#ifndef _di_fss_basic_list_read_process_option_
- f_status_t fss_basic_list_read_process_option(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
+ f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_basic_list_read_process_option_
#ifndef _di_fss_basic_list_read_process_total_
- f_status_t fss_basic_list_read_process_total(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
* @see fss_basic_list_read_depths_resize()
*/
#ifndef _di_fss_basic_list_read_depth_process_
- extern f_status_t fss_basic_list_read_depth_process(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_depth_process_
/**
* @see fss_basic_list_read_process_option()
*/
#ifndef _di_fss_basic_list_read_load_
- extern f_status_t fss_basic_list_read_load(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_load_
/**
* @see fss_basic_list_read_depths_resize()
*/
#ifndef _di_fss_basic_list_read_load_number_
- extern f_status_t fss_basic_list_read_load_number(fss_basic_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_load_number_
/**
* @see fss_basic_list_read_process_option()
*/
#ifndef _di_fss_basic_list_read_process_
- extern f_status_t fss_basic_list_read_process(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_
/**
* @see fss_basic_list_read_process_at_line()
*/
#ifndef _di_fss_basic_list_read_process_at_
- extern f_status_t fss_basic_list_read_process_at(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_at(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_at_
/**
* F_success on success and the line was matched (and possibly printed).
*/
#ifndef _di_fss_basic_list_read_process_at_line_
- extern f_status_t fss_basic_list_read_process_at_line(fss_basic_list_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_basic_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_basic_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_columns_
- extern f_status_t fss_basic_list_read_process_columns(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_columns(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_line_
- extern f_status_t fss_basic_list_read_process_line(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_line(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_line_
/**
* @see fss_basic_list_read_load_setting()
*/
#ifndef _di_fss_basic_list_read_process_option_
- extern f_status_t fss_basic_list_read_process_option(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_process_total_
- extern f_status_t fss_basic_list_read_process_total(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_read_process_total(fll_program_data_t * const main, fss_basic_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_process_total_
#ifdef __cplusplus
const f_string_static_t fss_basic_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_name_long_s, 0, FSS_BASIC_LIST_WRITE_program_name_long_s_length);
#endif // _di_fss_basic_list_write_program_name_
-#ifndef _di_fss_basic_list_write_main_delete_
- f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_basic_list_write_defines_
+ const f_string_static_t fss_basic_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_end_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_basic_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_ignore_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_basic_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_content_start_s, 0, FSS_BASIC_LIST_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_basic_list_write_defines_
+
+#ifndef _di_fss_basic_list_write_parameters_
+ const f_string_static_t fss_basic_list_write_short_file_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_file_s, 0, FSS_BASIC_LIST_WRITE_short_file_s_length);
+ const f_string_static_t fss_basic_list_write_short_content_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_content_s, 0, FSS_BASIC_LIST_WRITE_short_content_s_length);
+ const f_string_static_t fss_basic_list_write_short_double_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_double_s, 0, FSS_BASIC_LIST_WRITE_short_double_s_length);
+ const f_string_static_t fss_basic_list_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_ignore_s, 0, FSS_BASIC_LIST_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_basic_list_write_short_object_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_object_s, 0, FSS_BASIC_LIST_WRITE_short_object_s_length);
+ const f_string_static_t fss_basic_list_write_short_partial_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_partial_s, 0, FSS_BASIC_LIST_WRITE_short_partial_s_length);
+ const f_string_static_t fss_basic_list_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_prepend_s, 0, FSS_BASIC_LIST_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_basic_list_write_short_single_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_single_s, 0, FSS_BASIC_LIST_WRITE_short_single_s_length);
+ const f_string_static_t fss_basic_list_write_short_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_short_trim_s, 0, FSS_BASIC_LIST_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_basic_list_write_long_file_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_file_s, 0, FSS_BASIC_LIST_WRITE_long_file_s_length);
+ const f_string_static_t fss_basic_list_write_long_content_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_content_s, 0, FSS_BASIC_LIST_WRITE_long_content_s_length);
+ const f_string_static_t fss_basic_list_write_long_double_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_double_s, 0, FSS_BASIC_LIST_WRITE_long_double_s_length);
+ const f_string_static_t fss_basic_list_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_ignore_s, 0, FSS_BASIC_LIST_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_basic_list_write_long_object_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_object_s, 0, FSS_BASIC_LIST_WRITE_long_object_s_length);
+ const f_string_static_t fss_basic_list_write_long_partial_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_partial_s, 0, FSS_BASIC_LIST_WRITE_long_partial_s_length);
+ const f_string_static_t fss_basic_list_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_prepend_s, 0, FSS_BASIC_LIST_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_basic_list_write_long_single_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_single_s, 0, FSS_BASIC_LIST_WRITE_long_single_s_length);
+ const f_string_static_t fss_basic_list_write_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_long_trim_s, 0, FSS_BASIC_LIST_WRITE_long_trim_s_length);
+#endif // _di_fss_basic_list_write_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_basic_list_write_main_delete_
+ f_status_t fss_basic_list_write_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_basic_list_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_basic_list_write_program_version_
#define FSS_BASIC_LIST_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_BASIC_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_basic_list_write_program_version_s;
#endif // _di_fss_basic_list_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_basic_list_write_program_name_
#define FSS_BASIC_LIST_WRITE_program_name_s "fss_basic_list_write"
#define FSS_BASIC_LIST_WRITE_program_name_long_s "FSS Basic List Write"
extern const f_string_static_t fss_basic_list_write_program_name_long_s;
#endif // _di_fss_basic_list_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_basic_list_write_defines_
#define fss_basic_list_write_signal_check_d 10000
- #define fss_basic_list_write_pipe_content_end_s '\f'
- #define fss_basic_list_write_pipe_content_ignore_s '\v'
- #define fss_basic_list_write_pipe_content_start_s '\b'
-
- #define fss_basic_list_write_short_file_s "f"
- #define fss_basic_list_write_short_content_s "c"
- #define fss_basic_list_write_short_double_s "d"
- #define fss_basic_list_write_short_ignore_s "I"
- #define fss_basic_list_write_short_object_s "o"
- #define fss_basic_list_write_short_partial_s "p"
- #define fss_basic_list_write_short_prepend_s "P"
- #define fss_basic_list_write_short_single_s "s"
- #define fss_basic_list_write_short_trim_s "T"
-
- #define fss_basic_list_write_long_file_s "file"
- #define fss_basic_list_write_long_content_s "content"
- #define fss_basic_list_write_long_double_s "double"
- #define fss_basic_list_write_long_ignore_s "ignore"
- #define fss_basic_list_write_long_object_s "object"
- #define fss_basic_list_write_long_partial_s "partial"
- #define fss_basic_list_write_long_prepend_s "prepend"
- #define fss_basic_list_write_long_single_s "single"
- #define fss_basic_list_write_long_trim_s "trim"
+ #define FSS_BASIC_LIST_WRITE_pipe_content_end_s '\f'
+ #define FSS_BASIC_LIST_WRITE_pipe_content_ignore_s '\v'
+ #define FSS_BASIC_LIST_WRITE_pipe_content_start_s '\b'
+
+ #define FSS_BASIC_LIST_WRITE_pipe_content_end_s_length 1
+ #define FSS_BASIC_LIST_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_BASIC_LIST_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_basic_list_write_pipe_content_end_s;
+ extern const f_string_static_t fss_basic_list_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_basic_list_write_pipe_content_start_s;
+#endif // _di_fss_basic_list_write_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_basic_list_write_parameters_
+ #define FSS_BASIC_LIST_WRITE_short_file_s "f"
+ #define FSS_BASIC_LIST_WRITE_short_content_s "c"
+ #define FSS_BASIC_LIST_WRITE_short_double_s "d"
+ #define FSS_BASIC_LIST_WRITE_short_ignore_s "I"
+ #define FSS_BASIC_LIST_WRITE_short_object_s "o"
+ #define FSS_BASIC_LIST_WRITE_short_partial_s "p"
+ #define FSS_BASIC_LIST_WRITE_short_prepend_s "P"
+ #define FSS_BASIC_LIST_WRITE_short_single_s "s"
+ #define FSS_BASIC_LIST_WRITE_short_trim_s "T"
+
+ #define FSS_BASIC_LIST_WRITE_long_file_s "file"
+ #define FSS_BASIC_LIST_WRITE_long_content_s "content"
+ #define FSS_BASIC_LIST_WRITE_long_double_s "double"
+ #define FSS_BASIC_LIST_WRITE_long_ignore_s "ignore"
+ #define FSS_BASIC_LIST_WRITE_long_object_s "object"
+ #define FSS_BASIC_LIST_WRITE_long_partial_s "partial"
+ #define FSS_BASIC_LIST_WRITE_long_prepend_s "prepend"
+ #define FSS_BASIC_LIST_WRITE_long_single_s "single"
+ #define FSS_BASIC_LIST_WRITE_long_trim_s "trim"
+
+ #define FSS_BASIC_LIST_WRITE_short_file_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_content_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_double_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_ignore_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_object_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_partial_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_prepend_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_single_s_length 1
+ #define FSS_BASIC_LIST_WRITE_short_trim_s_length 1
+
+ #define FSS_BASIC_LIST_WRITE_long_file_s_length 4
+ #define FSS_BASIC_LIST_WRITE_long_content_s_length 7
+ #define FSS_BASIC_LIST_WRITE_long_double_s_length 6
+ #define FSS_BASIC_LIST_WRITE_long_ignore_s_length 6
+ #define FSS_BASIC_LIST_WRITE_long_object_s_length 6
+ #define FSS_BASIC_LIST_WRITE_long_partial_s_length 7
+ #define FSS_BASIC_LIST_WRITE_long_prepend_s_length 7
+ #define FSS_BASIC_LIST_WRITE_long_single_s_length 6
+ #define FSS_BASIC_LIST_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_basic_list_write_short_file_s;
+ extern const f_string_static_t fss_basic_list_write_short_content_s;
+ extern const f_string_static_t fss_basic_list_write_short_double_s;
+ extern const f_string_static_t fss_basic_list_write_short_ignore_s;
+ extern const f_string_static_t fss_basic_list_write_short_object_s;
+ extern const f_string_static_t fss_basic_list_write_short_partial_s;
+ extern const f_string_static_t fss_basic_list_write_short_prepend_s;
+ extern const f_string_static_t fss_basic_list_write_short_single_s;
+ extern const f_string_static_t fss_basic_list_write_short_trim_s;
+
+ extern const f_string_static_t fss_basic_list_write_long_file_s;
+ extern const f_string_static_t fss_basic_list_write_long_content_s;
+ extern const f_string_static_t fss_basic_list_write_long_double_s;
+ extern const f_string_static_t fss_basic_list_write_long_ignore_s;
+ extern const f_string_static_t fss_basic_list_write_long_object_s;
+ extern const f_string_static_t fss_basic_list_write_long_partial_s;
+ extern const f_string_static_t fss_basic_list_write_long_prepend_s;
+ extern const f_string_static_t fss_basic_list_write_long_single_s;
+ extern const f_string_static_t fss_basic_list_write_long_trim_s;
enum {
fss_basic_list_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_file_s.string, fss_basic_list_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s.string, fss_basic_list_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s.string, fss_basic_list_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s.string, fss_basic_list_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s.string, fss_basic_list_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s.string, fss_basic_list_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s.string, fss_basic_list_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s.string, fss_basic_list_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s.string, fss_basic_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_basic_list_write_total_parameters_d 18
-#endif // _di_fss_basic_list_write_defines_
-
-#ifndef _di_fss_basic_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_string_static_t prepend;
-
- f_color_context_t context;
- } fss_basic_list_write_main_t;
-
- #define fss_basic_list_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_list_write_main_t_
+#endif // _di_fss_basic_list_write_parameters_
/**
* Deallocate main.
* @see fss_basic_list_write_main()
*/
#ifndef _di_fss_basic_list_write_main_delete_
- extern f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main);
+ extern f_status_t fss_basic_list_write_main_delete(fll_program_data_t * const main);
#endif // _di_fss_basic_list_write_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_basic_list_write_program_version_
- const f_string_static_t fss_basic_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_version_s, 0, FSS_BASIC_LIST_WRITE_program_version_s_length);
-#endif // _di_fss_basic_list_write_program_version_
-
-#ifndef _di_fss_basic_list_write_program_name_
- const f_string_static_t fss_basic_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_name_s, 0, FSS_BASIC_LIST_WRITE_program_name_s_length);
- const f_string_static_t fss_basic_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_program_name_long_s, 0, FSS_BASIC_LIST_WRITE_program_name_long_s_length);
-#endif // _di_fss_basic_list_write_program_name_
-
#ifndef _di_fss_basic_list_write_print_help_
f_status_t fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) {
#endif // _di_fss_basic_list_write_print_help_
#ifndef _di_fss_basic_list_write_main_
- f_status_t fss_basic_list_write_main(fss_basic_list_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_basic_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_basic_list_write_parameter_no_color_e, fss_basic_list_write_parameter_light_e, fss_basic_list_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
* @see fss_basic_list_write_main_delete()
*/
#ifndef _di_fss_basic_list_write_main_
- extern f_status_t fss_basic_list_write_main(fss_basic_list_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_basic_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_list_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_basic_list_write_main_t data = fss_basic_list_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_basic_list_write_print_signal_received_
- void fss_basic_list_write_print_signal_received(fss_basic_list_write_main_t * const main, const f_status_t signal) {
+ void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_basic_list_write_print_signal_received_
#ifndef _di_fss_basic_list_write_signal_received_
- f_status_t fss_basic_list_write_signal_received(fss_basic_list_write_main_t * const main) {
+ f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_basic_list_write_print_signal_received_
- extern void fss_basic_list_write_print_signal_received(fss_basic_list_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_basic_list_write_signal_received_
- extern f_status_t fss_basic_list_write_signal_received(fss_basic_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_basic_list_write_error_parameter_same_times_print_
- void fss_basic_list_write_error_parameter_same_times_print(fss_basic_list_write_main_t * const main) {
+ void fss_basic_list_write_error_parameter_same_times_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_list_write_error_parameter_same_times_print_
#ifndef _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
- void fss_basic_list_write_error_parameter_unsupported_eol_print(fss_basic_list_write_main_t * const main) {
+ void fss_basic_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_basic_list_write_error_parameter_value_missing_print_
- void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
+ void fss_basic_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_list_write_error_parameter_value_missing_print_
#ifndef _di_fss_basic_list_write_process_
- f_status_t fss_basic_list_write_process(fss_basic_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
+ f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_basic_list_write_process_
#ifndef _di_fss_basic_list_write_process_pipe_
- f_status_t fss_basic_list_write_process_pipe(fss_basic_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
+ f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
* The main program data.
*/
#ifndef _di_fss_basic_list_write_error_parameter_same_times_print_
- void fss_basic_list_write_error_parameter_same_times_print(fss_basic_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_basic_list_write_error_parameter_same_times_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_error_parameter_same_times_print_
/**
* The main program data.
*/
#ifndef _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
- void fss_basic_list_write_error_parameter_unsupported_eol_print(fss_basic_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_basic_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_
/**
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_basic_list_write_error_parameter_value_missing_print_
- void fss_basic_list_write_error_parameter_value_missing_print(fss_basic_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ void fss_basic_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_error_parameter_value_missing_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_basic_list_write_process_
- extern f_status_t fss_basic_list_write_process(fss_basic_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_basic_list_write_process_pipe_
- extern f_status_t fss_basic_list_write_process_pipe(fss_basic_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_process_pipe_
#ifdef __cplusplus
const f_string_static_t fss_basic_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_name_long_s, 0, FSS_BASIC_READ_program_name_long_s_length);
#endif // _di_fss_basic_read_program_name_
-#ifndef _di_fss_basic_read_main_delete_
- f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_basic_read_defines_
+ const f_string_static_t fss_basic_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_end_s, 0, FSS_BASIC_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_basic_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_ignore_s, 0, FSS_BASIC_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_basic_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_content_start_s, 0, FSS_BASIC_READ_pipe_content_start_s_length);
+#endif // _di_fss_basic_read_defines_
+
+#ifndef _di_fss_basic_read_parameters_
+ const f_string_static_t fss_basic_read_short_at_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_at_s, 0, FSS_BASIC_READ_short_at_s_length);
+ const f_string_static_t fss_basic_read_short_content_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_content_s, 0, FSS_BASIC_READ_short_content_s_length);
+ const f_string_static_t fss_basic_read_short_columns_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_columns_s, 0, FSS_BASIC_READ_short_columns_s_length);
+ const f_string_static_t fss_basic_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_delimit_s, 0, FSS_BASIC_READ_short_delimit_s_length);
+ const f_string_static_t fss_basic_read_short_depth_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_depth_s, 0, FSS_BASIC_READ_short_depth_s_length);
+ const f_string_static_t fss_basic_read_short_empty_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_empty_s, 0, FSS_BASIC_READ_short_empty_s_length);
+ const f_string_static_t fss_basic_read_short_line_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_line_s, 0, FSS_BASIC_READ_short_line_s_length);
+ const f_string_static_t fss_basic_read_short_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_name_s, 0, FSS_BASIC_READ_short_name_s_length);
+ const f_string_static_t fss_basic_read_short_object_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_object_s, 0, FSS_BASIC_READ_short_object_s_length);
+ const f_string_static_t fss_basic_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_pipe_s, 0, FSS_BASIC_READ_short_pipe_s_length);
+ const f_string_static_t fss_basic_read_short_raw_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_raw_s, 0, FSS_BASIC_READ_short_raw_s_length);
+ const f_string_static_t fss_basic_read_short_select_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_select_s, 0, FSS_BASIC_READ_short_select_s_length);
+ const f_string_static_t fss_basic_read_short_total_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_total_s, 0, FSS_BASIC_READ_short_total_s_length);
+ const f_string_static_t fss_basic_read_short_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_short_trim_s, 0, FSS_BASIC_READ_short_trim_s_length);
+
+ const f_string_static_t fss_basic_read_long_at_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_at_s, 0, FSS_BASIC_READ_long_at_s_length);
+ const f_string_static_t fss_basic_read_long_content_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_content_s, 0, FSS_BASIC_READ_long_content_s_length);
+ const f_string_static_t fss_basic_read_long_columns_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_columns_s, 0, FSS_BASIC_READ_long_columns_s_length);
+ const f_string_static_t fss_basic_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_delimit_s, 0, FSS_BASIC_READ_long_delimit_s_length);
+ const f_string_static_t fss_basic_read_long_depth_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_depth_s, 0, FSS_BASIC_READ_long_depth_s_length);
+ const f_string_static_t fss_basic_read_long_empty_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_empty_s, 0, FSS_BASIC_READ_long_empty_s_length);
+ const f_string_static_t fss_basic_read_long_line_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_line_s, 0, FSS_BASIC_READ_long_line_s_length);
+ const f_string_static_t fss_basic_read_long_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_name_s, 0, FSS_BASIC_READ_long_name_s_length);
+ const f_string_static_t fss_basic_read_long_object_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_object_s, 0, FSS_BASIC_READ_long_object_s_length);
+ const f_string_static_t fss_basic_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_pipe_s, 0, FSS_BASIC_READ_long_pipe_s_length);
+ const f_string_static_t fss_basic_read_long_raw_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_raw_s, 0, FSS_BASIC_READ_long_raw_s_length);
+ const f_string_static_t fss_basic_read_long_select_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_select_s, 0, FSS_BASIC_READ_long_select_s_length);
+ const f_string_static_t fss_basic_read_long_total_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_total_s, 0, FSS_BASIC_READ_long_total_s_length);
+ const f_string_static_t fss_basic_read_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_long_trim_s, 0, FSS_BASIC_READ_long_trim_s_length);
+#endif // _di_fss_basic_read_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_basic_read_main_delete_
+ f_status_t fss_basic_read_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_basic_read_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_basic_read_program_version_
#define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s
#define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_basic_read_program_version_s;
#endif // _di_fss_basic_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_basic_read_program_name_
#define FSS_BASIC_READ_program_name_s "fss_basic_read"
#define FSS_BASIC_READ_program_name_long_s "FSS Basic Read"
extern const f_string_static_t fss_basic_read_program_name_long_s;
#endif // _di_fss_basic_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_basic_read_defines_
#define fss_basic_read_signal_check_d 10000
- #define fss_basic_read_pipe_content_end_s '\f'
- #define fss_basic_read_pipe_content_ignore_s '\v'
- #define fss_basic_read_pipe_content_start_s '\b'
-
- #define fss_basic_read_short_at_s "a"
- #define fss_basic_read_short_content_s "c"
- #define fss_basic_read_short_columns_s "C"
- #define fss_basic_read_short_delimit_s "D"
- #define fss_basic_read_short_depth_s "d"
- #define fss_basic_read_short_empty_s "e"
- #define fss_basic_read_short_line_s "l"
- #define fss_basic_read_short_name_s "n"
- #define fss_basic_read_short_object_s "o"
- #define fss_basic_read_short_pipe_s "p"
- #define fss_basic_read_short_raw_s "R"
- #define fss_basic_read_short_select_s "s"
- #define fss_basic_read_short_total_s "t"
- #define fss_basic_read_short_trim_s "T"
-
- #define fss_basic_read_long_at_s "at"
- #define fss_basic_read_long_content_s "content"
- #define fss_basic_read_long_columns_s "columns"
- #define fss_basic_read_long_delimit_s "delimit"
- #define fss_basic_read_long_depth_s "depth"
- #define fss_basic_read_long_empty_s "empty"
- #define fss_basic_read_long_line_s "line"
- #define fss_basic_read_long_name_s "name"
- #define fss_basic_read_long_object_s "object"
- #define fss_basic_read_long_pipe_s "pipe"
- #define fss_basic_read_long_raw_s "raw"
- #define fss_basic_read_long_select_s "select"
- #define fss_basic_read_long_total_s "total"
- #define fss_basic_read_long_trim_s "trim"
+ #define FSS_BASIC_READ_pipe_content_end_s "\f"
+ #define FSS_BASIC_READ_pipe_content_ignore_s "\v"
+ #define FSS_BASIC_READ_pipe_content_start_s "\b"
+
+ #define FSS_BASIC_READ_pipe_content_end_s_length 1
+ #define FSS_BASIC_READ_pipe_content_ignore_s_length 1
+ #define FSS_BASIC_READ_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_basic_read_pipe_content_end_s;
+ extern const f_string_static_t fss_basic_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_basic_read_pipe_content_start_s;
+#endif // _di_fss_basic_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_basic_read_parameters_
+ #define FSS_BASIC_READ_short_at_s "a"
+ #define FSS_BASIC_READ_short_content_s "c"
+ #define FSS_BASIC_READ_short_columns_s "C"
+ #define FSS_BASIC_READ_short_delimit_s "D"
+ #define FSS_BASIC_READ_short_depth_s "d"
+ #define FSS_BASIC_READ_short_empty_s "e"
+ #define FSS_BASIC_READ_short_line_s "l"
+ #define FSS_BASIC_READ_short_name_s "n"
+ #define FSS_BASIC_READ_short_object_s "o"
+ #define FSS_BASIC_READ_short_pipe_s "p"
+ #define FSS_BASIC_READ_short_raw_s "R"
+ #define FSS_BASIC_READ_short_select_s "s"
+ #define FSS_BASIC_READ_short_total_s "t"
+ #define FSS_BASIC_READ_short_trim_s "T"
+
+ #define FSS_BASIC_READ_long_at_s "at"
+ #define FSS_BASIC_READ_long_content_s "content"
+ #define FSS_BASIC_READ_long_columns_s "columns"
+ #define FSS_BASIC_READ_long_delimit_s "delimit"
+ #define FSS_BASIC_READ_long_depth_s "depth"
+ #define FSS_BASIC_READ_long_empty_s "empty"
+ #define FSS_BASIC_READ_long_line_s "line"
+ #define FSS_BASIC_READ_long_name_s "name"
+ #define FSS_BASIC_READ_long_object_s "object"
+ #define FSS_BASIC_READ_long_pipe_s "pipe"
+ #define FSS_BASIC_READ_long_raw_s "raw"
+ #define FSS_BASIC_READ_long_select_s "select"
+ #define FSS_BASIC_READ_long_total_s "total"
+ #define FSS_BASIC_READ_long_trim_s "trim"
+
+ #define FSS_BASIC_READ_short_at_s_length 1
+ #define FSS_BASIC_READ_short_content_s_length 1
+ #define FSS_BASIC_READ_short_columns_s_length 1
+ #define FSS_BASIC_READ_short_delimit_s_length 1
+ #define FSS_BASIC_READ_short_depth_s_length 1
+ #define FSS_BASIC_READ_short_empty_s_length 1
+ #define FSS_BASIC_READ_short_line_s_length 1
+ #define FSS_BASIC_READ_short_name_s_length 1
+ #define FSS_BASIC_READ_short_object_s_length 1
+ #define FSS_BASIC_READ_short_pipe_s_length 1
+ #define FSS_BASIC_READ_short_raw_s_length 1
+ #define FSS_BASIC_READ_short_select_s_length 1
+ #define FSS_BASIC_READ_short_total_s_length 1
+ #define FSS_BASIC_READ_short_trim_s_length 1
+
+ #define FSS_BASIC_READ_long_at_s_length 2
+ #define FSS_BASIC_READ_long_content_s_length 7
+ #define FSS_BASIC_READ_long_columns_s_length 7
+ #define FSS_BASIC_READ_long_delimit_s_length 7
+ #define FSS_BASIC_READ_long_depth_s_length 5
+ #define FSS_BASIC_READ_long_empty_s_length 5
+ #define FSS_BASIC_READ_long_line_s_length 4
+ #define FSS_BASIC_READ_long_name_s_length 4
+ #define FSS_BASIC_READ_long_object_s_length 6
+ #define FSS_BASIC_READ_long_pipe_s_length 4
+ #define FSS_BASIC_READ_long_raw_s_length 3
+ #define FSS_BASIC_READ_long_select_s_length 6
+ #define FSS_BASIC_READ_long_total_s_length 5
+ #define FSS_BASIC_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_basic_read_short_at_s;
+ extern const f_string_static_t fss_basic_read_short_content_s;
+ extern const f_string_static_t fss_basic_read_short_columns_s;
+ extern const f_string_static_t fss_basic_read_short_delimit_s;
+ extern const f_string_static_t fss_basic_read_short_depth_s;
+ extern const f_string_static_t fss_basic_read_short_empty_s;
+ extern const f_string_static_t fss_basic_read_short_line_s;
+ extern const f_string_static_t fss_basic_read_short_name_s;
+ extern const f_string_static_t fss_basic_read_short_object_s;
+ extern const f_string_static_t fss_basic_read_short_pipe_s;
+ extern const f_string_static_t fss_basic_read_short_raw_s;
+ extern const f_string_static_t fss_basic_read_short_select_s;
+ extern const f_string_static_t fss_basic_read_short_total_s;
+ extern const f_string_static_t fss_basic_read_short_trim_s;
+
+ extern const f_string_static_t fss_basic_read_long_at_s;
+ extern const f_string_static_t fss_basic_read_long_content_s;
+ extern const f_string_static_t fss_basic_read_long_columns_s;
+ extern const f_string_static_t fss_basic_read_long_delimit_s;
+ extern const f_string_static_t fss_basic_read_long_depth_s;
+ extern const f_string_static_t fss_basic_read_long_empty_s;
+ extern const f_string_static_t fss_basic_read_long_line_s;
+ extern const f_string_static_t fss_basic_read_long_name_s;
+ extern const f_string_static_t fss_basic_read_long_object_s;
+ extern const f_string_static_t fss_basic_read_long_pipe_s;
+ extern const f_string_static_t fss_basic_read_long_raw_s;
+ extern const f_string_static_t fss_basic_read_long_select_s;
+ extern const f_string_static_t fss_basic_read_long_total_s;
+ extern const f_string_static_t fss_basic_read_long_trim_s;
enum {
fss_basic_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s, fss_basic_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s, fss_basic_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s, fss_basic_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s, fss_basic_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s, fss_basic_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_at_s.string, fss_basic_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s.string, fss_basic_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s.string, fss_basic_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s.string, fss_basic_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s.string, fss_basic_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s.string, fss_basic_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s.string, fss_basic_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s.string, fss_basic_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s.string, fss_basic_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s.string, fss_basic_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s.string, fss_basic_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s.string, fss_basic_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s.string, fss_basic_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s.string, fss_basic_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_basic_read_total_parameters_d 23
-#endif // _di_fss_basic_read_defines_
+#endif // _di_fss_basic_read_parameters_
/**
* FSS Delimit Parameter data.
};
#endif // _di_fss_basic_read_delimit_modes_
-#ifndef _di_fss_basic_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_basic_read_main_t;
-
- #define fss_basic_read_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_read_main_t_
-
/**
* Deallocate main.
*
* @see fss_basic_read_main()
*/
#ifndef _di_fss_basic_read_main_delete_
- extern f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main);
+ extern f_status_t fss_basic_read_main_delete(fll_program_data_t * const main);
#endif // _di_fss_basic_read_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_basic_read_program_version_
- const f_string_static_t fss_basic_read_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_version_s, 0, FSS_BASIC_READ_program_version_s_length);
-#endif // _di_fss_basic_read_program_version_
-
-#ifndef _di_fss_basic_read_program_name_
- const f_string_static_t fss_basic_read_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_name_s, 0, FSS_BASIC_READ_program_name_s_length);
- const f_string_static_t fss_basic_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_program_name_long_s, 0, FSS_BASIC_READ_program_name_long_s_length);
-#endif // _di_fss_basic_read_program_name_
-
#ifndef _di_fss_basic_read_print_help_
f_status_t fss_basic_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_basic_read_short_total_s, fss_basic_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_basic_read_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_basic_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
#endif // _di_fss_basic_read_print_help_
#ifndef _di_fss_basic_read_main_
- f_status_t fss_basic_read_main(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_basic_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_basic_read_parameter_no_color_e, fss_basic_read_parameter_light_e, fss_basic_read_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
- fss_basic_read_file_t files_array[main->remaining.used + 1];
+ fss_basic_read_file_t files_array[main->parameters.remaining.used + 1];
fss_basic_read_data_t data = fss_basic_read_data_t_initialize;
data.files.array = files_array;
data.files.used = 1;
- data.files.size = main->remaining.used + 1;
+ data.files.size = main->parameters.remaining.used + 1;
data.files.array[0].name = "(pipe)";
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
{
const f_array_length_t parameter_code[] = {
fss_basic_read_parameter_at_e,
}
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (fss_basic_read_signal_received(main)) {
status = F_status_set_error(F_signal);
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->remaining.array[i]];
+ data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
*
* This is the FSS Basic Read program
* This program utilizes the Featureless Linux Library.
- * This program processes files or other input in fss format and stores the results in the fss_basic_read_main_t.
+ * This program processes files or other input in fss format and stores the results in the fll_program_data_t.
*
* This processes in accordance to the FSS-0000 Basic specification.
*/
* @see fss_basic_read_main_delete()
*/
#ifndef _di_fss_basic_read_main_
- extern f_status_t fss_basic_read_main(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_basic_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_read_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fss_basic_read_main_t data = fss_basic_read_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_basic_read_depths_resize_
#ifndef _di_fss_basic_read_print_signal_received_
- void fss_basic_read_print_signal_received(fss_basic_read_main_t * const main, const f_status_t signal) {
+ void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_basic_read_print_signal_received_
#ifndef _di_fss_basic_read_signal_received_
- f_status_t fss_basic_read_signal_received(fss_basic_read_main_t * const main) {
+ f_status_t fss_basic_read_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_basic_read_print_signal_received_
- extern void fss_basic_read_print_signal_received(fss_basic_read_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_basic_read_signal_received_
- extern f_status_t fss_basic_read_signal_received(fss_basic_read_main_t * const main);
+ extern f_status_t fss_basic_read_signal_received(fll_program_data_t * const main);
#endif // _di_fss_basic_read_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_basic_read_print_at_
- void fss_basic_read_print_at(fss_basic_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_read_data_t * const data) {
+ void fss_basic_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_read_data_t * const data) {
if (at >= data->contents.used) {
return;
#endif // _di_fss_basic_read_print_at_
#ifndef _di_fss_basic_read_print_object_end_
- void fss_basic_read_print_object_end(fss_basic_read_main_t * const main) {
+ void fss_basic_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_basic_read_pipe_content_start_s, main->output.to.stream);
#endif // _di_fss_basic_read_print_object_end_
#ifndef _di_fss_basic_read_print_one_
- void fss_basic_read_print_one(fss_basic_read_main_t * const main) {
+ void fss_basic_read_print_one(fll_program_data_t * const main) {
f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#endif // _di_fss_basic_read_print_one_
#ifndef _di_fss_basic_read_print_set_end_
- void fss_basic_read_print_set_end(fss_basic_read_main_t * const main) {
+ void fss_basic_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_basic_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_basic_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_basic_read_print_set_end_
#ifndef _di_fss_basic_read_print_zero_
- void fss_basic_read_print_zero(fss_basic_read_main_t * const main) {
+ void fss_basic_read_print_zero(fll_program_data_t * const main) {
f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
* The program data.
*/
#ifndef _di_fss_basic_read_print_at_
- extern void fss_basic_read_print_at(fss_basic_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_basic_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_at_
/**
* The main program data.
*/
#ifndef _di_fss_basic_read_print_object_end_
- extern void fss_basic_read_print_object_end(fss_basic_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_object_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_object_end_
/**
* The main program data.
*/
#ifndef _di_fss_basic_read_print_one_
- extern void fss_basic_read_print_one(fss_basic_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_one(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_one_
/**
* The main program data.
*/
#ifndef _di_fss_basic_read_print_set_end_
- extern void fss_basic_read_print_set_end(fss_basic_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_set_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_set_end_
/**
* The main program data.
*/
#ifndef _di_fss_basic_read_print_zero_
- extern void fss_basic_read_print_zero(fss_basic_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_zero(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_zero_
#ifdef __cplusplus
#endif // _di_fss_basic_read_delimit_object_is_
#ifndef _di_fss_basic_read_depth_process_
- f_status_t fss_basic_read_depth_process(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_basic_read_file_identify_
#ifndef _di_fss_basic_read_load_
- f_status_t fss_basic_read_load(fss_basic_read_main_t * const main, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) {
f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_delimit_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#endif // _di_fss_basic_read_load_
#ifndef _di_fss_basic_read_load_number_
- f_status_t fss_basic_read_load_number(fss_basic_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
#endif // _di_fss_basic_read_load_number_
#ifndef _di_fss_basic_read_process_
- f_status_t fss_basic_read_process(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
f_status_t status = fss_basic_read_process_option(main, arguments, data);
if (F_status_is_error(status)) return status;
#endif // _di_fss_basic_read_process_
#ifndef _di_fss_basic_read_process_at_
- f_status_t fss_basic_read_process_at(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_basic_read_data_option_columns_d | fss_basic_read_data_option_total_d)) {
#endif // _di_fss_basic_read_process_at_
#ifndef _di_fss_basic_read_process_columns_
- f_status_t fss_basic_read_process_columns(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
if (!(data->option & fss_basic_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_basic_read_process_columns_
#ifndef _di_fss_basic_read_process_line_
- f_status_t fss_basic_read_process_line(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits = fss_basic_read_delimit_object_is(0, data) ? &data->delimits : &except_none;
#endif // _di_fss_basic_read_process_name_
#ifndef _di_fss_basic_read_process_option_
- f_status_t fss_basic_read_process_option(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
+ f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_basic_read_process_option_
#ifndef _di_fss_basic_read_process_total_
- f_status_t fss_basic_read_process_total(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) {
+ f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
* @see fss_basic_read_depths_resize()
*/
#ifndef _di_fss_basic_read_depth_process_
- extern f_status_t fss_basic_read_depth_process(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_depth_process_
/**
* @see fss_basic_read_process_option()
*/
#ifndef _di_fss_basic_read_load_
- extern f_status_t fss_basic_read_load(fss_basic_read_main_t * const main, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_load_
/**
* @see fss_basic_read_depths_resize()
*/
#ifndef _di_fss_basic_read_load_number_
- extern f_status_t fss_basic_read_load_number(fss_basic_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_load_number_
/**
* @see fss_basic_read_process_option()
*/
#ifndef _di_fss_basic_read_process_
- extern f_status_t fss_basic_read_process(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_at_
- extern f_status_t fss_basic_read_process_at(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_at(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_at_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_columns_
- extern f_status_t fss_basic_read_process_columns(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_columns(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_line_
- extern f_status_t fss_basic_read_process_line(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_line(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_line_
/**
* @see fss_basic_read_load_setting()
*/
#ifndef _di_fss_basic_read_process_option_
- extern f_status_t fss_basic_read_process_option(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_basic_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_basic_read_process_total_
- extern f_status_t fss_basic_read_process_total(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_read_process_total(fll_program_data_t * const main, fss_basic_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_process_total_
#ifdef __cplusplus
const f_string_static_t fss_basic_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_name_long_s, 0, FSS_BASIC_WRITE_program_name_long_s_length);
#endif // _di_fss_basic_write_program_name_
-#ifndef _di_fss_basic_write_main_delete_
- f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_basic_write_defines_
+ const f_string_static_t fss_basic_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_end_s, 0, FSS_BASIC_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_basic_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_ignore_s, 0, FSS_BASIC_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_basic_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_content_start_s, 0, FSS_BASIC_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_basic_write_defines.
+
+#ifndef _di_fss_basic_write_program_parameters_
+ const f_string_static_t fss_basic_write_short_file_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_file_s, 0, FSS_BASIC_WRITE_short_file_s_length);
+ const f_string_static_t fss_basic_write_short_content_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_content_s, 0, FSS_BASIC_WRITE_short_content_s_length);
+ const f_string_static_t fss_basic_write_short_double_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_double_s, 0, FSS_BASIC_WRITE_short_double_s_length);
+ const f_string_static_t fss_basic_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_ignore_s, 0, FSS_BASIC_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_basic_write_short_object_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_object_s, 0, FSS_BASIC_WRITE_short_object_s_length);
+ const f_string_static_t fss_basic_write_short_partial_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_partial_s, 0, FSS_BASIC_WRITE_short_partial_s_length);
+ const f_string_static_t fss_basic_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_prepend_s, 0, FSS_BASIC_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_basic_write_short_single_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_single_s, 0, FSS_BASIC_WRITE_short_single_s_length);
+ const f_string_static_t fss_basic_write_short_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_short_trim_s, 0, FSS_BASIC_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_basic_write_long_file_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_file_s, 0, FSS_BASIC_WRITE_long_file_s_length);
+ const f_string_static_t fss_basic_write_long_content_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_content_s, 0, FSS_BASIC_WRITE_long_content_s_length);
+ const f_string_static_t fss_basic_write_long_double_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_double_s, 0, FSS_BASIC_WRITE_long_double_s_length);
+ const f_string_static_t fss_basic_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_ignore_s, 0, FSS_BASIC_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_basic_write_long_object_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_object_s, 0, FSS_BASIC_WRITE_long_object_s_length);
+ const f_string_static_t fss_basic_write_long_partial_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_partial_s, 0, FSS_BASIC_WRITE_long_partial_s_length);
+ const f_string_static_t fss_basic_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_prepend_s, 0, FSS_BASIC_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_basic_write_long_single_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_single_s, 0, FSS_BASIC_WRITE_long_single_s_length);
+ const f_string_static_t fss_basic_write_long_trim_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_long_trim_s, 0, FSS_BASIC_WRITE_long_trim_s_length);
+#endif // _di_fss_basic_write_program_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_basic_write_main_delete_
+ f_status_t fss_basic_write_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_basic_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_basic_write_program_version_
#define FSS_BASIC_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_BASIC_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_basic_write_program_version_s;
#endif // _di_fss_basic_write_program_version_
+/**
+ * The main program name.
+ */
#ifndef _di_fss_basic_write_program_name_
#define FSS_BASIC_WRITE_program_name_s "fss_basic_write"
#define FSS_BASIC_WRITE_program_name_long_s "FSS Basic Write"
extern const f_string_static_t fss_basic_write_program_name_long_s;
#endif // _di_fss_basic_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_basic_write_defines_
#define fss_basic_write_signal_check_d 10000
- #define fss_basic_write_pipe_content_end_s '\f'
- #define fss_basic_write_pipe_content_ignore_s '\v'
- #define fss_basic_write_pipe_content_start_s '\b'
-
- #define fss_basic_write_short_file_s "f"
- #define fss_basic_write_short_content_s "c"
- #define fss_basic_write_short_double_s "d"
- #define fss_basic_write_short_ignore_s "I"
- #define fss_basic_write_short_object_s "o"
- #define fss_basic_write_short_partial_s "p"
- #define fss_basic_write_short_prepend_s "P"
- #define fss_basic_write_short_single_s "s"
- #define fss_basic_write_short_trim_s "T"
-
- #define fss_basic_write_long_file_s "file"
- #define fss_basic_write_long_content_s "content"
- #define fss_basic_write_long_double_s "double"
- #define fss_basic_write_long_ignore_s "ignore"
- #define fss_basic_write_long_object_s "object"
- #define fss_basic_write_long_partial_s "partial"
- #define fss_basic_write_long_prepend_s "prepend"
- #define fss_basic_write_long_single_s "single"
- #define fss_basic_write_long_trim_s "trim"
+ #define FSS_BASIC_WRITE_pipe_content_end_s "\f"
+ #define FSS_BASIC_WRITE_pipe_content_ignore_s "\v"
+ #define FSS_BASIC_WRITE_pipe_content_start_s "\b"
+
+ #define FSS_BASIC_WRITE_pipe_content_end_s_length 1
+ #define FSS_BASIC_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_BASIC_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_basic_write_pipe_content_end_s;
+ extern const f_string_static_t fss_basic_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_basic_write_pipe_content_start_s;
+#endif // _di_fss_basic_write_defines.
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_basic_write_parameters_
+ #define FSS_BASIC_WRITE_short_file_s "f"
+ #define FSS_BASIC_WRITE_short_content_s "c"
+ #define FSS_BASIC_WRITE_short_double_s "d"
+ #define FSS_BASIC_WRITE_short_ignore_s "I"
+ #define FSS_BASIC_WRITE_short_object_s "o"
+ #define FSS_BASIC_WRITE_short_partial_s "p"
+ #define FSS_BASIC_WRITE_short_prepend_s "P"
+ #define FSS_BASIC_WRITE_short_single_s "s"
+ #define FSS_BASIC_WRITE_short_trim_s "T"
+
+ #define FSS_BASIC_WRITE_long_file_s "file"
+ #define FSS_BASIC_WRITE_long_content_s "content"
+ #define FSS_BASIC_WRITE_long_double_s "double"
+ #define FSS_BASIC_WRITE_long_ignore_s "ignore"
+ #define FSS_BASIC_WRITE_long_object_s "object"
+ #define FSS_BASIC_WRITE_long_partial_s "partial"
+ #define FSS_BASIC_WRITE_long_prepend_s "prepend"
+ #define FSS_BASIC_WRITE_long_single_s "single"
+ #define FSS_BASIC_WRITE_long_trim_s "trim"
+
+ #define FSS_BASIC_WRITE_short_file_s_length 1
+ #define FSS_BASIC_WRITE_short_content_s_length 1
+ #define FSS_BASIC_WRITE_short_double_s_length 1
+ #define FSS_BASIC_WRITE_short_ignore_s_length 1
+ #define FSS_BASIC_WRITE_short_object_s_length 1
+ #define FSS_BASIC_WRITE_short_partial_s_length 1
+ #define FSS_BASIC_WRITE_short_prepend_s_length 1
+ #define FSS_BASIC_WRITE_short_single_s_length 1
+ #define FSS_BASIC_WRITE_short_trim_s_length 1
+
+ #define FSS_BASIC_WRITE_long_file_s_length 4
+ #define FSS_BASIC_WRITE_long_content_s_length 7
+ #define FSS_BASIC_WRITE_long_double_s_length 6
+ #define FSS_BASIC_WRITE_long_ignore_s_length 6
+ #define FSS_BASIC_WRITE_long_object_s_length 6
+ #define FSS_BASIC_WRITE_long_partial_s_length 7
+ #define FSS_BASIC_WRITE_long_prepend_s_length 7
+ #define FSS_BASIC_WRITE_long_single_s_length 6
+ #define FSS_BASIC_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_basic_write_short_file_s;
+ extern const f_string_static_t fss_basic_write_short_content_s;
+ extern const f_string_static_t fss_basic_write_short_double_s;
+ extern const f_string_static_t fss_basic_write_short_ignore_s;
+ extern const f_string_static_t fss_basic_write_short_object_s;
+ extern const f_string_static_t fss_basic_write_short_partial_s;
+ extern const f_string_static_t fss_basic_write_short_prepend_s;
+ extern const f_string_static_t fss_basic_write_short_single_s;
+ extern const f_string_static_t fss_basic_write_short_trim_s;
+
+ extern const f_string_static_t fss_basic_write_long_file_s;
+ extern const f_string_static_t fss_basic_write_long_content_s;
+ extern const f_string_static_t fss_basic_write_long_double_s;
+ extern const f_string_static_t fss_basic_write_long_ignore_s;
+ extern const f_string_static_t fss_basic_write_long_object_s;
+ extern const f_string_static_t fss_basic_write_long_partial_s;
+ extern const f_string_static_t fss_basic_write_long_prepend_s;
+ extern const f_string_static_t fss_basic_write_long_single_s;
+ extern const f_string_static_t fss_basic_write_long_trim_s;
enum {
fss_basic_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_file_s, fss_basic_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s, fss_basic_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s, fss_basic_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s, fss_basic_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s, fss_basic_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_file_s.string, fss_basic_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s.string, fss_basic_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s.string, fss_basic_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s.string, fss_basic_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s.string, fss_basic_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s.string, fss_basic_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s.string, fss_basic_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s.string, fss_basic_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s.string, fss_basic_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_basic_write_total_parameters_d 18
-#endif // _di_fss_basic_write_defines_
-
-#ifndef _di_fss_basic_write_data_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_basic_write_main_t;
-
- #define fss_basic_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_write_data_
+#endif // _di_fss_basic_write_parameters_
/**
* Deallocate main.
* @see fss_basic_write_main()
*/
#ifndef _di_fss_basic_write_main_delete_
- extern f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main);
+ extern f_status_t fss_basic_write_main_delete(fll_program_data_t * const main);
#endif // _di_fss_basic_write_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_byte_dump_program_version_
- const f_string_static_t fss_basic_write_program_version_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_version_s, 0, FSS_BASIC_WRITE_program_version_s_length);
-#endif // _di_byte_dump_program_version_
-
-#ifndef _di_byte_dump_program_name_
- const f_string_static_t fss_basic_write_program_name_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_name_s, 0, FSS_BASIC_WRITE_program_name_s_length);
- const f_string_static_t fss_basic_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_program_name_long_s, 0, FSS_BASIC_WRITE_program_name_long_s_length);
-#endif // _di_byte_dump_program_name_
-
#ifndef _di_fss_basic_write_print_help_
f_status_t fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) {
#endif // _di_fss_basic_write_print_help_
#ifndef _di_fss_basic_write_main_
- f_status_t fss_basic_write_main(fss_basic_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_basic_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_basic_write_parameter_no_color_e, fss_basic_write_parameter_light_e, fss_basic_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
* @see fss_basic_write_main_delete()
*/
#ifndef _di_fss_basic_write_main_
- extern f_status_t fss_basic_write_main(fss_basic_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_basic_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_basic_write_main_t data = fss_basic_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_basic_write_print_signal_received_
- void fss_basic_write_print_signal_received(fss_basic_write_main_t * const main, const f_status_t signal) {
+ void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_basic_write_print_signal_received_
#ifndef _di_fss_basic_write_signal_received_
- f_status_t fss_basic_write_signal_received(fss_basic_write_main_t * const main) {
+ f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_basic_write_print_signal_received_
- extern void fss_basic_write_print_signal_received(fss_basic_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_basic_write_signal_received_
- extern f_status_t fss_basic_write_signal_received(fss_basic_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_basic_write_error_parameter_same_times_print_
- void fss_basic_write_error_parameter_same_times_print(fss_basic_write_main_t * const main) {
+ void fss_basic_write_error_parameter_same_times_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_write_error_parameter_same_times_print_
#ifndef _di_fss_basic_write_error_parameter_value_missing_print_
- void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
+ void fss_basic_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_write_error_parameter_value_missing_print_
#ifndef _di_fss_basic_write_error_parameter_unsupported_eol_print_
- void fss_basic_write_error_parameter_unsupported_eol_print(fss_basic_write_main_t * const main) {
+ void fss_basic_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_basic_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_basic_write_process_
- f_status_t fss_basic_write_process(fss_basic_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
+ f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_basic_write_process_
#ifndef _di_fss_basic_write_process_pipe_
- f_status_t fss_basic_write_process_pipe(fss_basic_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
+ f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
* The main program data.
*/
#ifndef _di_fss_basic_write_error_parameter_same_times_print_
- void fss_basic_write_error_parameter_same_times_print(fss_basic_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_basic_write_error_parameter_same_times_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_error_parameter_same_times_print_
/**
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_basic_write_error_parameter_value_missing_print_
- void fss_basic_write_error_parameter_value_missing_print(fss_basic_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ void fss_basic_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_error_parameter_value_missing_print_
/**
* The main program data.
*/
#ifndef _di_fss_basic_write_error_parameter_unsupported_eol_print_
- void fss_basic_write_error_parameter_unsupported_eol_print(fss_basic_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_basic_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_error_parameter_unsupported_eol_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_basic_write_process_
- extern f_status_t fss_basic_write_process(fss_basic_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_basic_write_process_pipe_
- extern f_status_t fss_basic_write_process_pipe(fss_basic_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_process_pipe_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_basic_write_signal_received_
- extern f_status_t fss_basic_write_signal_received(fss_basic_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_signal_received_
#ifdef __cplusplus
const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length);
#endif // _di_fss_embedded_list_read_program_name_
+#ifndef _di_fss_embedded_list_read_parameters_
+ const f_string_static_t fss_embedded_list_read_short_at_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_at_s, 0, FSS_EMBEDDED_LIST_READ_short_at_s_length);
+ const f_string_static_t fss_embedded_list_read_short_content_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_content_s, 0, FSS_EMBEDDED_LIST_READ_short_content_s_length);
+ const f_string_static_t fss_embedded_list_read_short_columns_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_columns_s, 0, FSS_EMBEDDED_LIST_READ_short_columns_s_length);
+ const f_string_static_t fss_embedded_list_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_delimit_s, 0, FSS_EMBEDDED_LIST_READ_short_delimit_s_length);
+ const f_string_static_t fss_embedded_list_read_short_depth_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_depth_s, 0, FSS_EMBEDDED_LIST_READ_short_depth_s_length);
+ const f_string_static_t fss_embedded_list_read_short_empty_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_empty_s, 0, FSS_EMBEDDED_LIST_READ_short_empty_s_length);
+ const f_string_static_t fss_embedded_list_read_short_line_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_line_s, 0, FSS_EMBEDDED_LIST_READ_short_line_s_length);
+ const f_string_static_t fss_embedded_list_read_short_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_name_s, 0, FSS_EMBEDDED_LIST_READ_short_name_s_length);
+ const f_string_static_t fss_embedded_list_read_short_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_object_s, 0, FSS_EMBEDDED_LIST_READ_short_object_s_length);
+ const f_string_static_t fss_embedded_list_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_pipe_s, 0, FSS_EMBEDDED_LIST_READ_short_pipe_s_length);
+ const f_string_static_t fss_embedded_list_read_short_raw_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_raw_s, 0, FSS_EMBEDDED_LIST_READ_short_raw_s_length);
+ const f_string_static_t fss_embedded_list_read_short_select_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_select_s, 0, FSS_EMBEDDED_LIST_READ_short_select_s_length);
+ const f_string_static_t fss_embedded_list_read_short_total_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_total_s, 0, FSS_EMBEDDED_LIST_READ_short_total_s_length);
+ const f_string_static_t fss_embedded_list_read_short_trim_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_short_trim_s, 0, FSS_EMBEDDED_LIST_READ_short_trim_s_length);
+
+ const f_string_static_t fss_embedded_list_read_long_at_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_at_s, 0, FSS_EMBEDDED_LIST_READ_long_at_s_length);
+ const f_string_static_t fss_embedded_list_read_long_content_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_content_s, 0, FSS_EMBEDDED_LIST_READ_long_content_s_length);
+ const f_string_static_t fss_embedded_list_read_long_columns_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_columns_s, 0, FSS_EMBEDDED_LIST_READ_long_columns_s_length);
+ const f_string_static_t fss_embedded_list_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_delimit_s, 0, FSS_EMBEDDED_LIST_READ_long_delimit_s_length);
+ const f_string_static_t fss_embedded_list_read_long_depth_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_depth_s, 0, FSS_EMBEDDED_LIST_READ_long_depth_s_length);
+ const f_string_static_t fss_embedded_list_read_long_empty_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_empty_s, 0, FSS_EMBEDDED_LIST_READ_long_empty_s_length);
+ const f_string_static_t fss_embedded_list_read_long_line_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_line_s, 0, FSS_EMBEDDED_LIST_READ_long_line_s_length);
+ const f_string_static_t fss_embedded_list_read_long_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_name_s, 0, FSS_EMBEDDED_LIST_READ_long_name_s_length);
+ const f_string_static_t fss_embedded_list_read_long_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_object_s, 0, FSS_EMBEDDED_LIST_READ_long_object_s_length);
+ const f_string_static_t fss_embedded_list_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_pipe_s, 0, FSS_EMBEDDED_LIST_READ_long_pipe_s_length);
+ const f_string_static_t fss_embedded_list_read_long_raw_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_raw_s, 0, FSS_EMBEDDED_LIST_READ_long_raw_s_length);
+ const f_string_static_t fss_embedded_list_read_long_select_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_select_s, 0, FSS_EMBEDDED_LIST_READ_long_select_s_length);
+ const f_string_static_t fss_embedded_list_read_long_total_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_total_s, 0, FSS_EMBEDDED_LIST_READ_long_total_s_length);
+ const f_string_static_t fss_embedded_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_long_trim_s, 0, FSS_EMBEDDED_LIST_READ_long_trim_s_length);
+#endif // _di_fss_embedded_list_read_parameters_
+
#ifndef _di_fss_embedded_list_read_main_delete_
f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
macro_f_fss_nest_t_delete_simple(main->nest);
f_string_dynamic_resize(0, &main->buffer);
- f_type_array_lengths_resize(0, &main->remaining);
macro_f_color_context_t_delete_simple(main->context);
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_embedded_list_read_program_version_
#define FSS_EMBEDDED_LIST_READ_program_version_major_s F_string_ascii_0_s
#define FSS_EMBEDDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_embedded_list_read_program_version_s;
#endif // _di_fss_embedded_list_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_embedded_list_read_program_name_
#define FSS_EMBEDDED_LIST_READ_program_name_s "fss_embedded_list_read"
#define FSS_EMBEDDED_LIST_READ_program_name_long_s "FSS Embedded List Read"
extern const f_string_static_t fss_embedded_list_read_program_name_long_s;
#endif // _di_fss_embedded_list_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_embedded_list_read_defines_
#define fss_embedded_list_read_signal_check_d 10000
- #define fss_embedded_list_read_pipe_content_end_s '\f'
- #define fss_embedded_list_read_pipe_content_ignore_s '\v'
- #define fss_embedded_list_read_pipe_content_start_s '\b'
-
- #define fss_embedded_list_read_short_at_s "a"
- #define fss_embedded_list_read_short_content_s "c"
- #define fss_embedded_list_read_short_columns_s "C"
- #define fss_embedded_list_read_short_delimit_s "D"
- #define fss_embedded_list_read_short_depth_s "d"
- #define fss_embedded_list_read_short_empty_s "e"
- #define fss_embedded_list_read_short_line_s "l"
- #define fss_embedded_list_read_short_name_s "n"
- #define fss_embedded_list_read_short_object_s "o"
- #define fss_embedded_list_read_short_pipe_s "p"
- #define fss_embedded_list_read_short_raw_s "R"
- #define fss_embedded_list_read_short_select_s "s"
- #define fss_embedded_list_read_short_total_s "t"
- #define fss_embedded_list_read_short_trim_s "T"
-
- #define fss_embedded_list_read_long_at_s "at"
- #define fss_embedded_list_read_long_content_s "content"
- #define fss_embedded_list_read_long_columns_s "columns"
- #define fss_embedded_list_read_long_delimit_s "delimit"
- #define fss_embedded_list_read_long_depth_s "depth"
- #define fss_embedded_list_read_long_empty_s "empty"
- #define fss_embedded_list_read_long_line_s "line"
- #define fss_embedded_list_read_long_name_s "name"
- #define fss_embedded_list_read_long_object_s "object"
- #define fss_embedded_list_read_long_pipe_s "pipe"
- #define fss_embedded_list_read_long_raw_s "raw"
- #define fss_embedded_list_read_long_select_s "select"
- #define fss_embedded_list_read_long_total_s "total"
- #define fss_embedded_list_read_long_trim_s "trim"
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_end_s "\f"
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s "\v"
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_start_s "\b"
+
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_end_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_embedded_list_read_pipe_content_end_s;
+ extern const f_string_static_t fss_embedded_list_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_embedded_list_read_pipe_content_start_s;
+#endif // _di_fss_embedded_list_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_embedded_list_read_parameters_
+ #define FSS_EMBEDDED_LIST_READ_short_at_s "a"
+ #define FSS_EMBEDDED_LIST_READ_short_content_s "c"
+ #define FSS_EMBEDDED_LIST_READ_short_columns_s "C"
+ #define FSS_EMBEDDED_LIST_READ_short_delimit_s "D"
+ #define FSS_EMBEDDED_LIST_READ_short_depth_s "d"
+ #define FSS_EMBEDDED_LIST_READ_short_empty_s "e"
+ #define FSS_EMBEDDED_LIST_READ_short_line_s "l"
+ #define FSS_EMBEDDED_LIST_READ_short_name_s "n"
+ #define FSS_EMBEDDED_LIST_READ_short_object_s "o"
+ #define FSS_EMBEDDED_LIST_READ_short_pipe_s "p"
+ #define FSS_EMBEDDED_LIST_READ_short_raw_s "R"
+ #define FSS_EMBEDDED_LIST_READ_short_select_s "s"
+ #define FSS_EMBEDDED_LIST_READ_short_total_s "t"
+ #define FSS_EMBEDDED_LIST_READ_short_trim_s "T"
+
+ #define FSS_EMBEDDED_LIST_READ_long_at_s "at"
+ #define FSS_EMBEDDED_LIST_READ_long_content_s "content"
+ #define FSS_EMBEDDED_LIST_READ_long_columns_s "columns"
+ #define FSS_EMBEDDED_LIST_READ_long_delimit_s "delimit"
+ #define FSS_EMBEDDED_LIST_READ_long_depth_s "depth"
+ #define FSS_EMBEDDED_LIST_READ_long_empty_s "empty"
+ #define FSS_EMBEDDED_LIST_READ_long_line_s "line"
+ #define FSS_EMBEDDED_LIST_READ_long_name_s "name"
+ #define FSS_EMBEDDED_LIST_READ_long_object_s "object"
+ #define FSS_EMBEDDED_LIST_READ_long_pipe_s "pipe"
+ #define FSS_EMBEDDED_LIST_READ_long_raw_s "raw"
+ #define FSS_EMBEDDED_LIST_READ_long_select_s "select"
+ #define FSS_EMBEDDED_LIST_READ_long_total_s "total"
+ #define FSS_EMBEDDED_LIST_READ_long_trim_s "trim"
+
+ #define FSS_EMBEDDED_LIST_READ_short_at_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_content_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_columns_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_delimit_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_depth_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_empty_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_line_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_name_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_object_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_pipe_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_raw_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_select_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_total_s_length 1
+ #define FSS_EMBEDDED_LIST_READ_short_trim_s_length 1
+
+ #define FSS_EMBEDDED_LIST_READ_long_at_s_length 2
+ #define FSS_EMBEDDED_LIST_READ_long_content_s_length 7
+ #define FSS_EMBEDDED_LIST_READ_long_columns_s_length 7
+ #define FSS_EMBEDDED_LIST_READ_long_delimit_s_length 7
+ #define FSS_EMBEDDED_LIST_READ_long_depth_s_length 5
+ #define FSS_EMBEDDED_LIST_READ_long_empty_s_length 5
+ #define FSS_EMBEDDED_LIST_READ_long_line_s_length 4
+ #define FSS_EMBEDDED_LIST_READ_long_name_s_length 4
+ #define FSS_EMBEDDED_LIST_READ_long_object_s_length 6
+ #define FSS_EMBEDDED_LIST_READ_long_pipe_s_length 4
+ #define FSS_EMBEDDED_LIST_READ_long_raw_s_length 3
+ #define FSS_EMBEDDED_LIST_READ_long_select_s_length 6
+ #define FSS_EMBEDDED_LIST_READ_long_total_s_length 5
+ #define FSS_EMBEDDED_LIST_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_embedded_list_read_short_at_s;
+ extern const f_string_static_t fss_embedded_list_read_short_content_s;
+ extern const f_string_static_t fss_embedded_list_read_short_columns_s;
+ extern const f_string_static_t fss_embedded_list_read_short_delimit_s;
+ extern const f_string_static_t fss_embedded_list_read_short_depth_s;
+ extern const f_string_static_t fss_embedded_list_read_short_empty_s;
+ extern const f_string_static_t fss_embedded_list_read_short_line_s;
+ extern const f_string_static_t fss_embedded_list_read_short_name_s;
+ extern const f_string_static_t fss_embedded_list_read_short_object_s;
+ extern const f_string_static_t fss_embedded_list_read_short_pipe_s;
+ extern const f_string_static_t fss_embedded_list_read_short_raw_s;
+ extern const f_string_static_t fss_embedded_list_read_short_select_s;
+ extern const f_string_static_t fss_embedded_list_read_short_total_s;
+ extern const f_string_static_t fss_embedded_list_read_short_trim_s;
+
+ extern const f_string_static_t fss_embedded_list_read_long_at_s;
+ extern const f_string_static_t fss_embedded_list_read_long_content_s;
+ extern const f_string_static_t fss_embedded_list_read_long_columns_s;
+ extern const f_string_static_t fss_embedded_list_read_long_delimit_s;
+ extern const f_string_static_t fss_embedded_list_read_long_depth_s;
+ extern const f_string_static_t fss_embedded_list_read_long_empty_s;
+ extern const f_string_static_t fss_embedded_list_read_long_line_s;
+ extern const f_string_static_t fss_embedded_list_read_long_name_s;
+ extern const f_string_static_t fss_embedded_list_read_long_object_s;
+ extern const f_string_static_t fss_embedded_list_read_long_pipe_s;
+ extern const f_string_static_t fss_embedded_list_read_long_raw_s;
+ extern const f_string_static_t fss_embedded_list_read_long_select_s;
+ extern const f_string_static_t fss_embedded_list_read_long_total_s;
+ extern const f_string_static_t fss_embedded_list_read_long_trim_s;
enum {
fss_embedded_list_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_at_s.string, fss_embedded_list_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s.string, fss_embedded_list_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s.string, fss_embedded_list_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s.string, fss_embedded_list_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s.string, fss_embedded_list_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s.string, fss_embedded_list_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s.string, fss_embedded_list_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s.string, fss_embedded_list_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s.string, fss_embedded_list_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s.string, fss_embedded_list_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s.string, fss_embedded_list_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s.string, fss_embedded_list_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s.string, fss_embedded_list_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s.string, fss_embedded_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_embedded_list_read_total_parameters_d 23
-#endif // _di_fss_embedded_list_read_defines_
+#endif // _di_fss_embedded_list_read_parameters_
+/**
+ * Provide delimit management.
+ */
#ifndef _di_fss_embedded_list_read_delimit_mode_
#define fss_embedded_list_read_delimit_mode_name_none_s "none"
#define fss_embedded_list_read_delimit_mode_name_all_s "all"
};
#endif // _di_fss_embedded_list_read_delimit_modes_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * remaining: The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ */
#ifndef _di_fss_embedded_list_read_main_t_
typedef struct {
f_console_parameters_t parameters;
extern "C" {
#endif
-#ifndef _di_fss_embedded_list_read_program_version_
- const f_string_static_t fss_embedded_list_read_program_version_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_version_s, 0, FSS_EMBEDDED_LIST_READ_program_version_s_length);
-#endif // _di_fss_embedded_list_read_program_version_
-
-#ifndef _di_fss_embedded_list_read_program_name_
- const f_string_static_t fss_embedded_list_read_program_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_s, 0, FSS_EMBEDDED_LIST_READ_program_name_s_length);
- const f_string_static_t fss_embedded_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_program_name_long_s, 0, FSS_EMBEDDED_LIST_READ_program_name_long_s_length);
-#endif // _di_fss_embedded_list_read_program_name_
-
#ifndef _di_fss_embedded_list_read_print_help_
f_status_t fss_embedded_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_embedded_list_read_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_embedded_list_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
f_console_parameter_id_t ids[3] = { fss_embedded_list_read_parameter_no_color_e, fss_embedded_list_read_parameter_light_e, fss_embedded_list_read_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
}
- if (main->remaining.used > 0 || main->process_pipe) {
+ if (main->parameters.remaining.used > 0 || main->process_pipe) {
if (main->parameters.array[fss_embedded_list_read_parameter_at_e].result == f_console_result_found_e) {
flockfile(main->error.to.stream);
f_string_dynamic_resize(0, &main->buffer);
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (fss_embedded_list_read_signal_received(main)) {
status = F_status_set_error(F_interrupt);
f_file_t file = f_file_t_initialize;
- status = f_file_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
main->quantity.total = original_size;
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
if (!main->quantity.total) {
status = f_file_size_by_id(file.id, &main->quantity.total);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
f_file_stream_close(F_true, &file);
f_file_stream_close(F_true, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
- status = fss_embedded_list_read_main_process_file(main, arguments, arguments->argv[main->remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments);
+ status = fss_embedded_list_read_main_process_file(main, arguments, arguments->argv[main->parameters.remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
const f_string_static_t fss_embedded_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_name_long_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length);
#endif // _di_fss_embedded_list_write_program_name_
-#ifndef _di_fss_embedded_list_write_main_delete_
- f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_embedded_list_write_defines_
+ const f_string_static_t fss_embedded_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_embedded_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_embedded_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_embedded_list_write_defines_
+
+#ifndef _di_fss_embedded_list_write_parameters_
+ const f_string_static_t fss_embedded_list_write_short_file_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_file_s, 0, FSS_EMBEDDED_LIST_WRITE_short_file_s_length);
+ const f_string_static_t fss_embedded_list_write_short_content_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_content_s, 0, FSS_EMBEDDED_LIST_WRITE_short_content_s_length);
+ const f_string_static_t fss_embedded_list_write_short_double_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_double_s, 0, FSS_EMBEDDED_LIST_WRITE_short_double_s_length);
+ const f_string_static_t fss_embedded_list_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_ignore_s, 0, FSS_EMBEDDED_LIST_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_embedded_list_write_short_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_object_s, 0, FSS_EMBEDDED_LIST_WRITE_short_object_s_length);
+ const f_string_static_t fss_embedded_list_write_short_partial_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_partial_s, 0, FSS_EMBEDDED_LIST_WRITE_short_partial_s_length);
+ const f_string_static_t fss_embedded_list_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_prepend_s, 0, FSS_EMBEDDED_LIST_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_embedded_list_write_short_single_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_single_s, 0, FSS_EMBEDDED_LIST_WRITE_short_single_s_length);
+ const f_string_static_t fss_embedded_list_write_short_trim_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_short_trim_s, 0, FSS_EMBEDDED_LIST_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_embedded_list_write_long_file_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_file_s, 0, FSS_EMBEDDED_LIST_WRITE_long_file_s_length);
+ const f_string_static_t fss_embedded_list_write_long_content_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_content_s, 0, FSS_EMBEDDED_LIST_WRITE_long_content_s_length);
+ const f_string_static_t fss_embedded_list_write_long_double_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_double_s, 0, FSS_EMBEDDED_LIST_WRITE_long_double_s_length);
+ const f_string_static_t fss_embedded_list_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_ignore_s, 0, FSS_EMBEDDED_LIST_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_embedded_list_write_long_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_object_s, 0, FSS_EMBEDDED_LIST_WRITE_long_object_s_length);
+ const f_string_static_t fss_embedded_list_write_long_partial_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_partial_s, 0, FSS_EMBEDDED_LIST_WRITE_long_partial_s_length);
+ const f_string_static_t fss_embedded_list_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_prepend_s, 0, FSS_EMBEDDED_LIST_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_embedded_list_write_long_single_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_single_s, 0, FSS_EMBEDDED_LIST_WRITE_long_single_s_length);
+ const f_string_static_t fss_embedded_list_write_long_trim_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_long_trim_s, 0, FSS_EMBEDDED_LIST_WRITE_long_trim_s_length);
+#endif // _di_fss_embedded_list_write_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_embedded_list_write_main_delete_
+ f_status_t fss_embedded_list_write_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_embedded_list_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_embedded_list_write_program_version_
#define FSS_EMBEDDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_EMBEDDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_embedded_list_write_program_version_s;
#endif // _di_fss_embedded_list_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_embedded_list_write_program_name_
#define FSS_EMBEDDED_LIST_WRITE_program_name_s "fss_embedded_list_write"
#define FSS_EMBEDDED_LIST_WRITE_program_name_long_s "FSS Embedded List Write"
extern const f_string_static_t fss_embedded_list_write_program_name_long_s;
#endif // _di_fss_embedded_list_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_embedded_list_write_defines_
#define fss_embedded_list_write_signal_check_d 10000
- #define fss_embedded_list_write_pipe_content_end_s '\f'
- #define fss_embedded_list_write_pipe_content_ignore_s '\v'
- #define fss_embedded_list_write_pipe_content_start_s '\b'
-
- #define fss_embedded_list_write_short_file_s "f"
- #define fss_embedded_list_write_short_content_s "c"
- #define fss_embedded_list_write_short_double_s "d"
- #define fss_embedded_list_write_short_ignore_s "I"
- #define fss_embedded_list_write_short_object_s "o"
- #define fss_embedded_list_write_short_partial_s "p"
- #define fss_embedded_list_write_short_prepend_s "P"
- #define fss_embedded_list_write_short_single_s "s"
- #define fss_embedded_list_write_short_trim_s "T"
-
- #define fss_embedded_list_write_long_file_s "file"
- #define fss_embedded_list_write_long_content_s "content"
- #define fss_embedded_list_write_long_double_s "double"
- #define fss_embedded_list_write_long_ignore_s "ignore"
- #define fss_embedded_list_write_long_object_s "object"
- #define fss_embedded_list_write_long_partial_s "partial"
- #define fss_embedded_list_write_long_prepend_s "prepend"
- #define fss_embedded_list_write_long_single_s "single"
- #define fss_embedded_list_write_long_trim_s "trim"
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s "\f"
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s "\v"
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s "\b"
+
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_end_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_embedded_list_write_pipe_content_end_s;
+ extern const f_string_static_t fss_embedded_list_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_embedded_list_write_pipe_content_start_s;
+#endif // _di_fss_embedded_list_write_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_embedded_list_write_parameters_
+ #define FSS_EMBEDDED_LIST_WRITE_short_file_s "f"
+ #define FSS_EMBEDDED_LIST_WRITE_short_content_s "c"
+ #define FSS_EMBEDDED_LIST_WRITE_short_double_s "d"
+ #define FSS_EMBEDDED_LIST_WRITE_short_ignore_s "I"
+ #define FSS_EMBEDDED_LIST_WRITE_short_object_s "o"
+ #define FSS_EMBEDDED_LIST_WRITE_short_partial_s "p"
+ #define FSS_EMBEDDED_LIST_WRITE_short_prepend_s "P"
+ #define FSS_EMBEDDED_LIST_WRITE_short_single_s "s"
+ #define FSS_EMBEDDED_LIST_WRITE_short_trim_s "T"
+
+ #define FSS_EMBEDDED_LIST_WRITE_long_file_s "file"
+ #define FSS_EMBEDDED_LIST_WRITE_long_content_s "content"
+ #define FSS_EMBEDDED_LIST_WRITE_long_double_s "double"
+ #define FSS_EMBEDDED_LIST_WRITE_long_ignore_s "ignore"
+ #define FSS_EMBEDDED_LIST_WRITE_long_object_s "object"
+ #define FSS_EMBEDDED_LIST_WRITE_long_partial_s "partial"
+ #define FSS_EMBEDDED_LIST_WRITE_long_prepend_s "prepend"
+ #define FSS_EMBEDDED_LIST_WRITE_long_single_s "single"
+ #define FSS_EMBEDDED_LIST_WRITE_long_trim_s "trim"
+
+ #define FSS_EMBEDDED_LIST_WRITE_short_file_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_content_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_double_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_ignore_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_object_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_partial_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_prepend_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_single_s_length 1
+ #define FSS_EMBEDDED_LIST_WRITE_short_trim_s_length 1
+
+ #define FSS_EMBEDDED_LIST_WRITE_long_file_s_length 4
+ #define FSS_EMBEDDED_LIST_WRITE_long_content_s_length 7
+ #define FSS_EMBEDDED_LIST_WRITE_long_double_s_length 6
+ #define FSS_EMBEDDED_LIST_WRITE_long_ignore_s_length 6
+ #define FSS_EMBEDDED_LIST_WRITE_long_object_s_length 6
+ #define FSS_EMBEDDED_LIST_WRITE_long_partial_s_length 7
+ #define FSS_EMBEDDED_LIST_WRITE_long_prepend_s_length 7
+ #define FSS_EMBEDDED_LIST_WRITE_long_single_s_length 6
+ #define FSS_EMBEDDED_LIST_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_embedded_list_write_short_file_s;
+ extern const f_string_static_t fss_embedded_list_write_short_content_s;
+ extern const f_string_static_t fss_embedded_list_write_short_double_s;
+ extern const f_string_static_t fss_embedded_list_write_short_ignore_s;
+ extern const f_string_static_t fss_embedded_list_write_short_object_s;
+ extern const f_string_static_t fss_embedded_list_write_short_partial_s;
+ extern const f_string_static_t fss_embedded_list_write_short_prepend_s;
+ extern const f_string_static_t fss_embedded_list_write_short_single_s;
+ extern const f_string_static_t fss_embedded_list_write_short_trim_s;
+
+ extern const f_string_static_t fss_embedded_list_write_long_file_s;
+ extern const f_string_static_t fss_embedded_list_write_long_content_s;
+ extern const f_string_static_t fss_embedded_list_write_long_double_s;
+ extern const f_string_static_t fss_embedded_list_write_long_ignore_s;
+ extern const f_string_static_t fss_embedded_list_write_long_object_s;
+ extern const f_string_static_t fss_embedded_list_write_long_partial_s;
+ extern const f_string_static_t fss_embedded_list_write_long_prepend_s;
+ extern const f_string_static_t fss_embedded_list_write_long_single_s;
+ extern const f_string_static_t fss_embedded_list_write_long_trim_s;
enum {
fss_embedded_list_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_file_s.string, fss_embedded_list_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s.string, fss_embedded_list_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s.string, fss_embedded_list_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s.string, fss_embedded_list_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s.string, fss_embedded_list_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s.string, fss_embedded_list_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s.string, fss_embedded_list_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s.string, fss_embedded_list_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s.string, fss_embedded_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_embedded_list_write_total_parameters_d 18
-#endif // _di_fss_embedded_list_write_defines_
-
-#ifndef _di_fss_embedded_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_string_static_t prepend;
-
- f_color_context_t context;
- } fss_embedded_list_write_main_t;
-
- #define fss_embedded_list_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_embedded_list_write_main_t_
+#endif // _di_fss_embedded_list_write_parameters_
/**
* Deallocate main.
* @see fss_embedded_list_write_main()
*/
#ifndef _di_fss_embedded_list_write_main_delete_
- extern f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main);
+ extern f_status_t fss_embedded_list_write_main_delete(fll_program_data_t * const main);
#endif // _di_fss_embedded_list_write_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_embedded_list_write_program_version_
- const f_string_static_t fss_embedded_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_version_s, 0, FSS_EMBEDDED_LIST_WRITE_program_version_s_length);
-#endif // _di_fss_embedded_list_write_program_version_
-
-#ifndef _di_fss_embedded_list_write_program_name_
- const f_string_static_t fss_embedded_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_name_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_s_length);
- const f_string_static_t fss_embedded_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_program_name_long_s, 0, FSS_EMBEDDED_LIST_WRITE_program_name_long_s_length);
-#endif // _di_fss_embedded_list_write_program_name_
-
#ifndef _di_fss_embedded_list_write_print_help_
f_status_t fss_embedded_list_write_print_help(const f_file_t file, const f_color_context_t context) {
#endif // _di_fss_embedded_list_write_print_help_
#ifndef _di_fss_embedded_list_write_main_
- f_status_t fss_embedded_list_write_main(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_embedded_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_embedded_list_write_parameter_no_color_e, fss_embedded_list_write_parameter_light_e, fss_embedded_list_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
if (length) {
f_string_range_t range = macro_f_string_range_t_initialize(length);
- main->prepend.string = arguments->argv[index];
- main->prepend.used = length;
- main->prepend.size = length;
-
for (; range.start < length; ++range.start) {
- status = f_fss_is_space(main->prepend, range);
+ status = f_fss_is_space(main->parameter->arguments.array[index], range);
if (F_status_is_error(status)) break;
if (status == F_false) {
* @see fss_embedded_list_write_main_delete()
*/
#ifndef _di_fss_embedded_list_write_main_
- extern f_status_t fss_embedded_list_write_main(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_embedded_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_embedded_list_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_embedded_list_write_main_t data = fss_embedded_list_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_embedded_list_write_print_signal_received_
- void fss_embedded_list_write_print_signal_received(fss_embedded_list_write_main_t * const main, const f_status_t signal) {
+ void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_embedded_list_write_print_signal_received_
#ifndef _di_fss_embedded_list_write_signal_received_
- f_status_t fss_embedded_list_write_signal_received(fss_embedded_list_write_main_t * const main) {
+ f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_embedded_list_write_print_signal_received_
- extern void fss_embedded_list_write_print_signal_received(fss_embedded_list_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_embedded_list_write_signal_received_
- extern f_status_t fss_embedded_list_write_signal_received(fss_embedded_list_write_main_t * const main);
+ extern f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main);
#endif // _di_fss_embedded_list_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_embedded_list_write_error_parameter_same_times_print_
- void fss_embedded_list_write_error_parameter_same_times_print(fss_embedded_list_write_main_t * const main) {
+ void fss_embedded_list_write_error_parameter_same_times_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_embedded_list_write_error_parameter_same_times_print_
#ifndef _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
- void fss_embedded_list_write_error_parameter_unsupported_eol_print(fss_embedded_list_write_main_t * const main) {
+ void fss_embedded_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_embedded_list_write_error_parameter_value_missing_print_
- void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
+ void fss_embedded_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_
#ifndef _di_fss_embedded_list_write_process_
- f_status_t fss_embedded_list_write_process(fss_embedded_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
+ f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_embedded_list_write_process_
#ifndef _di_fss_embedded_list_write_process_pipe_
- f_status_t fss_embedded_list_write_process_pipe(fss_embedded_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) {
+ f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
#endif // _di_fss_embedded_list_write_process_pipe_
#ifndef _di_fss_embedded_list_write_process_parameter_ignore_
- f_status_t fss_embedded_list_write_process_parameter_ignore(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
+ f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
f_status_t status = F_none;
* The main program data.
*/
#ifndef _di_fss_embedded_list_write_error_parameter_same_times_print_
- void fss_embedded_list_write_error_parameter_same_times_print(fss_embedded_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_embedded_list_write_error_parameter_same_times_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_error_parameter_same_times_print_
/**
* The main program data.
*/
#ifndef _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
- void fss_embedded_list_write_error_parameter_unsupported_eol_print(fss_embedded_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_embedded_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_
/**
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_embedded_list_write_error_parameter_value_missing_print_
- void fss_embedded_list_write_error_parameter_value_missing_print(fss_embedded_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ void fss_embedded_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_embedded_list_write_process_
- extern f_status_t fss_embedded_list_write_process(fss_embedded_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_embedded_list_write_process_pipe_
- extern f_status_t fss_embedded_list_write_process_pipe(fss_embedded_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_process_pipe_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_embedded_list_write_process_parameter_ignore_
- extern f_status_t fss_embedded_list_write_process_parameter_ignore(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_process_parameter_ignore_
#ifdef __cplusplus
const f_string_static_t fss_extended_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_name_long_s, 0, FSS_EXTENDED_LIST_READ_program_name_long_s_length);
#endif // _di_fss_extended_list_read_program_name_
-#ifndef _di_fss_extended_list_read_main_delete_
- f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_extended_list_read_defines_
+ const f_string_static_t fss_extended_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_end_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_extended_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_ignore_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_extended_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_content_start_s, 0, FSS_EXTENDED_LIST_READ_pipe_content_start_s_length);
+#endif // _di_fss_extended_list_read_defines_
+
+#ifndef _di_fss_extended_list_read_parameters_
+ const f_string_static_t fss_extended_list_read_short_at_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_at_s, 0, FSS_EXTENDED_LIST_READ_short_at_s_length);
+ const f_string_static_t fss_extended_list_read_short_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_content_s, 0, FSS_EXTENDED_LIST_READ_short_content_s_length);
+ const f_string_static_t fss_extended_list_read_short_columns_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_columns_s, 0, FSS_EXTENDED_LIST_READ_short_columns_s_length);
+ const f_string_static_t fss_extended_list_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_delimit_s, 0, FSS_EXTENDED_LIST_READ_short_delimit_s_length);
+ const f_string_static_t fss_extended_list_read_short_depth_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_depth_s, 0, FSS_EXTENDED_LIST_READ_short_depth_s_length);
+ const f_string_static_t fss_extended_list_read_short_empty_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_empty_s, 0, FSS_EXTENDED_LIST_READ_short_empty_s_length);
+ const f_string_static_t fss_extended_list_read_short_line_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_line_s, 0, FSS_EXTENDED_LIST_READ_short_line_s_length);
+ const f_string_static_t fss_extended_list_read_short_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_name_s, 0, FSS_EXTENDED_LIST_READ_short_name_s_length);
+ const f_string_static_t fss_extended_list_read_short_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_object_s, 0, FSS_EXTENDED_LIST_READ_short_object_s_length);
+ const f_string_static_t fss_extended_list_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_pipe_s, 0, FSS_EXTENDED_LIST_READ_short_pipe_s_length);
+ const f_string_static_t fss_extended_list_read_short_raw_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_raw_s, 0, FSS_EXTENDED_LIST_READ_short_raw_s_length);
+ const f_string_static_t fss_extended_list_read_short_select_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_select_s, 0, FSS_EXTENDED_LIST_READ_short_select_s_length);
+ const f_string_static_t fss_extended_list_read_short_total_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_total_s, 0, FSS_EXTENDED_LIST_READ_short_total_s_length);
+ const f_string_static_t fss_extended_list_read_short_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_short_trim_s, 0, FSS_EXTENDED_LIST_READ_short_trim_s_length);
+
+ const f_string_static_t fss_extended_list_read_long_at_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_at_s, 0, FSS_EXTENDED_LIST_READ_long_at_s_length);
+ const f_string_static_t fss_extended_list_read_long_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_content_s, 0, FSS_EXTENDED_LIST_READ_long_content_s_length);
+ const f_string_static_t fss_extended_list_read_long_columns_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_columns_s, 0, FSS_EXTENDED_LIST_READ_long_columns_s_length);
+ const f_string_static_t fss_extended_list_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_delimit_s, 0, FSS_EXTENDED_LIST_READ_long_delimit_s_length);
+ const f_string_static_t fss_extended_list_read_long_depth_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_depth_s, 0, FSS_EXTENDED_LIST_READ_long_depth_s_length);
+ const f_string_static_t fss_extended_list_read_long_empty_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_empty_s, 0, FSS_EXTENDED_LIST_READ_long_empty_s_length);
+ const f_string_static_t fss_extended_list_read_long_line_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_line_s, 0, FSS_EXTENDED_LIST_READ_long_line_s_length);
+ const f_string_static_t fss_extended_list_read_long_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_name_s, 0, FSS_EXTENDED_LIST_READ_long_name_s_length);
+ const f_string_static_t fss_extended_list_read_long_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_object_s, 0, FSS_EXTENDED_LIST_READ_long_object_s_length);
+ const f_string_static_t fss_extended_list_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_pipe_s, 0, FSS_EXTENDED_LIST_READ_long_pipe_s_length);
+ const f_string_static_t fss_extended_list_read_long_raw_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_raw_s, 0, FSS_EXTENDED_LIST_READ_long_raw_s_length);
+ const f_string_static_t fss_extended_list_read_long_select_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_select_s, 0, FSS_EXTENDED_LIST_READ_long_select_s_length);
+ const f_string_static_t fss_extended_list_read_long_total_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_total_s, 0, FSS_EXTENDED_LIST_READ_long_total_s_length);
+ const f_string_static_t fss_extended_list_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_long_trim_s, 0, FSS_EXTENDED_LIST_READ_long_trim_s_length);
+#endif // _di_fss_extended_list_read_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_extended_list_read_main_delete_
+ f_status_t fss_extended_list_read_main_delete(fll_program_data_t *main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_extended_list_read_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_extended_list_read_program_version_
#define FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_0_s
#define FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_extended_list_read_program_version_s;
#endif // _di_fss_extended_list_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_extended_list_read_program_name_
#define FSS_EXTENDED_LIST_READ_program_name_s "fss_extended_list_read"
#define FSS_EXTENDED_LIST_READ_program_name_long_s "FSS Extended List Read"
extern const f_string_static_t fss_extended_list_read_program_name_long_s;
#endif // _di_fss_extended_list_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_extended_list_read_defines_
#define fss_extended_list_read_signal_check_d 10000
- #define fss_extended_list_read_pipe_content_end '\f'
- #define fss_extended_list_read_pipe_content_ignore '\v'
- #define fss_extended_list_read_pipe_content_start '\b'
-
- #define fss_extended_list_read_short_at_s "a"
- #define fss_extended_list_read_short_content_s "c"
- #define fss_extended_list_read_short_columns_s "C"
- #define fss_extended_list_read_short_delimit_s "D"
- #define fss_extended_list_read_short_depth_s "d"
- #define fss_extended_list_read_short_empty_s "e"
- #define fss_extended_list_read_short_line_s "l"
- #define fss_extended_list_read_short_name_s "n"
- #define fss_extended_list_read_short_object_s "o"
- #define fss_extended_list_read_short_pipe_s "p"
- #define fss_extended_list_read_short_raw_s "R"
- #define fss_extended_list_read_short_select_s "s"
- #define fss_extended_list_read_short_total_s "t"
- #define fss_extended_list_read_short_trim_s "T"
-
- #define fss_extended_list_read_long_at_s "at"
- #define fss_extended_list_read_long_content_s "content"
- #define fss_extended_list_read_long_columns_s "columns"
- #define fss_extended_list_read_long_delimit_s "delimit"
- #define fss_extended_list_read_long_depth_s "depth"
- #define fss_extended_list_read_long_empty_s "empty"
- #define fss_extended_list_read_long_line_s "line"
- #define fss_extended_list_read_long_name_s "name"
- #define fss_extended_list_read_long_object_s "object"
- #define fss_extended_list_read_long_pipe_s "pipe"
- #define fss_extended_list_read_long_raw_s "raw"
- #define fss_extended_list_read_long_select_s "select"
- #define fss_extended_list_read_long_total_s "total"
- #define fss_extended_list_read_long_trim_s "trim"
+ #define FSS_EXTENDED_LIST_READ_pipe_content_end_s "\f"
+ #define FSS_EXTENDED_LIST_READ_pipe_content_ignore_s "\v"
+ #define FSS_EXTENDED_LIST_READ_pipe_content_start_s "\b"
+
+ #define FSS_EXTENDED_LIST_READ_pipe_content_end_s_length 1
+ #define FSS_EXTENDED_LIST_READ_pipe_content_ignore_s_length 1
+ #define FSS_EXTENDED_LIST_READ_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_extended_list_read_pipe_content_end_s;
+ extern const f_string_static_t fss_extended_list_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_extended_list_read_pipe_content_start_s;
+#endif // _di_fss_extended_list_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_extended_list_read_parameters_
+ #define FSS_EXTENDED_LIST_READ_short_at_s "a"
+ #define FSS_EXTENDED_LIST_READ_short_content_s "c"
+ #define FSS_EXTENDED_LIST_READ_short_columns_s "C"
+ #define FSS_EXTENDED_LIST_READ_short_delimit_s "D"
+ #define FSS_EXTENDED_LIST_READ_short_depth_s "d"
+ #define FSS_EXTENDED_LIST_READ_short_empty_s "e"
+ #define FSS_EXTENDED_LIST_READ_short_line_s "l"
+ #define FSS_EXTENDED_LIST_READ_short_name_s "n"
+ #define FSS_EXTENDED_LIST_READ_short_object_s "o"
+ #define FSS_EXTENDED_LIST_READ_short_pipe_s "p"
+ #define FSS_EXTENDED_LIST_READ_short_raw_s "R"
+ #define FSS_EXTENDED_LIST_READ_short_select_s "s"
+ #define FSS_EXTENDED_LIST_READ_short_total_s "t"
+ #define FSS_EXTENDED_LIST_READ_short_trim_s "T"
+
+ #define FSS_EXTENDED_LIST_READ_long_at_s "at"
+ #define FSS_EXTENDED_LIST_READ_long_content_s "content"
+ #define FSS_EXTENDED_LIST_READ_long_columns_s "columns"
+ #define FSS_EXTENDED_LIST_READ_long_delimit_s "delimit"
+ #define FSS_EXTENDED_LIST_READ_long_depth_s "depth"
+ #define FSS_EXTENDED_LIST_READ_long_empty_s "empty"
+ #define FSS_EXTENDED_LIST_READ_long_line_s "line"
+ #define FSS_EXTENDED_LIST_READ_long_name_s "name"
+ #define FSS_EXTENDED_LIST_READ_long_object_s "object"
+ #define FSS_EXTENDED_LIST_READ_long_pipe_s "pipe"
+ #define FSS_EXTENDED_LIST_READ_long_raw_s "raw"
+ #define FSS_EXTENDED_LIST_READ_long_select_s "select"
+ #define FSS_EXTENDED_LIST_READ_long_total_s "total"
+ #define FSS_EXTENDED_LIST_READ_long_trim_s "trim"
+
+ #define FSS_EXTENDED_LIST_READ_short_at_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_content_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_columns_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_delimit_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_depth_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_empty_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_line_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_name_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_object_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_pipe_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_raw_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_select_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_total_s_length 1
+ #define FSS_EXTENDED_LIST_READ_short_trim_s_length 1
+
+ #define FSS_EXTENDED_LIST_READ_long_at_s_length 2
+ #define FSS_EXTENDED_LIST_READ_long_content_s_length 7
+ #define FSS_EXTENDED_LIST_READ_long_columns_s_length 7
+ #define FSS_EXTENDED_LIST_READ_long_delimit_s_length 7
+ #define FSS_EXTENDED_LIST_READ_long_depth_s_length 5
+ #define FSS_EXTENDED_LIST_READ_long_empty_s_length 5
+ #define FSS_EXTENDED_LIST_READ_long_line_s_length 4
+ #define FSS_EXTENDED_LIST_READ_long_name_s_length 4
+ #define FSS_EXTENDED_LIST_READ_long_object_s_length 6
+ #define FSS_EXTENDED_LIST_READ_long_pipe_s_length 4
+ #define FSS_EXTENDED_LIST_READ_long_raw_s_length 3
+ #define FSS_EXTENDED_LIST_READ_long_select_s_length 6
+ #define FSS_EXTENDED_LIST_READ_long_total_s_length 5
+ #define FSS_EXTENDED_LIST_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_extended_list_read_short_at_s;
+ extern const f_string_static_t fss_extended_list_read_short_content_s;
+ extern const f_string_static_t fss_extended_list_read_short_columns_s;
+ extern const f_string_static_t fss_extended_list_read_short_delimit_s;
+ extern const f_string_static_t fss_extended_list_read_short_depth_s;
+ extern const f_string_static_t fss_extended_list_read_short_empty_s;
+ extern const f_string_static_t fss_extended_list_read_short_line_s;
+ extern const f_string_static_t fss_extended_list_read_short_name_s;
+ extern const f_string_static_t fss_extended_list_read_short_object_s;
+ extern const f_string_static_t fss_extended_list_read_short_pipe_s;
+ extern const f_string_static_t fss_extended_list_read_short_raw_s;
+ extern const f_string_static_t fss_extended_list_read_short_select_s;
+ extern const f_string_static_t fss_extended_list_read_short_total_s;
+ extern const f_string_static_t fss_extended_list_read_short_trim_s;
+
+ extern const f_string_static_t fss_extended_list_read_long_at_s;
+ extern const f_string_static_t fss_extended_list_read_long_content_s;
+ extern const f_string_static_t fss_extended_list_read_long_columns_s;
+ extern const f_string_static_t fss_extended_list_read_long_delimit_s;
+ extern const f_string_static_t fss_extended_list_read_long_depth_s;
+ extern const f_string_static_t fss_extended_list_read_long_empty_s;
+ extern const f_string_static_t fss_extended_list_read_long_line_s;
+ extern const f_string_static_t fss_extended_list_read_long_name_s;
+ extern const f_string_static_t fss_extended_list_read_long_object_s;
+ extern const f_string_static_t fss_extended_list_read_long_pipe_s;
+ extern const f_string_static_t fss_extended_list_read_long_raw_s;
+ extern const f_string_static_t fss_extended_list_read_long_select_s;
+ extern const f_string_static_t fss_extended_list_read_long_total_s;
+ extern const f_string_static_t fss_extended_list_read_long_trim_s;
enum {
fss_extended_list_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_at_s.string, fss_extended_list_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s.string, fss_extended_list_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s.string, fss_extended_list_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s.string, fss_extended_list_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s.string, fss_extended_list_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s.string, fss_extended_list_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s.string, fss_extended_list_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s.string, fss_extended_list_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s.string, fss_extended_list_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s.string, fss_extended_list_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s.string, fss_extended_list_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s.string, fss_extended_list_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s.string, fss_extended_list_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s.string, fss_extended_list_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_extended_list_read_total_parameters_d 23
-#endif // _di_fss_extended_list_read_defines_
+#endif // _di_fss_extended_list_read_parameters_
/**
* FSS Delimit Parameter data.
};
#endif // _di_fss_extended_list_read_delimit_modes_
-#ifndef _di_fss_extended_list_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_extended_list_read_main_t;
-
- #define fss_extended_list_read_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_list_read_main_t_
-
/**
* Deallocate main.
*
* @see fss_extended_list_read_main()
*/
#ifndef _di_fss_extended_list_read_main_delete_
- extern f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main);
+ extern f_status_t fss_extended_list_read_main_delete(fll_program_data_t *main);
#endif // _di_fss_extended_list_read_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_extended_list_read_program_version_
- const f_string_static_t fss_extended_list_read_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_version_s, 0, FSS_EXTENDED_LIST_READ_program_version_s_length);
-#endif // _di_fss_extended_list_read_program_version_
-
-#ifndef _di_fss_extended_list_read_program_name_
- const f_string_static_t fss_extended_list_read_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_name_s, 0, FSS_EXTENDED_LIST_READ_program_name_s_length);
- const f_string_static_t fss_extended_list_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_program_name_long_s, 0, FSS_EXTENDED_LIST_READ_program_name_long_s_length);
-#endif // _di_fss_extended_list_read_program_name_
-
#ifndef _di_fss_extended_list_read_print_help_
f_status_t fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_extended_list_read_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_extended_list_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
#endif // _di_fss_extended_list_read_print_help_
#ifndef _di_fss_extended_list_read_main_
- f_status_t fss_extended_list_read_main(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_extended_list_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_extended_list_read_parameter_no_color_e, fss_extended_list_read_parameter_light_e, fss_extended_list_read_parameter_dark_e };
const f_console_parameter_ids_t choices = { ids, 3 };
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
- fss_extended_list_read_file_t files_array[main->remaining.used + 1];
+ fss_extended_list_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize;
data.files.array = files_array;
data.files.used = 1;
- data.files.size = main->remaining.used + 1;
+ data.files.size = main->parameters.remaining.used + 1;
data.files.array[0].name = "(pipe)";
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
{
const f_array_length_t parameter_code[] = {
fss_extended_list_read_parameter_at_e,
}
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (fss_extended_list_read_signal_received(main)) {
status = F_status_set_error(F_interrupt);
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
else if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->remaining.array[i]];
+ data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
*
* This is the FSS Extended List Read program
* This program utilizes the Featureless Linux Library.
- * This program processes files or other input in fss format and stores the results in the fss_extended_list_read_main_t.
+ * This program processes files or other input in fss format and stores the results in the fll_program_data_t.
*
* This processes in accordance to the FSS-0003 Extended List specification.
*/
* @see fss_extended_list_read_main_delete()
*/
#ifndef _di_fss_extended_list_read_main_
- extern f_status_t fss_extended_list_read_main(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_extended_list_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_list_read_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fss_extended_list_read_main_t data = fss_extended_list_read_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_extended_list_read_depths_resize_
#ifndef _di_fss_extended_list_read_print_signal_received_
- void fss_extended_list_read_print_signal_received(fss_extended_list_read_main_t * const main, const f_status_t signal) {
+ void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_extended_list_read_print_signal_received_
#ifndef _di_fss_extended_list_read_signal_received_
- f_status_t fss_extended_list_read_signal_received(fss_extended_list_read_main_t * const main) {
+ f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_extended_list_read_print_signal_received_
- extern void fss_extended_list_read_print_signal_received(fss_extended_list_read_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_extended_list_read_signal_received_
- extern f_status_t fss_extended_list_read_signal_received(fss_extended_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_extended_list_read_print_at_
- void fss_extended_list_read_print_at(fss_extended_list_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_list_read_data_t * const data) {
+ void fss_extended_list_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_list_read_data_t * const data) {
if (at >= data->contents.used) {
return;
#endif // _di_fss_extended_list_read_print_at_
#ifndef _di_fss_extended_list_read_print_at_object_
- void fss_extended_list_read_print_at_object(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
+ void fss_extended_list_read_print_at_object(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
if (at >= data->objects.used) {
return;
#endif // _di_fss_extended_list_read_print_at_object_
#ifndef _di_fss_extended_list_read_print_content_ignore_
- void fss_extended_list_read_print_content_ignore(fss_extended_list_read_main_t * const main) {
+ void fss_extended_list_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_list_read_pipe_content_ignore, main->output.to.stream);
#endif // _di_fss_extended_list_read_print_content_ignore_
#ifndef _di_fss_extended_list_read_print_object_end_
- void fss_extended_list_read_print_object_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) {
+ void fss_extended_list_read_print_object_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_list_read_pipe_content_start, main->output.to.stream);
#endif // _di_fss_extended_list_read_print_object_end_
#ifndef _di_fss_extended_list_read_print_set_end_
- void fss_extended_list_read_print_set_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) {
+ void fss_extended_list_read_print_set_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
if (main->parameters.array[fss_extended_list_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_list_read_pipe_content_end, main->output.to.stream);
#endif // _di_fss_extended_list_read_print_set_end_
#ifndef _di_fss_extended_list_read_print_one_
- void fss_extended_list_read_print_one(fss_extended_list_read_main_t * const main) {
+ void fss_extended_list_read_print_one(fll_program_data_t * const main) {
f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#endif // _di_fss_extended_list_read_print_one_
#ifndef _di_fss_extended_list_read_print_zero_
- void fss_extended_list_read_print_zero(fss_extended_list_read_main_t * const main) {
+ void fss_extended_list_read_print_zero(fll_program_data_t * const main) {
f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
* The program data.
*/
#ifndef _di_fss_extended_list_read_print_at_
- extern void fss_extended_list_read_print_at(fss_extended_list_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_at_
/**
* The delimits to be applied to an Object.
*/
#ifndef _di_fss_extended_list_read_print_at_object_
- extern void fss_extended_list_read_print_at_object(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_at_object(fll_program_data_t * const main, fss_extended_list_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_at_object_
/**
* The main program data.
*/
#ifndef _di_fss_extended_list_read_print_content_ignore_
- extern void fss_extended_list_read_print_content_ignore(fss_extended_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_content_ignore(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_content_ignore_
/**
* The program data.
*/
#ifndef _di_fss_extended_list_read_print_object_end_
- extern void fss_extended_list_read_print_object_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_object_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_object_end_
/**
* The main program data.
*/
#ifndef _di_fss_extended_list_read_print_one_
- extern void fss_extended_list_read_print_one(fss_extended_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_one(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_one_
/**
* The program data.
*/
#ifndef _di_fss_extended_list_read_print_set_end_
- extern void fss_extended_list_read_print_set_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_set_end(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_set_end_
/**
* The main program data.
*/
#ifndef _di_fss_extended_list_read_print_zero_
- extern void fss_extended_list_read_print_zero(fss_extended_list_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_zero(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_zero_
#ifdef __cplusplus
#endif // _di_fss_extended_list_read_delimit_object_is_
#ifndef _di_fss_extended_list_read_depth_process_
- f_status_t fss_extended_list_read_depth_process(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_extended_list_read_file_identify_
#ifndef _di_fss_extended_list_read_load_
- f_status_t fss_extended_list_read_load(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#endif // _di_fss_extended_list_read_load_
#ifndef _di_fss_extended_list_read_load_number_
- f_status_t fss_extended_list_read_load_number(fss_extended_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
#endif // _di_fss_extended_list_read_load_number_
#ifndef _di_fss_extended_list_read_process_
- f_status_t fss_extended_list_read_process(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
f_status_t status = fss_extended_list_read_process_option(main, arguments, data);
if (F_status_is_error(status)) return status;
#endif // _di_fss_extended_list_read_process_
#ifndef _di_fss_extended_list_read_process_at_
- f_status_t fss_extended_list_read_process_at(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_extended_list_read_data_option_columns_d | fss_extended_list_read_data_option_total_d)) {
#endif // _di_fss_extended_list_read_process_at_
#ifndef _di_fss_extended_list_read_process_at_line_
- f_status_t fss_extended_list_read_process_at_line(fss_extended_list_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) {
if (data->option & fss_extended_list_read_data_option_object_d) {
#endif // _di_fss_extended_list_read_process_at_line_
#ifndef _di_fss_extended_list_read_process_columns_
- f_status_t fss_extended_list_read_process_columns(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
if (!(data->option & fss_extended_list_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_extended_list_read_process_columns_
#ifndef _di_fss_extended_list_read_process_line_
- f_status_t fss_extended_list_read_process_line(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_extended_list_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
#endif // _di_fss_extended_list_read_process_name_
#ifndef _di_fss_extended_list_read_process_option_
- f_status_t fss_extended_list_read_process_option(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
+ f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_extended_list_read_process_option_
#ifndef _di_fss_extended_list_read_process_total_
- f_status_t fss_extended_list_read_process_total(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
* @see fss_extended_list_read_depths_resize()
*/
#ifndef _di_fss_extended_list_read_depth_process_
- extern f_status_t fss_extended_list_read_depth_process(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_depth_process_
/**
* @see fss_extended_list_read_process_option()
*/
#ifndef _di_fss_extended_list_read_load_
- extern f_status_t fss_extended_list_read_load(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_load_
/**
* @see fss_extended_list_read_depths_resize()
*/
#ifndef _di_fss_extended_list_read_load_number_
- extern f_status_t fss_extended_list_read_load_number(fss_extended_list_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_load_number_
/**
* @see fss_extended_list_read_process_option()
*/
#ifndef _di_fss_extended_list_read_process_
- extern f_status_t fss_extended_list_read_process(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_
/**
* @see fss_extended_list_read_process_at_line()
*/
#ifndef _di_fss_extended_list_read_process_at_
- extern f_status_t fss_extended_list_read_process_at(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_at(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_at_
/**
* F_success on success and the line was matched (and possibly printed).
*/
#ifndef _di_fss_extended_list_read_process_at_line_
- extern f_status_t fss_extended_list_read_process_at_line(fss_extended_list_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_extended_list_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_columns_
- extern f_status_t fss_extended_list_read_process_columns(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_columns(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_line_
- extern f_status_t fss_extended_list_read_process_line(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_line(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_line_
/**
* @see fss_extended_list_read_load_setting()
*/
#ifndef _di_fss_extended_list_read_process_option_
- extern f_status_t fss_extended_list_read_process_option(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_list_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_process_total_
- extern f_status_t fss_extended_list_read_process_total(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_read_process_total(fll_program_data_t * const main, fss_extended_list_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_process_total_
#ifdef __cplusplus
const f_string_static_t fss_extended_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_name_long_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_long_s_length);
#endif // _di_fss_extended_list_write_program_name_
-#ifndef _di_fss_extended_list_write_main_delete_
- f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_extended_list_write_defines_
+ const f_string_static_t fss_extended_list_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_end_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_extended_list_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_extended_list_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_content_start_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_extended_list_write_defines_
+
+#ifndef _di_fss_extended_list_write_parameters_
+ const f_string_static_t fss_extended_list_write_short_file_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_file_s, 0, FSS_EXTENDED_LIST_WRITE_short_file_s_length);
+ const f_string_static_t fss_extended_list_write_short_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_content_s, 0, FSS_EXTENDED_LIST_WRITE_short_content_s_length);
+ const f_string_static_t fss_extended_list_write_short_double_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_double_s, 0, FSS_EXTENDED_LIST_WRITE_short_double_s_length);
+ const f_string_static_t fss_extended_list_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_ignore_s, 0, FSS_EXTENDED_LIST_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_extended_list_write_short_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_object_s, 0, FSS_EXTENDED_LIST_WRITE_short_object_s_length);
+ const f_string_static_t fss_extended_list_write_short_partial_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_partial_s, 0, FSS_EXTENDED_LIST_WRITE_short_partial_s_length);
+ const f_string_static_t fss_extended_list_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_prepend_s, 0, FSS_EXTENDED_LIST_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_extended_list_write_short_single_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_single_s, 0, FSS_EXTENDED_LIST_WRITE_short_single_s_length);
+ const f_string_static_t fss_extended_list_write_short_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_short_trim_s, 0, FSS_EXTENDED_LIST_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_extended_list_write_long_file_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_file_s, 0, FSS_EXTENDED_LIST_WRITE_long_file_s_length);
+ const f_string_static_t fss_extended_list_write_long_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_content_s, 0, FSS_EXTENDED_LIST_WRITE_long_content_s_length);
+ const f_string_static_t fss_extended_list_write_long_double_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_double_s, 0, FSS_EXTENDED_LIST_WRITE_long_double_s_length);
+ const f_string_static_t fss_extended_list_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_ignore_s, 0, FSS_EXTENDED_LIST_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_extended_list_write_long_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_object_s, 0, FSS_EXTENDED_LIST_WRITE_long_object_s_length);
+ const f_string_static_t fss_extended_list_write_long_partial_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_partial_s, 0, FSS_EXTENDED_LIST_WRITE_long_partial_s_length);
+ const f_string_static_t fss_extended_list_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_prepend_s, 0, FSS_EXTENDED_LIST_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_extended_list_write_long_single_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_single_s, 0, FSS_EXTENDED_LIST_WRITE_long_single_s_length);
+ const f_string_static_t fss_extended_list_write_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_long_trim_s, 0, FSS_EXTENDED_LIST_WRITE_long_trim_s_length);
+#endif // _di_fss_extended_list_write_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_extended_list_write_main_delete_
+ f_status_t fss_extended_list_write_main_delete(fll_program_data_t *main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_extended_list_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_extended_list_write_program_version_
#define FSS_EXTENDED_LIST_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_EXTENDED_LIST_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_extended_list_write_program_version_s;
#endif // _di_fss_extended_list_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_extended_list_write_program_name_
#define FSS_EXTENDED_LIST_WRITE_program_name_s "fss_extended_list_write"
#define FSS_EXTENDED_LIST_WRITE_program_name_long_s "FSS Extended List Write"
extern const f_string_static_t fss_extended_list_write_program_name_long_s;
#endif // _di_fss_extended_list_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_extended_list_write_defines_
#define fss_extended_list_write_signal_check_d 10000
- #define fss_extended_list_write_pipe_content_end_s '\f'
- #define fss_extended_list_write_pipe_content_ignore_s '\v'
- #define fss_extended_list_write_pipe_content_start_s '\b'
-
- #define fss_extended_list_write_short_file_s "f"
- #define fss_extended_list_write_short_content_s "c"
- #define fss_extended_list_write_short_double_s "d"
- #define fss_extended_list_write_short_ignore_s "I"
- #define fss_extended_list_write_short_object_s "o"
- #define fss_extended_list_write_short_partial_s "p"
- #define fss_extended_list_write_short_prepend_s "P"
- #define fss_extended_list_write_short_single_s "s"
- #define fss_extended_list_write_short_trim_s "T"
-
- #define fss_extended_list_write_long_file_s "file"
- #define fss_extended_list_write_long_content_s "content"
- #define fss_extended_list_write_long_double_s "double"
- #define fss_extended_list_write_long_ignore_s "ignore"
- #define fss_extended_list_write_long_object_s "object"
- #define fss_extended_list_write_long_partial_s "partial"
- #define fss_extended_list_write_long_prepend_s "prepend"
- #define fss_extended_list_write_long_single_s "single"
- #define fss_extended_list_write_long_trim_s "trim"
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_end_s "\f"
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s "\v"
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_start_s "\b"
+
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_end_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_extended_list_write_pipe_content_end_s;
+ extern const f_string_static_t fss_extended_list_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_extended_list_write_pipe_content_start_s;
+#endif // _di_fss_extended_list_write_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_extended_list_write_parameters_
+ #define FSS_EXTENDED_LIST_WRITE_short_file_s "f"
+ #define FSS_EXTENDED_LIST_WRITE_short_content_s "c"
+ #define FSS_EXTENDED_LIST_WRITE_short_double_s "d"
+ #define FSS_EXTENDED_LIST_WRITE_short_ignore_s "I"
+ #define FSS_EXTENDED_LIST_WRITE_short_object_s "o"
+ #define FSS_EXTENDED_LIST_WRITE_short_partial_s "p"
+ #define FSS_EXTENDED_LIST_WRITE_short_prepend_s "P"
+ #define FSS_EXTENDED_LIST_WRITE_short_single_s "s"
+ #define FSS_EXTENDED_LIST_WRITE_short_trim_s "T"
+
+ #define FSS_EXTENDED_LIST_WRITE_long_file_s "file"
+ #define FSS_EXTENDED_LIST_WRITE_long_content_s "content"
+ #define FSS_EXTENDED_LIST_WRITE_long_double_s "double"
+ #define FSS_EXTENDED_LIST_WRITE_long_ignore_s "ignore"
+ #define FSS_EXTENDED_LIST_WRITE_long_object_s "object"
+ #define FSS_EXTENDED_LIST_WRITE_long_partial_s "partial"
+ #define FSS_EXTENDED_LIST_WRITE_long_prepend_s "prepend"
+ #define FSS_EXTENDED_LIST_WRITE_long_single_s "single"
+ #define FSS_EXTENDED_LIST_WRITE_long_trim_s "trim"
+
+ #define FSS_EXTENDED_LIST_WRITE_short_file_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_content_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_double_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_ignore_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_object_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_partial_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_prepend_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_single_s_length 1
+ #define FSS_EXTENDED_LIST_WRITE_short_trim_s_length 1
+
+ #define FSS_EXTENDED_LIST_WRITE_long_file_s_length 4
+ #define FSS_EXTENDED_LIST_WRITE_long_content_s_length 7
+ #define FSS_EXTENDED_LIST_WRITE_long_double_s_length 6
+ #define FSS_EXTENDED_LIST_WRITE_long_ignore_s_length 6
+ #define FSS_EXTENDED_LIST_WRITE_long_object_s_length 6
+ #define FSS_EXTENDED_LIST_WRITE_long_partial_s_length 7
+ #define FSS_EXTENDED_LIST_WRITE_long_prepend_s_length 7
+ #define FSS_EXTENDED_LIST_WRITE_long_single_s_length 6
+ #define FSS_EXTENDED_LIST_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_extended_list_write_short_file_s;
+ extern const f_string_static_t fss_extended_list_write_short_content_s;
+ extern const f_string_static_t fss_extended_list_write_short_double_s;
+ extern const f_string_static_t fss_extended_list_write_short_ignore_s;
+ extern const f_string_static_t fss_extended_list_write_short_object_s;
+ extern const f_string_static_t fss_extended_list_write_short_partial_s;
+ extern const f_string_static_t fss_extended_list_write_short_prepend_s;
+ extern const f_string_static_t fss_extended_list_write_short_single_s;
+ extern const f_string_static_t fss_extended_list_write_short_trim_s;
+
+ extern const f_string_static_t fss_extended_list_write_long_file_s;
+ extern const f_string_static_t fss_extended_list_write_long_content_s;
+ extern const f_string_static_t fss_extended_list_write_long_double_s;
+ extern const f_string_static_t fss_extended_list_write_long_ignore_s;
+ extern const f_string_static_t fss_extended_list_write_long_object_s;
+ extern const f_string_static_t fss_extended_list_write_long_partial_s;
+ extern const f_string_static_t fss_extended_list_write_long_prepend_s;
+ extern const f_string_static_t fss_extended_list_write_long_single_s;
+ extern const f_string_static_t fss_extended_list_write_long_trim_s;
enum {
fss_extended_list_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_file_s.string, fss_extended_list_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s.string, fss_extended_list_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s.string, fss_extended_list_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s.string, fss_extended_list_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s.string, fss_extended_list_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s.string, fss_extended_list_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s.string, fss_extended_list_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s.string, fss_extended_list_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s.string, fss_extended_list_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_extended_list_write_total_parameters_d 18
-#endif // _di_fss_extended_list_write_defines_
-
-#ifndef _di_fss_extended_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_string_static_t prepend;
-
- f_color_context_t context;
- } fss_extended_list_write_main_t;
-
- #define fss_extended_list_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_list_write_main_t_
+#endif // _di_fss_extended_list_write_parameters_
/**
* Deallocate main.
* @see fss_extended_list_write_main()
*/
#ifndef _di_fss_extended_list_write_main_delete_
- extern f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main);
+ extern f_status_t fss_extended_list_write_main_delete(fll_program_data_t *main);
#endif // _di_fss_extended_list_write_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_extended_list_write_program_version_
- const f_string_static_t fss_extended_list_write_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_version_s, 0, FSS_EXTENDED_LIST_WRITE_program_version_s_length);
-#endif // _di_fss_extended_list_write_program_version_
-
-#ifndef _di_fss_extended_list_write_program_name_
- const f_string_static_t fss_extended_list_write_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_name_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_s_length);
- const f_string_static_t fss_extended_list_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_program_name_long_s, 0, FSS_EXTENDED_LIST_WRITE_program_name_long_s_length);
-#endif // _di_fss_extended_list_write_program_name_
-
#ifndef _di_fss_extended_list_write_print_help_
f_status_t fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context) {
#endif // _di_fss_extended_list_write_print_help_
#ifndef _di_fss_extended_list_write_main_
- f_status_t fss_extended_list_write_main(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_extended_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_extended_list_write_parameter_no_color_e, fss_extended_list_write_parameter_light_e, fss_extended_list_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
* @see fss_extended_list_write_main_delete()
*/
#ifndef _di_fss_extended_list_write_main_
- extern f_status_t fss_extended_list_write_main(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_extended_list_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_list_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_extended_list_write_main_t data = fss_extended_list_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_extended_list_write_print_signal_received_
- void fss_extended_list_write_print_signal_received(fss_extended_list_write_main_t * const main, const f_status_t signal) {
+ void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_extended_list_write_print_signal_received_
#ifndef _di_fss_extended_list_write_signal_received_
- f_status_t fss_extended_list_write_signal_received(fss_extended_list_write_main_t * const main) {
+ f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_extended_list_write_print_signal_received_
- extern void fss_extended_list_write_print_signal_received(fss_extended_list_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_extended_list_write_signal_received_
- extern f_status_t fss_extended_list_write_signal_received(fss_extended_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_extended_list_write_error_parameter_same_times_print_
- void fss_extended_list_write_error_parameter_same_times_print(fss_extended_list_write_main_t * const main) {
+ void fss_extended_list_write_error_parameter_same_times_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_list_write_error_parameter_same_times_print_
#ifndef _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
- void fss_extended_list_write_error_parameter_unsupported_eol_print(fss_extended_list_write_main_t * const main) {
+ void fss_extended_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_extended_list_write_error_parameter_value_missing_print_
- void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
+ void fss_extended_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_list_write_error_parameter_value_missing_print_
#ifndef _di_fss_extended_list_write_process_
- f_status_t fss_extended_list_write_process(fss_extended_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
+ f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_extended_list_write_process_
#ifndef _di_fss_extended_list_write_process_pipe_
- f_status_t fss_extended_list_write_process_pipe(fss_extended_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) {
+ f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
#endif // _di_fss_extended_list_write_process_pipe_
#ifndef _di_fss_extended_list_write_process_parameter_ignore_
- f_status_t fss_extended_list_write_process_parameter_ignore(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
+ f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) {
f_status_t status = F_none;
* The main program data.
*/
#ifndef _di_fss_extended_list_write_error_parameter_same_times_print_
- void fss_extended_list_write_error_parameter_same_times_print(fss_extended_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_extended_list_write_error_parameter_same_times_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_error_parameter_same_times_print_
/**
* The main program data.
*/
#ifndef _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
- void fss_extended_list_write_error_parameter_unsupported_eol_print(fss_extended_list_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_extended_list_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_
/**
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_extended_list_write_error_parameter_value_missing_print_
- void fss_extended_list_write_error_parameter_value_missing_print(fss_extended_list_write_main_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ void fss_extended_list_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_static_t symbol, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_error_parameter_value_missing_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_list_write_process_
- extern f_status_t fss_extended_list_write_process(fss_extended_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_list_write_process_pipe_
- extern f_status_t fss_extended_list_write_process_pipe(fss_extended_list_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_process_pipe_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_list_write_process_parameter_ignore_
- extern f_status_t fss_extended_list_write_process_parameter_ignore(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_console_arguments_t *arguments, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_process_parameter_ignore_
#ifdef __cplusplus
const f_string_static_t fss_extended_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_name_long_s, 0, FSS_EXTENDED_READ_program_name_long_s_length);
#endif // _di_fss_extended_read_program_name_
-#ifndef _di_fss_extended_read_main_delete_
- f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_extended_read_defines_
+ const f_string_static_t fss_extended_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_end_s, 0, FSS_EXTENDED_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_extended_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_ignore_s, 0, FSS_EXTENDED_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_extended_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_content_start_s, 0, FSS_EXTENDED_READ_pipe_content_start_s_length);
+#endif // _di_fss_extended_read_defines_
+
+#ifndef _di_fss_extended_read_parameters_
+ const f_string_static_t fss_extended_read_short_at_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_at_s, 0, FSS_EXTENDED_READ_short_at_s_length);
+ const f_string_static_t fss_extended_read_short_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_content_s, 0, FSS_EXTENDED_READ_short_content_s_length);
+ const f_string_static_t fss_extended_read_short_columns_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_columns_s, 0, FSS_EXTENDED_READ_short_columns_s_length);
+ const f_string_static_t fss_extended_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_delimit_s, 0, FSS_EXTENDED_READ_short_delimit_s_length);
+ const f_string_static_t fss_extended_read_short_depth_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_depth_s, 0, FSS_EXTENDED_READ_short_depth_s_length);
+ const f_string_static_t fss_extended_read_short_empty_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_empty_s, 0, FSS_EXTENDED_READ_short_empty_s_length);
+ const f_string_static_t fss_extended_read_short_line_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_line_s, 0, FSS_EXTENDED_READ_short_line_s_length);
+ const f_string_static_t fss_extended_read_short_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_name_s, 0, FSS_EXTENDED_READ_short_name_s_length);
+ const f_string_static_t fss_extended_read_short_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_object_s, 0, FSS_EXTENDED_READ_short_object_s_length);
+ const f_string_static_t fss_extended_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_pipe_s, 0, FSS_EXTENDED_READ_short_pipe_s_length);
+ const f_string_static_t fss_extended_read_short_raw_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_raw_s, 0, FSS_EXTENDED_READ_short_raw_s_length);
+ const f_string_static_t fss_extended_read_short_select_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_select_s, 0, FSS_EXTENDED_READ_short_select_s_length);
+ const f_string_static_t fss_extended_read_short_total_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_total_s, 0, FSS_EXTENDED_READ_short_total_s_length);
+ const f_string_static_t fss_extended_read_short_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_short_trim_s, 0, FSS_EXTENDED_READ_short_trim_s_length);
+
+ const f_string_static_t fss_extended_read_long_at_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_at_s, 0, FSS_EXTENDED_READ_long_at_s_length);
+ const f_string_static_t fss_extended_read_long_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_content_s, 0, FSS_EXTENDED_READ_long_content_s_length);
+ const f_string_static_t fss_extended_read_long_columns_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_columns_s, 0, FSS_EXTENDED_READ_long_columns_s_length);
+ const f_string_static_t fss_extended_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_delimit_s, 0, FSS_EXTENDED_READ_long_delimit_s_length);
+ const f_string_static_t fss_extended_read_long_depth_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_depth_s, 0, FSS_EXTENDED_READ_long_depth_s_length);
+ const f_string_static_t fss_extended_read_long_empty_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_empty_s, 0, FSS_EXTENDED_READ_long_empty_s_length);
+ const f_string_static_t fss_extended_read_long_line_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_line_s, 0, FSS_EXTENDED_READ_long_line_s_length);
+ const f_string_static_t fss_extended_read_long_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_name_s, 0, FSS_EXTENDED_READ_long_name_s_length);
+ const f_string_static_t fss_extended_read_long_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_object_s, 0, FSS_EXTENDED_READ_long_object_s_length);
+ const f_string_static_t fss_extended_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_pipe_s, 0, FSS_EXTENDED_READ_long_pipe_s_length);
+ const f_string_static_t fss_extended_read_long_raw_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_raw_s, 0, FSS_EXTENDED_READ_long_raw_s_length);
+ const f_string_static_t fss_extended_read_long_select_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_select_s, 0, FSS_EXTENDED_READ_long_select_s_length);
+ const f_string_static_t fss_extended_read_long_total_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_total_s, 0, FSS_EXTENDED_READ_long_total_s_length);
+ const f_string_static_t fss_extended_read_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_long_trim_s, 0, FSS_EXTENDED_READ_long_trim_s_length);
+#endif // _di_fss_extended_read_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_extended_read_main_delete_
+ f_status_t fss_extended_read_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_extended_read_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_extended_read_program_version_
#define FSS_EXTENDED_READ_program_version_major_s F_string_ascii_0_s
#define FSS_EXTENDED_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_extended_read_program_version_s;
#endif // _di_fss_extended_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_extended_read_program_name_
#define FSS_EXTENDED_READ_program_name_s "fss_extended_read"
#define FSS_EXTENDED_READ_program_name_long_s "FSS Extended Read"
extern const f_string_static_t fss_extended_read_program_name_long_s;
#endif // _di_fss_extended_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_extended_read_defines_
#define fss_extended_read_signal_check_d 10000
- #define fss_extended_read_pipe_content_end_s '\f'
- #define fss_extended_read_pipe_content_ignore_s '\v'
- #define fss_extended_read_pipe_content_start_s '\b'
-
- #define fss_extended_read_short_at_s "a"
- #define fss_extended_read_short_content_s "c"
- #define fss_extended_read_short_columns_s "C"
- #define fss_extended_read_short_delimit_s "D"
- #define fss_extended_read_short_depth_s "d"
- #define fss_extended_read_short_empty_s "e"
- #define fss_extended_read_short_line_s "l"
- #define fss_extended_read_short_name_s "n"
- #define fss_extended_read_short_object_s "o"
- #define fss_extended_read_short_pipe_s "p"
- #define fss_extended_read_short_raw_s "R"
- #define fss_extended_read_short_select_s "s"
- #define fss_extended_read_short_total_s "t"
- #define fss_extended_read_short_trim_s "T"
-
- #define fss_extended_read_long_at_s "at"
- #define fss_extended_read_long_content_s "content"
- #define fss_extended_read_long_columns_s "columns"
- #define fss_extended_read_long_delimit_s "delimit"
- #define fss_extended_read_long_depth_s "depth"
- #define fss_extended_read_long_empty_s "empty"
- #define fss_extended_read_long_line_s "line"
- #define fss_extended_read_long_name_s "name"
- #define fss_extended_read_long_object_s "object"
- #define fss_extended_read_long_pipe_s "pipe"
- #define fss_extended_read_long_raw_s "raw"
- #define fss_extended_read_long_select_s "select"
- #define fss_extended_read_long_total_s "total"
- #define fss_extended_read_long_trim_s "trim"
+ #define FSS_EXTENDED_READ_pipe_content_end_s "\f"
+ #define FSS_EXTENDED_READ_pipe_content_ignore_s "\v"
+ #define FSS_EXTENDED_READ_pipe_content_start_s "\b"
+
+ #define FSS_EXTENDED_READ_pipe_content_end_s_length 1
+ #define FSS_EXTENDED_READ_pipe_content_ignore_s_length 1
+ #define FSS_EXTENDED_READ_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_extended_read_pipe_content_end_s;
+ extern const f_string_static_t fss_extended_read_pipe_content_ignore_s;
+ extern const f_string_static_t fss_extended_read_pipe_content_start_s;
+#endif // _di_fss_extended_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_extended_read_parameters_
+ #define FSS_EXTENDED_READ_short_at_s "a"
+ #define FSS_EXTENDED_READ_short_content_s "c"
+ #define FSS_EXTENDED_READ_short_columns_s "C"
+ #define FSS_EXTENDED_READ_short_delimit_s "D"
+ #define FSS_EXTENDED_READ_short_depth_s "d"
+ #define FSS_EXTENDED_READ_short_empty_s "e"
+ #define FSS_EXTENDED_READ_short_line_s "l"
+ #define FSS_EXTENDED_READ_short_name_s "n"
+ #define FSS_EXTENDED_READ_short_object_s "o"
+ #define FSS_EXTENDED_READ_short_pipe_s "p"
+ #define FSS_EXTENDED_READ_short_raw_s "R"
+ #define FSS_EXTENDED_READ_short_select_s "s"
+ #define FSS_EXTENDED_READ_short_total_s "t"
+ #define FSS_EXTENDED_READ_short_trim_s "T"
+
+ #define FSS_EXTENDED_READ_long_at_s "at"
+ #define FSS_EXTENDED_READ_long_content_s "content"
+ #define FSS_EXTENDED_READ_long_columns_s "columns"
+ #define FSS_EXTENDED_READ_long_delimit_s "delimit"
+ #define FSS_EXTENDED_READ_long_depth_s "depth"
+ #define FSS_EXTENDED_READ_long_empty_s "empty"
+ #define FSS_EXTENDED_READ_long_line_s "line"
+ #define FSS_EXTENDED_READ_long_name_s "name"
+ #define FSS_EXTENDED_READ_long_object_s "object"
+ #define FSS_EXTENDED_READ_long_pipe_s "pipe"
+ #define FSS_EXTENDED_READ_long_raw_s "raw"
+ #define FSS_EXTENDED_READ_long_select_s "select"
+ #define FSS_EXTENDED_READ_long_total_s "total"
+ #define FSS_EXTENDED_READ_long_trim_s "trim"
+
+ #define FSS_EXTENDED_READ_short_at_s_length 1
+ #define FSS_EXTENDED_READ_short_content_s_length 1
+ #define FSS_EXTENDED_READ_short_columns_s_length 1
+ #define FSS_EXTENDED_READ_short_delimit_s_length 1
+ #define FSS_EXTENDED_READ_short_depth_s_length 1
+ #define FSS_EXTENDED_READ_short_empty_s_length 1
+ #define FSS_EXTENDED_READ_short_line_s_length 1
+ #define FSS_EXTENDED_READ_short_name_s_length 1
+ #define FSS_EXTENDED_READ_short_object_s_length 1
+ #define FSS_EXTENDED_READ_short_pipe_s_length 1
+ #define FSS_EXTENDED_READ_short_raw_s_length 1
+ #define FSS_EXTENDED_READ_short_select_s_length 1
+ #define FSS_EXTENDED_READ_short_total_s_length 1
+ #define FSS_EXTENDED_READ_short_trim_s_length 1
+
+ #define FSS_EXTENDED_READ_long_at_s_length 2
+ #define FSS_EXTENDED_READ_long_content_s_length 7
+ #define FSS_EXTENDED_READ_long_columns_s_length 7
+ #define FSS_EXTENDED_READ_long_delimit_s_length 7
+ #define FSS_EXTENDED_READ_long_depth_s_length 5
+ #define FSS_EXTENDED_READ_long_empty_s_length 5
+ #define FSS_EXTENDED_READ_long_line_s_length 4
+ #define FSS_EXTENDED_READ_long_name_s_length 4
+ #define FSS_EXTENDED_READ_long_object_s_length 6
+ #define FSS_EXTENDED_READ_long_pipe_s_length 4
+ #define FSS_EXTENDED_READ_long_raw_s_length 3
+ #define FSS_EXTENDED_READ_long_select_s_length 6
+ #define FSS_EXTENDED_READ_long_total_s_length 5
+ #define FSS_EXTENDED_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_extended_read_short_at_s;
+ extern const f_string_static_t fss_extended_read_short_content_s;
+ extern const f_string_static_t fss_extended_read_short_columns_s;
+ extern const f_string_static_t fss_extended_read_short_delimit_s;
+ extern const f_string_static_t fss_extended_read_short_depth_s;
+ extern const f_string_static_t fss_extended_read_short_empty_s;
+ extern const f_string_static_t fss_extended_read_short_line_s;
+ extern const f_string_static_t fss_extended_read_short_name_s;
+ extern const f_string_static_t fss_extended_read_short_object_s;
+ extern const f_string_static_t fss_extended_read_short_pipe_s;
+ extern const f_string_static_t fss_extended_read_short_raw_s;
+ extern const f_string_static_t fss_extended_read_short_select_s;
+ extern const f_string_static_t fss_extended_read_short_total_s;
+ extern const f_string_static_t fss_extended_read_short_trim_s;
+
+ extern const f_string_static_t fss_extended_read_long_at_s;
+ extern const f_string_static_t fss_extended_read_long_content_s;
+ extern const f_string_static_t fss_extended_read_long_columns_s;
+ extern const f_string_static_t fss_extended_read_long_delimit_s;
+ extern const f_string_static_t fss_extended_read_long_depth_s;
+ extern const f_string_static_t fss_extended_read_long_empty_s;
+ extern const f_string_static_t fss_extended_read_long_line_s;
+ extern const f_string_static_t fss_extended_read_long_name_s;
+ extern const f_string_static_t fss_extended_read_long_object_s;
+ extern const f_string_static_t fss_extended_read_long_pipe_s;
+ extern const f_string_static_t fss_extended_read_long_raw_s;
+ extern const f_string_static_t fss_extended_read_long_select_s;
+ extern const f_string_static_t fss_extended_read_long_total_s;
+ extern const f_string_static_t fss_extended_read_long_trim_s;
enum {
fss_extended_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_at_s, fss_extended_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s, fss_extended_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s, fss_extended_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s, fss_extended_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s, fss_extended_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s, fss_extended_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_at_s.string, fss_extended_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s.string, fss_extended_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s.string, fss_extended_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s.string, fss_extended_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s.string, fss_extended_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s.string, fss_extended_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s.string, fss_extended_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s.string, fss_extended_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s.string, fss_extended_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s.string, fss_extended_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s.string, fss_extended_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s.string, fss_extended_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s.string, fss_extended_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s.string, fss_extended_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_extended_read_total_parameters_d 23
-#endif // _di_fss_extended_read_defines_
+#endif // _di_fss_extended_read_parameters_
/**
* FSS Delimit Parameter data.
};
#endif // _di_fss_extended_read_delimit_modes_
-
-#ifndef _di_fss_extended_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_extended_read_main_t;
-
- #define fss_extended_read_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_read_main_t_
-
/**
* Deallocate main.
*
* @see fss_extended_read_main()
*/
#ifndef _di_fss_extended_read_main_delete_
- extern f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main);
+ extern f_status_t fss_extended_read_main_delete(fll_program_data_t * const main);
#endif // _di_fss_extended_read_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_extended_read_program_version_
- const f_string_static_t fss_extended_read_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_version_s, 0, FSS_EXTENDED_READ_program_version_s_length);
-#endif // _di_fss_extended_read_program_version_
-
-#ifndef _di_fss_extended_read_program_name_
- const f_string_static_t fss_extended_read_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_name_s, 0, FSS_EXTENDED_READ_program_name_s_length);
- const f_string_static_t fss_extended_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_program_name_long_s, 0, FSS_EXTENDED_READ_program_name_long_s_length);
-#endif // _di_fss_extended_read_program_name_
-
#ifndef _di_fss_extended_read_print_help_
f_status_t fss_extended_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_extended_read_short_total_s, fss_extended_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_extended_read_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_extended_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
#endif // _di_fss_extended_read_print_help_
#ifndef _di_fss_extended_read_main_
- f_status_t fss_extended_read_main(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_extended_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_extended_read_parameter_no_color_e, fss_extended_read_parameter_light_e, fss_extended_read_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
- fss_extended_read_file_t files_array[main->remaining.used + 1];
+ fss_extended_read_file_t files_array[main->parameters.remaining.used + 1];
fss_extended_read_data_t data = fss_extended_read_data_t_initialize;
data.files.array = files_array;
data.files.used = 1;
- data.files.size = main->remaining.used + 1;
+ data.files.size = main->parameters.remaining.used + 1;
data.files.array[0].name = "(pipe)";
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
{
const f_array_length_t parameter_code[] = {
fss_extended_read_parameter_at_e,
}
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
uint16_t signal_check = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_extended_read_signal_check_d)) {
if (fss_extended_read_signal_received(main)) {
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->remaining.array[i]];
+ data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
// This standard is newline sensitive, when appending files to the buffer if the file lacks a final newline then this could break the format for files appended thereafter.
*
* This is the FSS Basic Read program
* This program utilizes the Featureless Linux Library.
- * This program processes files or other input in fss format and stores the results in the fss_extended_read_main_t.
+ * This program processes files or other input in fss format and stores the results in the fll_program_data_t.
*
* This processes in accordance to the FSS-0001 Extended specification.
*/
* @see fss_extended_read_main_delete()
*/
#ifndef _di_fss_extended_read_main_
- extern f_status_t fss_extended_read_main(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_extended_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_read_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fss_extended_read_main_t data = fss_extended_read_main_t_initialize;
+ fll_program_data_t data = fss_extended_read_main_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_extended_read_depths_resize_
#ifndef _di_fss_extended_read_print_signal_received_
- void fss_extended_read_print_signal_received(fss_extended_read_main_t * const main, const f_status_t signal) {
+ void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_extended_read_print_signal_received_
#ifndef _di_fss_extended_read_signal_received_
- f_status_t fss_extended_read_signal_received(fss_extended_read_main_t * const main) {
+ f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_extended_read_print_signal_received_
- extern void fss_extended_read_print_signal_received(fss_extended_read_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_extended_read_signal_received_
- extern f_status_t fss_extended_read_signal_received(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_extended_read_print_at_
- void fss_extended_read_print_at(fss_extended_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_read_data_t * const data) {
+ void fss_extended_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_read_data_t * const data) {
if (at >= data->contents.used) {
return;
#endif // _di_fss_extended_read_print_at_
#ifndef _di_fss_extended_read_print_at_total_
- f_status_t fss_extended_read_print_at_total(fss_extended_read_main_t * const main, const f_array_length_t at, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_print_at_total(fll_program_data_t * const main, const f_array_length_t at, fss_extended_read_data_t *data) {
if (data->option & fss_extended_read_data_option_select_d) {
if (data->option & fss_extended_read_data_option_object_d) {
#endif // _di_fss_extended_read_print_at_total_
#ifndef _di_fss_extended_read_print_content_end_
- void fss_extended_read_print_content_end(fss_extended_read_main_t * const main) {
+ void fss_extended_read_print_content_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_read_pipe_content_start_s, main->output.to.stream);
#endif // _di_fss_extended_read_print_content_end_
#ifndef _di_fss_extended_read_print_object_end_
- void fss_extended_read_print_object_end(fss_extended_read_main_t * const main) {
+ void fss_extended_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_extended_read_print_object_end_
#ifndef _di_fss_extended_read_print_one_
- void fss_extended_read_print_one(fss_extended_read_main_t * const main) {
+ void fss_extended_read_print_one(fll_program_data_t * const main) {
f_print_character(f_string_ascii_1_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#endif // _di_fss_extended_read_print_one_
#ifndef _di_fss_extended_read_print_set_end_
- void fss_extended_read_print_set_end(fss_extended_read_main_t * const main) {
+ void fss_extended_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_extended_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_extended_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_extended_read_print_set_end_
#ifndef _di_fss_extended_read_print_zero_
- void fss_extended_read_print_zero(fss_extended_read_main_t * const main) {
+ void fss_extended_read_print_zero(fll_program_data_t * const main) {
f_print_character(f_string_ascii_0_s.string[0], main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
* The program data.
*/
#ifndef _di_fss_extended_read_print_at_
- extern void fss_extended_read_print_at(fss_extended_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_at(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_extended_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_at_
/**
* F_success on success and something was matched (and total was printed).
*/
#ifndef _di_fss_extended_read_print_at_total_
- extern f_status_t fss_extended_read_print_at_total(fss_extended_read_main_t * const main, const f_array_length_t at, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_print_at_total(fll_program_data_t * const main, const f_array_length_t at, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_at_total_
/**
* The main program data.
*/
#ifndef _di_fss_extended_read_print_content_end_
- extern void fss_extended_read_print_content_end(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_content_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_content_end_
/**
* The main program data.
*/
#ifndef _di_fss_extended_read_print_object_end_
- extern void fss_extended_read_print_object_end(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_object_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_object_end_
/**
* The main program data.
*/
#ifndef _di_fss_extended_read_print_one_
- extern void fss_extended_read_print_one(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_one(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_one_
/**
* The main program data.
*/
#ifndef _di_fss_extended_read_print_set_end_
- extern void fss_extended_read_print_set_end(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_set_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_set_end_
/**
* The main program data.
*/
#ifndef _di_fss_extended_read_print_zero_
- extern void fss_extended_read_print_zero(fss_extended_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_zero(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_zero_
#ifdef __cplusplus
#endif // _di_fss_extended_read_delimit_content_is_
#ifndef _di_fss_extended_read_depth_process_
- f_status_t fss_extended_read_depth_process(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_extended_read_file_identify_
#ifndef _di_fss_extended_read_load_
- f_status_t fss_extended_read_load(fss_extended_read_main_t * const main, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) {
f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#endif // _di_fss_extended_read_load_
#ifndef _di_fss_extended_read_load_number_
- f_status_t fss_extended_read_load_number(fss_extended_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
#endif // _di_fss_extended_read_load_number_
#ifndef _di_fss_extended_read_process_
- f_status_t fss_extended_read_process(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
f_status_t status = fss_extended_read_process_option(main, arguments, data);
if (F_status_is_error(status)) return status;
#endif // _di_fss_extended_read_process_
#ifndef _di_fss_extended_read_process_at_
- f_status_t fss_extended_read_process_at(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_extended_read_data_option_columns_d | fss_extended_read_data_option_total_d)) {
#endif // _di_fss_extended_read_process_at_
#ifndef _di_fss_extended_read_process_columns_
- f_status_t fss_extended_read_process_columns(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
if (!(data->option & fss_extended_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_extended_read_process_columns_
#ifndef _di_fss_extended_read_process_line_
- f_status_t fss_extended_read_process_line(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_extended_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
#endif // _di_fss_extended_read_process_name_
#ifndef _di_fss_extended_read_process_option_
- f_status_t fss_extended_read_process_option(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
+ f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_extended_read_process_option_
#ifndef _di_fss_extended_read_process_total_
- f_status_t fss_extended_read_process_total(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) {
+ f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
* @see fss_extended_read_depths_resize()
*/
#ifndef _di_fss_extended_read_depth_process_
- extern f_status_t fss_extended_read_depth_process(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_depth_process_
/**
* @see fss_extended_read_process_option()
*/
#ifndef _di_fss_extended_read_load_
- extern f_status_t fss_extended_read_load(fss_extended_read_main_t * const main, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_load_
/**
* @see fss_extended_read_depths_resize()
*/
#ifndef _di_fss_extended_read_load_number_
- extern f_status_t fss_extended_read_load_number(fss_extended_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_load_number_
/**
* @see fss_extended_read_process_option()
*/
#ifndef _di_fss_extended_read_process_
- extern f_status_t fss_extended_read_process(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_at_
- extern f_status_t fss_extended_read_process_at(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_at(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_at_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_columns_
- extern f_status_t fss_extended_read_process_columns(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_columns(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_line_
- extern f_status_t fss_extended_read_process_line(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_line(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_line_
/**
* @see fss_extended_read_load_setting()
*/
#ifndef _di_fss_extended_read_process_option_
- extern f_status_t fss_extended_read_process_option(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_extended_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_extended_read_process_total_
- extern f_status_t fss_extended_read_process_total(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_process_total(fll_program_data_t * const main, fss_extended_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_process_total_
/**
* F_false if not delimited.
*/
#ifndef _di_fss_extended_read_is_delimited_at_depth_
- extern f_status_t fss_extended_read_is_delimited_at_depth(fss_extended_read_main_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_is_delimited_at_depth(fll_program_data_t * const main, const f_array_length_t depth) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_is_delimited_at_depth_
/**
* @see fss_extended_read_main_preprocess_depth()
*/
#ifndef _di_fss_extended_read_main_process_file_
- extern f_status_t fss_extended_read_main_process_file(fss_extended_read_main_t * const main, const f_console_arguments_t arguments, const f_string_t file_name, const fss_extended_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_read_main_process_file(fll_program_data_t * const main, const f_console_arguments_t arguments, const f_string_t file_name, const fss_extended_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_main_process_file_
#ifdef __cplusplus
const f_string_static_t fss_extended_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_name_long_s, 0, FSS_EXTENDED_WRITE_program_name_long_s_length);
#endif // _di_fss_extended_write_program_name_
-#ifndef _di_fss_extended_write_main_delete_
- f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_extended_write_defines_
+ const f_string_static_t fss_extended_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_end_s, 0, FSS_EXTENDED_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_extended_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_ignore_s, 0, FSS_EXTENDED_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_extended_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_content_start_s, 0, FSS_EXTENDED_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_extended_write_defines_
+
+#ifndef _di_fss_extended_write_parameters_
+ const f_string_static_t fss_extended_write_short_file_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_file_s, 0, FSS_EXTENDED_WRITE_short_file_s_length);
+ const f_string_static_t fss_extended_write_short_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_content_s, 0, FSS_EXTENDED_WRITE_short_content_s_length);
+ const f_string_static_t fss_extended_write_short_double_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_double_s, 0, FSS_EXTENDED_WRITE_short_double_s_length);
+ const f_string_static_t fss_extended_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_ignore_s, 0, FSS_EXTENDED_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_extended_write_short_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_object_s, 0, FSS_EXTENDED_WRITE_short_object_s_length);
+ const f_string_static_t fss_extended_write_short_partial_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_partial_s, 0, FSS_EXTENDED_WRITE_short_partial_s_length);
+ const f_string_static_t fss_extended_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_prepend_s, 0, FSS_EXTENDED_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_extended_write_short_single_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_single_s, 0, FSS_EXTENDED_WRITE_short_single_s_length);
+ const f_string_static_t fss_extended_write_short_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_short_trim_s, 0, FSS_EXTENDED_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_extended_write_long_file_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_file_s, 0, FSS_EXTENDED_WRITE_long_file_s_length);
+ const f_string_static_t fss_extended_write_long_content_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_content_s, 0, FSS_EXTENDED_WRITE_long_content_s_length);
+ const f_string_static_t fss_extended_write_long_double_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_double_s, 0, FSS_EXTENDED_WRITE_long_double_s_length);
+ const f_string_static_t fss_extended_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_ignore_s, 0, FSS_EXTENDED_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_extended_write_long_object_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_object_s, 0, FSS_EXTENDED_WRITE_long_object_s_length);
+ const f_string_static_t fss_extended_write_long_partial_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_partial_s, 0, FSS_EXTENDED_WRITE_long_partial_s_length);
+ const f_string_static_t fss_extended_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_prepend_s, 0, FSS_EXTENDED_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_extended_write_long_single_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_single_s, 0, FSS_EXTENDED_WRITE_long_single_s_length);
+ const f_string_static_t fss_extended_write_long_trim_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_long_trim_s, 0, FSS_EXTENDED_WRITE_long_trim_s_length);
+#endif // _di_fss_extended_write_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_extended_write_main_delete_
+ f_status_t fss_extended_write_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_extended_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_extended_write_program_version_
#define FSS_EXTENDED_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_EXTENDED_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_extended_write_program_version_s;
#endif // _di_fss_extended_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_extended_write_program_name_
#define FSS_EXTENDED_WRITE_program_name_s "fss_extended_write"
#define FSS_EXTENDED_WRITE_program_name_long_s "FSS Extended Write"
extern const f_string_static_t fss_extended_write_program_name_long_s;
#endif // _di_fss_extended_write_program_name_
+/**
+ * The main program defines.
+ */
#ifndef _di_fss_extended_write_defines_
#define fss_extended_write_signal_check_d 10000
- #define fss_extended_write_pipe_content_end_s '\f'
- #define fss_extended_write_pipe_content_ignore_s '\v'
- #define fss_extended_write_pipe_content_start_s '\b'
-
- #define fss_extended_write_short_file_s "f"
- #define fss_extended_write_short_content_s "c"
- #define fss_extended_write_short_double_s "d"
- #define fss_extended_write_short_ignore_s "I"
- #define fss_extended_write_short_object_s "o"
- #define fss_extended_write_short_partial_s "p"
- #define fss_extended_write_short_prepend_s "P"
- #define fss_extended_write_short_single_s "s"
- #define fss_extended_write_short_trim_s "T"
-
- #define fss_extended_write_long_file_s "file"
- #define fss_extended_write_long_content_s "content"
- #define fss_extended_write_long_double_s "double"
- #define fss_extended_write_long_ignore_s "ignore"
- #define fss_extended_write_long_object_s "object"
- #define fss_extended_write_long_partial_s "partial"
- #define fss_extended_write_long_prepend_s "prepend"
- #define fss_extended_write_long_single_s "single"
- #define fss_extended_write_long_trim_s "trim"
+ #define FSS_EXTENDED_WRITE_pipe_content_end_s "\f"
+ #define FSS_EXTENDED_WRITE_pipe_content_ignore_s "\v"
+ #define FSS_EXTENDED_WRITE_pipe_content_start_s "\b"
+
+ #define FSS_EXTENDED_WRITE_pipe_content_end_s_length 1
+ #define FSS_EXTENDED_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_EXTENDED_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_extended_write_pipe_content_end_s;
+ extern const f_string_static_t fss_extended_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_extended_write_pipe_content_start_s;
+#endif // _di_fss_extended_write_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_extended_write_parameters_
+ #define FSS_EXTENDED_WRITE_short_file_s "f"
+ #define FSS_EXTENDED_WRITE_short_content_s "c"
+ #define FSS_EXTENDED_WRITE_short_double_s "d"
+ #define FSS_EXTENDED_WRITE_short_ignore_s "I"
+ #define FSS_EXTENDED_WRITE_short_object_s "o"
+ #define FSS_EXTENDED_WRITE_short_partial_s "p"
+ #define FSS_EXTENDED_WRITE_short_prepend_s "P"
+ #define FSS_EXTENDED_WRITE_short_single_s "s"
+ #define FSS_EXTENDED_WRITE_short_trim_s "T"
+
+ #define FSS_EXTENDED_WRITE_long_file_s "file"
+ #define FSS_EXTENDED_WRITE_long_content_s "content"
+ #define FSS_EXTENDED_WRITE_long_double_s "double"
+ #define FSS_EXTENDED_WRITE_long_ignore_s "ignore"
+ #define FSS_EXTENDED_WRITE_long_object_s "object"
+ #define FSS_EXTENDED_WRITE_long_partial_s "partial"
+ #define FSS_EXTENDED_WRITE_long_prepend_s "prepend"
+ #define FSS_EXTENDED_WRITE_long_single_s "single"
+ #define FSS_EXTENDED_WRITE_long_trim_s "trim"
+
+ #define FSS_EXTENDED_WRITE_short_file_s_length 1
+ #define FSS_EXTENDED_WRITE_short_content_s_length 1
+ #define FSS_EXTENDED_WRITE_short_double_s_length 1
+ #define FSS_EXTENDED_WRITE_short_ignore_s_length 1
+ #define FSS_EXTENDED_WRITE_short_object_s_length 1
+ #define FSS_EXTENDED_WRITE_short_partial_s_length 1
+ #define FSS_EXTENDED_WRITE_short_prepend_s_length 1
+ #define FSS_EXTENDED_WRITE_short_single_s_length 1
+ #define FSS_EXTENDED_WRITE_short_trim_s_length 1
+
+ #define FSS_EXTENDED_WRITE_long_file_s_length 4
+ #define FSS_EXTENDED_WRITE_long_content_s_length 7
+ #define FSS_EXTENDED_WRITE_long_double_s_length 6
+ #define FSS_EXTENDED_WRITE_long_ignore_s_length 6
+ #define FSS_EXTENDED_WRITE_long_object_s_length 6
+ #define FSS_EXTENDED_WRITE_long_partial_s_length 7
+ #define FSS_EXTENDED_WRITE_long_prepend_s_length 7
+ #define FSS_EXTENDED_WRITE_long_single_s_length 6
+ #define FSS_EXTENDED_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_extended_write_short_file_s;
+ extern const f_string_static_t fss_extended_write_short_content_s;
+ extern const f_string_static_t fss_extended_write_short_double_s;
+ extern const f_string_static_t fss_extended_write_short_ignore_s;
+ extern const f_string_static_t fss_extended_write_short_object_s;
+ extern const f_string_static_t fss_extended_write_short_partial_s;
+ extern const f_string_static_t fss_extended_write_short_prepend_s;
+ extern const f_string_static_t fss_extended_write_short_single_s;
+ extern const f_string_static_t fss_extended_write_short_trim_s;
+
+ extern const f_string_static_t fss_extended_write_long_file_s;
+ extern const f_string_static_t fss_extended_write_long_content_s;
+ extern const f_string_static_t fss_extended_write_long_double_s;
+ extern const f_string_static_t fss_extended_write_long_ignore_s;
+ extern const f_string_static_t fss_extended_write_long_object_s;
+ extern const f_string_static_t fss_extended_write_long_partial_s;
+ extern const f_string_static_t fss_extended_write_long_prepend_s;
+ extern const f_string_static_t fss_extended_write_long_single_s;
+ extern const f_string_static_t fss_extended_write_long_trim_s;
enum {
fss_extended_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, F_false, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s, fss_extended_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s, fss_extended_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s, fss_extended_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s, fss_extended_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s, fss_extended_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s.string, fss_extended_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s.string, fss_extended_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s.string, fss_extended_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s.string, fss_extended_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s.string, fss_extended_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s.string, fss_extended_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s.string, fss_extended_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s.string, fss_extended_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s.string, fss_extended_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_extended_write_total_parameters_d 18
-#endif // _di_fss_extended_write_defines_
-
-#ifndef _di_fss_extended_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_string_static_t prepend;
-
- f_color_context_t context;
- } fss_extended_write_main_t;
-
- #define fss_extended_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_write_main_t_
+#endif // _di_fss_extended_write_parameters_
/**
* Deallocate main.
* @see fss_extended_write_main()
*/
#ifndef _di_fss_extended_write_main_delete_
- extern f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main);
+ extern f_status_t fss_extended_write_main_delete(fll_program_data_t * const main);
#endif // _di_fss_extended_write_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_extended_write_program_version_
- const f_string_static_t fss_extended_write_program_version_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_version_s, 0, FSS_EXTENDED_WRITE_program_version_s_length);
-#endif // _di_fss_extended_write_program_version_
-
-#ifndef _di_fss_extended_write_program_name_
- const f_string_static_t fss_extended_write_program_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_name_s, 0, FSS_EXTENDED_WRITE_program_name_s_length);
- const f_string_static_t fss_extended_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_program_name_long_s, 0, FSS_EXTENDED_WRITE_program_name_long_s_length);
-#endif // _di_fss_extended_write_program_name_
-
#ifndef _di_fss_extended_write_print_help_
f_status_t fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) {
#endif // _di_fss_extended_write_print_help_
#ifndef _di_fss_extended_write_main_
- f_status_t fss_extended_write_main(fss_extended_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_extended_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_extended_write_parameter_no_color_e, fss_extended_write_parameter_light_e, fss_extended_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
* @see fss_extended_write_main_delete()
*/
#ifndef _di_fss_extended_write_main_
- extern f_status_t fss_extended_write_main(fss_extended_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_extended_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_extended_write_main_t data = fss_extended_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_extended_write_print_signal_received_
- void fss_extended_write_print_signal_received(fss_extended_write_main_t * const main, const f_status_t signal) {
+ void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_extended_write_print_signal_received_
#ifndef _di_fss_extended_write_signal_received_
- f_status_t fss_extended_write_signal_received(fss_extended_write_main_t * const main) {
+ f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_extended_write_print_signal_received_
- extern void fss_extended_write_print_signal_received(fss_extended_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_extended_write_signal_received_
- extern f_status_t fss_extended_write_signal_received(fss_extended_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_extended_write_error_parameter_at_least_once_print_
- void fss_extended_write_error_parameter_at_least_once(fss_extended_write_main_t * const main) {
+ void fss_extended_write_error_parameter_at_least_once(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
#ifndef _di_fss_extended_write_error_parameter_value_missing_print_
- void fss_extended_write_error_parameter_value_missing_print(fss_extended_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_write_error_parameter_value_missing_print_
#ifndef _di_fss_extended_write_error_parameter_unsupported_eol_print_
- void fss_extended_write_error_parameter_unsupported_eol_print(fss_extended_write_main_t * const main) {
+ void fss_extended_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_extended_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_extended_write_process_
- f_status_t fss_extended_write_process(fss_extended_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) {
+ f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_extended_write_process_
#ifndef _di_fss_extended_write_process_pipe_
- f_status_t fss_extended_write_process_pipe(fss_extended_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
+ f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_error_parameter_at_least_once_print_
- void fss_extended_write_error_parameter_at_least_once(fss_extended_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_extended_write_error_parameter_at_least_once(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_error_parameter_at_least_once_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_error_parameter_value_missing_print_
- void fss_extended_write_error_parameter_value_missing_print(fss_extended_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_extended_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_error_parameter_value_missing_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_error_parameter_unsupported_eol_print_
- void fss_extended_write_error_parameter_unsupported_eol_print(fss_extended_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_extended_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_error_parameter_unsupported_eol_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_process_
- extern f_status_t fss_extended_write_process(fss_extended_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_extended_write_process_pipe_
- extern f_status_t fss_extended_write_process_pipe(fss_extended_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_extended_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_process_pipe_
#ifdef __cplusplus
const f_string_static_t fss_identify_program_name_long_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_name_long_s, 0, FSS_IDENTIFY_program_name_long_s_length);
#endif // _di_fss_identify_program_name_
-#ifndef _di_fss_identify_main_delete_
- f_status_t fss_identify_main_delete(fss_identify_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_fss_identify_parameters_
+ const f_string_static_t fss_identify_short_content_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_short_content_s, 0, FSS_IDENTIFY_short_content_s_length);
+ const f_string_static_t fss_identify_short_line_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_short_line_s, 0, FSS_IDENTIFY_short_line_s_length);
+ const f_string_static_t fss_identify_short_name_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_short_name_s, 0, FSS_IDENTIFY_short_name_s_length);
+ const f_string_static_t fss_identify_short_object_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_short_object_s, 0, FSS_IDENTIFY_short_object_s_length);
+ const f_string_static_t fss_identify_short_total_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_short_total_s, 0, FSS_IDENTIFY_short_total_s_length);
+
+ const f_string_static_t fss_identify_long_content_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_long_content_s, 0, FSS_IDENTIFY_long_content_s_length);
+ const f_string_static_t fss_identify_long_line_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_long_line_s, 0, FSS_IDENTIFY_long_line_s_length);
+ const f_string_static_t fss_identify_long_name_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_long_name_s, 0, FSS_IDENTIFY_long_name_s_length);
+ const f_string_static_t fss_identify_long_object_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_long_object_s, 0, FSS_IDENTIFY_long_object_s_length);
+ const f_string_static_t fss_identify_long_total_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_long_total_s, 0, FSS_IDENTIFY_long_total_s_length);
+#endif // _di_fss_identify_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_fss_identify_main_delete_
+ f_status_t fss_identify_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_identify_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_identify_program_version_
#define FSS_IDENTIFY_program_version_major_s F_string_ascii_0_s
#define FSS_IDENTIFY_program_version_minor_s F_string_ascii_5_s
const f_string_static_t fss_identify_program_version_s;
#endif // _di_fss_identify_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_identify_program_name_
#define FSS_IDENTIFY_program_name_s "fss_identify"
#define FSS_IDENTIFY_program_name_long_s "FSS Identify"
const f_string_static_t fss_identify_program_name_long_s;
#endif // _di_fss_identify_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_identify_defines_
#define fss_identify_signal_check_d 10000
+#endif // _di_fss_identify_defines_
- #define fss_identify_short_content_s "c"
- #define fss_identify_short_line_s "l"
- #define fss_identify_short_name_s "n"
- #define fss_identify_short_object_s "o"
- #define fss_identify_short_total_s "t"
-
- #define fss_identify_long_content_s "content"
- #define fss_identify_long_line_s "line"
- #define fss_identify_long_name_s "name"
- #define fss_identify_long_object_s "object"
- #define fss_identify_long_total_s "total"
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_identify_parameters_
+ #define FSS_IDENTIFY_short_content_s "c"
+ #define FSS_IDENTIFY_short_line_s "l"
+ #define FSS_IDENTIFY_short_name_s "n"
+ #define FSS_IDENTIFY_short_object_s "o"
+ #define FSS_IDENTIFY_short_total_s "t"
+
+ #define FSS_IDENTIFY_long_content_s "content"
+ #define FSS_IDENTIFY_long_line_s "line"
+ #define FSS_IDENTIFY_long_name_s "name"
+ #define FSS_IDENTIFY_long_object_s "object"
+ #define FSS_IDENTIFY_long_total_s "total"
+
+ #define FSS_IDENTIFY_short_content_s_length 1
+ #define FSS_IDENTIFY_short_line_s_length 1
+ #define FSS_IDENTIFY_short_name_s_length 1
+ #define FSS_IDENTIFY_short_object_s_length 1
+ #define FSS_IDENTIFY_short_total_s_length 1
+
+ #define FSS_IDENTIFY_long_content_s_length 7
+ #define FSS_IDENTIFY_long_line_s_length 4
+ #define FSS_IDENTIFY_long_name_s_length 4
+ #define FSS_IDENTIFY_long_object_s_length 6
+ #define FSS_IDENTIFY_long_total_s_length 5
+
+ extern const f_string_static_t fss_identify_short_content_s;
+ extern const f_string_static_t fss_identify_short_line_s;
+ extern const f_string_static_t fss_identify_short_name_s;
+ extern const f_string_static_t fss_identify_short_object_s;
+ extern const f_string_static_t fss_identify_short_total_s;
+
+ extern const f_string_static_t fss_identify_long_content_s;
+ extern const f_string_static_t fss_identify_long_line_s;
+ extern const f_string_static_t fss_identify_long_name_s;
+ extern const f_string_static_t fss_identify_long_object_s;
+ extern const f_string_static_t fss_identify_long_total_s;
enum {
fss_identify_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_name_s, fss_identify_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_object_s, fss_identify_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_content_s.string, fss_identify_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_line_s.string, fss_identify_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_name_s.string, fss_identify_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_object_s.string, fss_identify_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_total_s.string, fss_identify_long_total_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_identify_total_parameters_d 14
-#endif // _di_fss_identify_defines_
-
-#ifndef _di_fss_identify_data_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_identify_main_t;
-
- #define fss_identify_data_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_identify_data_t_
+#endif // _di_fss_identify_parameters_
/**
* Deallocate main.
* @see fss_identify_main()
*/
#ifndef _di_fss_identify_main_delete_
- extern f_status_t fss_identify_main_delete(fss_identify_main_t * const main);
+ extern f_status_t fss_identify_main_delete(fll_program_data_t * const main);
#endif // _di_fss_identify_main_delete_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_identify_program_version_
- const f_string_static_t fss_identify_program_version_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_version_s, 0, FSS_IDENTIFY_program_version_s_length);
-#endif // _di_fss_identify_program_version_
-
-#ifndef _di_fss_identify_program_name_
- const f_string_static_t fss_identify_program_name_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_name_s, 0, FSS_IDENTIFY_program_name_s_length);
- const f_string_static_t fss_identify_program_name_long_s = macro_f_string_static_t_initialize(FSS_IDENTIFY_program_name_long_s, 0, FSS_IDENTIFY_program_name_long_s_length);
-#endif // _di_fss_identify_program_name_
-
#ifndef _di_fss_identify_print_help_
f_status_t fss_identify_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, fss_identify_short_name_s, fss_identify_long_name_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name.");
fll_program_print_help_option(file, context, fss_identify_short_total_s, fss_identify_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the total Identifiers found.");
- fll_program_print_help_usage(file, context, fss_identify_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_identify_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" The %[%r%s%] parameter refers to the file lines and not the lines in a given file.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line_s, context.set.notable, f_string_eol_s, f_string_eol_s);
#endif // _di_fss_identify_print_help_
#ifndef _di_fss_identify_main_
- f_status_t fss_identify_main(fss_identify_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_identify_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_identify_parameter_no_color_e, fss_identify_parameter_light_e, fss_identify_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
if (F_status_is_error_not(status)) {
uint16_t signal_check = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_identify_signal_check_d)) {
if (fss_identify_signal_received(main)) {
file.size_read = 512;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
}
else {
- status = fss_identify_load_line(main, file, arguments->argv[main->remaining.array[i]], &buffer, &range);
+ status = fss_identify_load_line(main, file, arguments->argv[main->parameters.remaining.array[i]], &buffer, &range);
if (F_status_is_error_not(status)) {
- status = fss_identify_process(main, arguments->argv[main->remaining.array[i]], buffer, &range, &data);
+ status = fss_identify_process(main, arguments->argv[main->parameters.remaining.array[i]], buffer, &range, &data);
}
}
* @see fss_identify_main_delete()
*/
#ifndef _di_fss_identify_main_
- extern f_status_t fss_identify_main(fss_identify_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_identify_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_identify_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_identify_main_t data = fss_identify_data_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_identify_data_delete_
#ifndef _di_fss_identify_print_signal_received_
- void fss_identify_print_signal_received(fss_identify_main_t * const main, const f_status_t signal) {
+ void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_identify_print_signal_received_
#ifndef _di_fss_identify_signal_received_
- f_status_t fss_identify_signal_received(fss_identify_main_t * const main) {
+ f_status_t fss_identify_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_identify_print_signal_received_
- extern void fss_identify_print_signal_received(fss_identify_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_identify_signal_received_
- extern f_status_t fss_identify_signal_received(fss_identify_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_identify_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_identify_load_line_
- f_status_t fss_identify_load_line(fss_identify_main_t * const main, const f_file_t file, const f_string_static_t name, f_string_static_t *buffer, f_string_range_t *range) {
+ f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_static_t name, f_string_static_t *buffer, f_string_range_t *range) {
f_status_t status = F_none;
uint16_t signal_check = 0;
#endif // _di_fss_identify_load_line_
#ifndef _di_fss_identify_process_
- f_status_t fss_identify_process(fss_identify_main_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) {
+ f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) {
f_status_t status = F_none;
f_fll_ids_t ids = f_fll_ids_t_initialize;
* @see f_string_dynamic_resize()
*/
#ifndef _di_fss_identify_load_line_
- extern f_status_t fss_identify_load_line(fss_identify_main_t * const main, const f_file_t file, const f_string_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
+ extern f_status_t fss_identify_load_line(fll_program_data_t * const main, const f_file_t file, const f_string_t name, f_string_static_t *buffer, f_string_range_t *range) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_load_line_
/**
* @see fll_fss_identify()
*/
#ifndef _di_fss_identify_process_
- extern f_status_t fss_identify_process(fss_identify_main_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_identify_process(fll_program_data_t * const main, const f_string_t name, const f_string_static_t buffer, f_string_range_t *range, fss_identify_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_process_
#ifdef __cplusplus
#endif
#ifndef _di_fss_identify_print_
- void fss_identify_print(fss_identify_main_t * const main, f_fll_id_t id) {
+ void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) {
flockfile(main->output.to.stream);
* The Identifier to print.
*/
#ifndef _di_fss_identify_print_
- extern void fss_identify_print(fss_identify_main_t * const main, f_fll_id_t id) F_attribute_visibility_internal_d;
+ extern void fss_identify_print(fll_program_data_t * const main, f_fll_id_t id) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_print_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_payload_read_program_version_
- const f_string_static_t fss_payload_read_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_version_s, 0, FSS_PAYLOAD_READ_program_version_s_length);
-#endif // _di_fss_payload_read_program_version_
-
-#ifndef _di_fss_payload_read_program_name_
- const f_string_static_t fss_payload_read_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_s, 0, FSS_PAYLOAD_READ_program_name_s_length);
- const f_string_static_t fss_payload_read_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_program_name_long_s, 0, FSS_PAYLOAD_READ_program_name_long_s_length);
-#endif // _di_fss_payload_read_program_name_
+#ifndef _di_fss_payload_read_defines_
+ const f_string_static_t fss_payload_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_end_s, 0, FSS_PAYLOAD_READ_pipe_content_end_s_length);
+ const f_string_static_t fss_payload_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_ignore_s, 0, FSS_PAYLOAD_READ_pipe_content_ignore_s_length);
+ const f_string_static_t fss_payload_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_pipe_content_start_s, 0, FSS_PAYLOAD_READ_pipe_content_start_s_length);
+#endif // _di_fss_payload_read_defines_
+
+#ifndef _di_fss_payload_read_parameters_
+ const f_string_static_t fss_payload_read_short_at_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_at_s, 0, FSS_PAYLOAD_READ_short_at_s_length);
+ const f_string_static_t fss_payload_read_short_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_content_s, 0, FSS_PAYLOAD_READ_short_content_s_length);
+ const f_string_static_t fss_payload_read_short_columns_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_columns_s, 0, FSS_PAYLOAD_READ_short_columns_s_length);
+ const f_string_static_t fss_payload_read_short_delimit_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_delimit_s, 0, FSS_PAYLOAD_READ_short_delimit_s_length);
+ const f_string_static_t fss_payload_read_short_depth_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_depth_s, 0, FSS_PAYLOAD_READ_short_depth_s_length);
+ const f_string_static_t fss_payload_read_short_empty_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_empty_s, 0, FSS_PAYLOAD_READ_short_empty_s_length);
+ const f_string_static_t fss_payload_read_short_line_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_line_s, 0, FSS_PAYLOAD_READ_short_line_s_length);
+ const f_string_static_t fss_payload_read_short_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_name_s, 0, FSS_PAYLOAD_READ_short_name_s_length);
+ const f_string_static_t fss_payload_read_short_object_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_object_s, 0, FSS_PAYLOAD_READ_short_object_s_length);
+ const f_string_static_t fss_payload_read_short_pipe_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_pipe_s, 0, FSS_PAYLOAD_READ_short_pipe_s_length);
+ const f_string_static_t fss_payload_read_short_raw_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_raw_s, 0, FSS_PAYLOAD_READ_short_raw_s_length);
+ const f_string_static_t fss_payload_read_short_select_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_select_s, 0, FSS_PAYLOAD_READ_short_select_s_length);
+ const f_string_static_t fss_payload_read_short_total_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_total_s, 0, FSS_PAYLOAD_READ_short_total_s_length);
+ const f_string_static_t fss_payload_read_short_trim_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_short_trim_s, 0, FSS_PAYLOAD_READ_short_trim_s_length);
+
+ const f_string_static_t fss_payload_read_long_at_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_at_s, 0, FSS_PAYLOAD_READ_long_at_s_length);
+ const f_string_static_t fss_payload_read_long_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_content_s, 0, FSS_PAYLOAD_READ_long_content_s_length);
+ const f_string_static_t fss_payload_read_long_columns_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_columns_s, 0, FSS_PAYLOAD_READ_long_columns_s_length);
+ const f_string_static_t fss_payload_read_long_delimit_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_delimit_s, 0, FSS_PAYLOAD_READ_long_delimit_s_length);
+ const f_string_static_t fss_payload_read_long_depth_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_depth_s, 0, FSS_PAYLOAD_READ_long_depth_s_length);
+ const f_string_static_t fss_payload_read_long_empty_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_empty_s, 0, FSS_PAYLOAD_READ_long_empty_s_length);
+ const f_string_static_t fss_payload_read_long_line_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_line_s, 0, FSS_PAYLOAD_READ_long_line_s_length);
+ const f_string_static_t fss_payload_read_long_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_name_s, 0, FSS_PAYLOAD_READ_long_name_s_length);
+ const f_string_static_t fss_payload_read_long_object_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_object_s, 0, FSS_PAYLOAD_READ_long_object_s_length);
+ const f_string_static_t fss_payload_read_long_pipe_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_pipe_s, 0, FSS_PAYLOAD_READ_long_pipe_s_length);
+ const f_string_static_t fss_payload_read_long_raw_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_raw_s, 0, FSS_PAYLOAD_READ_long_raw_s_length);
+ const f_string_static_t fss_payload_read_long_select_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_select_s, 0, FSS_PAYLOAD_READ_long_select_s_length);
+ const f_string_static_t fss_payload_read_long_total_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_total_s, 0, FSS_PAYLOAD_READ_long_total_s_length);
+ const f_string_static_t fss_payload_read_long_trim_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_READ_long_trim_s, 0, FSS_PAYLOAD_READ_long_trim_s_length);
+#endif // _di_fss_payload_read_parameters_
#ifndef _di_fss_payload_read_main_delete_
- f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
+ f_status_t fss_payload_read_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_payload_read_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_payload_read_program_version_
#define FSS_PAYLOAD_READ_program_version_major_s F_string_ascii_0_s
#define FSS_PAYLOAD_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_payload_read_program_version_s;
#endif // _di_fss_payload_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_payload_read_program_name_
#define FSS_PAYLOAD_READ_program_name_s "fss_payload_read"
#define FSS_PAYLOAD_READ_program_name_long_s "FSS Payload Read"
extern const f_string_static_t fss_payload_read_program_name_long_s;
#endif // _di_fss_payload_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_payload_read_defines_
#define fss_payload_read_signal_check_d 10000
- #define fss_payload_read_pipe_content_end_s '\f'
- #define fss_payload_read_pipe_content_ignore_s '\v'
- #define fss_payload_read_pipe_content_start_s '\b'
-
- #define fss_payload_read_short_at_s "a"
- #define fss_payload_read_short_content_s "c"
- #define fss_payload_read_short_columns_s "C"
- #define fss_payload_read_short_delimit_s "D"
- #define fss_payload_read_short_depth_s "d"
- #define fss_payload_read_short_empty_s "e"
- #define fss_payload_read_short_line_s "l"
- #define fss_payload_read_short_name_s "n"
- #define fss_payload_read_short_object_s "o"
- #define fss_payload_read_short_pipe_s "p"
- #define fss_payload_read_short_raw_s "R"
- #define fss_payload_read_short_select_s "s"
- #define fss_payload_read_short_total_s "t"
- #define fss_payload_read_short_trim_s "T"
-
- #define fss_payload_read_long_at_s "at"
- #define fss_payload_read_long_content_s "content"
- #define fss_payload_read_long_columns_s "columns"
- #define fss_payload_read_long_delimit_s "delimit"
- #define fss_payload_read_long_depth_s "depth"
- #define fss_payload_read_long_empty_s "empty"
- #define fss_payload_read_long_line_s "line"
- #define fss_payload_read_long_name_s "name"
- #define fss_payload_read_long_object_s "object"
- #define fss_payload_read_long_pipe_s "pipe"
- #define fss_payload_read_long_raw_s "raw"
- #define fss_payload_read_long_select_s "select"
- #define fss_payload_read_long_total_s "total"
- #define fss_payload_read_long_trim_s "trim"
+ #define FSS_PAYLOAD_READ_pipe_content_end_s '\f'
+ #define FSS_PAYLOAD_READ_pipe_content_ignore_s '\v'
+ #define FSS_PAYLOAD_READ_pipe_content_start_s '\b'
+
+ #define FSS_PAYLOAD_READ_pipe_content_end_s_length 1
+ #define FSS_PAYLOAD_READ_pipe_content_ignore_s_length 1
+ #define FSS_PAYLOAD_READ_pipe_content_start_s_length 1
+
+ extern const fss_payload_read_pipe_content_end_s;
+ extern const fss_payload_read_pipe_content_ignore_s;
+ extern const fss_payload_read_pipe_content_start_s;
+#endif // _di_fss_payload_read_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_payload_read_parameters_
+ #define FSS_PAYLOAD_READ_short_at_s "a"
+ #define FSS_PAYLOAD_READ_short_content_s "c"
+ #define FSS_PAYLOAD_READ_short_columns_s "C"
+ #define FSS_PAYLOAD_READ_short_delimit_s "D"
+ #define FSS_PAYLOAD_READ_short_depth_s "d"
+ #define FSS_PAYLOAD_READ_short_empty_s "e"
+ #define FSS_PAYLOAD_READ_short_line_s "l"
+ #define FSS_PAYLOAD_READ_short_name_s "n"
+ #define FSS_PAYLOAD_READ_short_object_s "o"
+ #define FSS_PAYLOAD_READ_short_pipe_s "p"
+ #define FSS_PAYLOAD_READ_short_raw_s "R"
+ #define FSS_PAYLOAD_READ_short_select_s "s"
+ #define FSS_PAYLOAD_READ_short_total_s "t"
+ #define FSS_PAYLOAD_READ_short_trim_s "T"
+
+ #define FSS_PAYLOAD_READ_long_at_s "at"
+ #define FSS_PAYLOAD_READ_long_content_s "content"
+ #define FSS_PAYLOAD_READ_long_columns_s "columns"
+ #define FSS_PAYLOAD_READ_long_delimit_s "delimit"
+ #define FSS_PAYLOAD_READ_long_depth_s "depth"
+ #define FSS_PAYLOAD_READ_long_empty_s "empty"
+ #define FSS_PAYLOAD_READ_long_line_s "line"
+ #define FSS_PAYLOAD_READ_long_name_s "name"
+ #define FSS_PAYLOAD_READ_long_object_s "object"
+ #define FSS_PAYLOAD_READ_long_pipe_s "pipe"
+ #define FSS_PAYLOAD_READ_long_raw_s "raw"
+ #define FSS_PAYLOAD_READ_long_select_s "select"
+ #define FSS_PAYLOAD_READ_long_total_s "total"
+ #define FSS_PAYLOAD_READ_long_trim_s "trim"
+
+ #define FSS_PAYLOAD_READ_short_at_s_length 1
+ #define FSS_PAYLOAD_READ_short_content_s_length 1
+ #define FSS_PAYLOAD_READ_short_columns_s_length 1
+ #define FSS_PAYLOAD_READ_short_delimit_s_length 1
+ #define FSS_PAYLOAD_READ_short_depth_s_length 1
+ #define FSS_PAYLOAD_READ_short_empty_s_length 1
+ #define FSS_PAYLOAD_READ_short_line_s_length 1
+ #define FSS_PAYLOAD_READ_short_name_s_length 1
+ #define FSS_PAYLOAD_READ_short_object_s_length 1
+ #define FSS_PAYLOAD_READ_short_pipe_s_length 1
+ #define FSS_PAYLOAD_READ_short_raw_s_length 1
+ #define FSS_PAYLOAD_READ_short_select_s_length 1
+ #define FSS_PAYLOAD_READ_short_total_s_length 1
+ #define FSS_PAYLOAD_READ_short_trim_s_length 1
+
+ #define FSS_PAYLOAD_READ_long_at_s_length 2
+ #define FSS_PAYLOAD_READ_long_content_s_length 7
+ #define FSS_PAYLOAD_READ_long_columns_s_length 7
+ #define FSS_PAYLOAD_READ_long_delimit_s_length 7
+ #define FSS_PAYLOAD_READ_long_depth_s_length 5
+ #define FSS_PAYLOAD_READ_long_empty_s_length 5
+ #define FSS_PAYLOAD_READ_long_line_s_length 4
+ #define FSS_PAYLOAD_READ_long_name_s_length 4
+ #define FSS_PAYLOAD_READ_long_object_s_length 6
+ #define FSS_PAYLOAD_READ_long_pipe_s_length 4
+ #define FSS_PAYLOAD_READ_long_raw_s_length 3
+ #define FSS_PAYLOAD_READ_long_select_s_length 6
+ #define FSS_PAYLOAD_READ_long_total_s_length 5
+ #define FSS_PAYLOAD_READ_long_trim_s_length 4
+
+ extern const f_string_static_t fss_payload_read_short_at_s;
+ extern const f_string_static_t fss_payload_read_short_content_s;
+ extern const f_string_static_t fss_payload_read_short_columns_s;
+ extern const f_string_static_t fss_payload_read_short_delimit_s;
+ extern const f_string_static_t fss_payload_read_short_depth_s;
+ extern const f_string_static_t fss_payload_read_short_empty_s;
+ extern const f_string_static_t fss_payload_read_short_line_s;
+ extern const f_string_static_t fss_payload_read_short_name_s;
+ extern const f_string_static_t fss_payload_read_short_object_s;
+ extern const f_string_static_t fss_payload_read_short_pipe_s;
+ extern const f_string_static_t fss_payload_read_short_raw_s;
+ extern const f_string_static_t fss_payload_read_short_select_s;
+ extern const f_string_static_t fss_payload_read_short_total_s;
+ extern const f_string_static_t fss_payload_read_short_trim_s;
+
+ extern const f_string_static_t fss_payload_read_long_at_s;
+ extern const f_string_static_t fss_payload_read_long_content_s;
+ extern const f_string_static_t fss_payload_read_long_columns_s;
+ extern const f_string_static_t fss_payload_read_long_delimit_s;
+ extern const f_string_static_t fss_payload_read_long_depth_s;
+ extern const f_string_static_t fss_payload_read_long_empty_s;
+ extern const f_string_static_t fss_payload_read_long_line_s;
+ extern const f_string_static_t fss_payload_read_long_name_s;
+ extern const f_string_static_t fss_payload_read_long_object_s;
+ extern const f_string_static_t fss_payload_read_long_pipe_s;
+ extern const f_string_static_t fss_payload_read_long_raw_s;
+ extern const f_string_static_t fss_payload_read_long_select_s;
+ extern const f_string_static_t fss_payload_read_long_total_s;
+ extern const f_string_static_t fss_payload_read_long_trim_s;
enum {
fss_payload_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s, fss_payload_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s, fss_payload_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s, fss_payload_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s, fss_payload_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s, fss_payload_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_at_s.string, fss_payload_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s.string, fss_payload_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s.string, fss_payload_read_long_columns_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s.string, fss_payload_read_long_delimit_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s.string, fss_payload_read_long_depth_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s.string, fss_payload_read_long_empty_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s.string, fss_payload_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s.string, fss_payload_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s.string, fss_payload_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s.string, fss_payload_read_long_pipe_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s.string, fss_payload_read_long_raw_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s.string, fss_payload_read_long_select_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s.string, fss_payload_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s.string, fss_payload_read_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_payload_total_parameters_d 23
-#endif // _di_fss_payload_read_defines_
+#endif // _di_fss_payload_read_parameters_
/**
* FSS Delimit Parameter data.
};
#endif // _di_fss_payload_read_delimit_modes_
-#ifndef _di_fss_payload_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_payload_read_main_t;
-
- #define fss_payload_read_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_payload_read_main_t_
-
/**
* Deallocate main.
*
* @see fss_payload_read_main()
*/
#ifndef _di_fss_payload_read_main_delete_
- extern f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main);
+ extern f_status_t fss_payload_read_main_delete(fll_program_data_t * const main);
#endif // _di_fss_payload_read_main_delete_
#ifdef __cplusplus
fll_program_print_help_option(file, context, fss_payload_read_short_total_s, fss_payload_read_long_total_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines.");
fll_program_print_help_option(file, context, fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print.");
- fll_program_print_help_usage(file, context, fss_payload_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_payload_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
#endif // _di_fss_payload_read_print_help_
#ifndef _di_fss_payload_read_main_
- f_status_t fss_payload_read_main(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_payload_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_payload_read_parameter_no_color_e, fss_payload_read_parameter_light_e, fss_payload_read_parameter_dark_e };
const f_console_parameter_ids_t choices = { ids, 3 };
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
// Provide a range designating where within the buffer a particular file exists, using a statically allocated array.
- fss_payload_read_file_t files_array[main->remaining.used + 1];
+ fss_payload_read_file_t files_array[main->parameters.remaining.used + 1];
fss_payload_read_data_t data = fss_payload_read_data_t_initialize;
data.files.array = files_array;
data.files.used = 1;
- data.files.size = main->remaining.used + 1;
+ data.files.size = main->parameters.remaining.used + 1;
data.files.array[0].name = "(pipe)";
data.files.array[0].range.start = 1;
data.files.array[0].range.stop = 0;
- if (main->remaining.used || main->process_pipe) {
+ if (main->parameters.remaining.used || main->process_pipe) {
{
const f_array_length_t parameter_code[] = {
fss_payload_read_parameter_at_e,
}
}
- if (F_status_is_error_not(status) && main->remaining.used > 0) {
+ if (F_status_is_error_not(status) && main->parameters.remaining.used > 0) {
f_file_t file = f_file_t_initialize;
f_array_length_t size_file = 0;
const f_array_length_t buffer_used = data.buffer.used;
uint16_t signal_check = 0;
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_payload_read_signal_check_d)) {
if (fss_payload_read_signal_received(main)) {
file.stream = 0;
file.id = -1;
- status = f_file_stream_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
else if (data.buffer.used > data.files.array[data.files.used].range.start) {
- data.files.array[data.files.used].name = arguments->argv[main->remaining.array[i]];
+ data.files.array[data.files.used].name = arguments->argv[main->parameters.remaining.array[i]];
data.files.array[data.files.used++].range.stop = data.buffer.used - 1;
}
}
*
* This is the FSS Basic List Read program
* This program utilizes the Featureless Linux Library.
- * This program processes files or other input in fss format and stores the results in the fss_payload_read_main_t.
+ * This program processes files or other input in fss format and stores the results in the fll_program_data_t.
*
* This processes in accordance to the FSS-0002 Basic List specification.
*/
* @see fss_payload_read_main_delete()
*/
#ifndef _di_fss_payload_read_main_
- extern f_status_t fss_payload_read_main(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_payload_read_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_payload_read_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
f_console_arguments_t arguments = { argc, argv };
- fss_payload_read_main_t data = fss_payload_read_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif // _di_fss_payload_read_depths_resize_
#ifndef _di_fss_payload_read_print_signal_received_
- void fss_payload_read_print_signal_received(fss_payload_read_main_t * const main, const f_status_t signal) {
+ void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_payload_read_print_signal_received_
#ifndef _di_fss_payload_read_signal_received_
- f_status_t fss_payload_read_signal_received(fss_payload_read_main_t * const main) {
+ f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_payload_read_print_signal_received_
- extern void fss_payload_read_print_signal_received(fss_payload_read_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_payload_read_signal_received_
- extern f_status_t fss_payload_read_signal_received(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_payload_read_print_at_
- void fss_payload_read_print_at(fss_payload_read_main_t * const main, const bool is_payload, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) {
+ void fss_payload_read_print_at(fll_program_data_t * const main, const bool is_payload, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) {
if (at >= data->contents.used) {
return;
#endif // _di_fss_payload_read_print_at_
#ifndef _di_fss_payload_read_print_at_extended_
- void fss_payload_read_print_at_extended(fss_payload_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) {
+ void fss_payload_read_print_at_extended(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) {
if (at >= data->contents_header.used) {
return;
#endif // _di_fss_payload_read_print_at_extended_
#ifndef _di_fss_payload_read_print_at_object_
- void fss_payload_read_print_at_object(fss_payload_read_main_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
+ void fss_payload_read_print_at_object(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) {
if (at >= data->objects.used) {
return;
#endif // _di_fss_payload_read_print_at_object_
#ifndef _di_fss_payload_read_print_at_total_exteded_
- f_status_t fss_payload_read_print_at_total_extended(fss_payload_read_main_t * const main, const f_array_length_t at, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_print_at_total_extended(fll_program_data_t * const main, const f_array_length_t at, fss_payload_read_data_t *data) {
if (data->option & fss_payload_read_data_option_select_d) {
if (data->option & fss_payload_read_data_option_object_d) {
#endif // _di_fss_payload_read_print_at_total_extended_
#ifndef _di_fss_payload_read_print_content_end_extended_
- void fss_payload_read_print_content_end_extended(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_content_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_content_end_extended_
#ifndef _di_fss_payload_read_print_content_ignore_
- void fss_payload_read_print_content_ignore(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_content_ignore(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_ignore_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_content_ignore_
#ifndef _di_fss_payload_read_print_object_end_
- void fss_payload_read_print_object_end(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_object_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_start_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_object_end_
#ifndef _di_fss_payload_read_print_object_end_extended_
- void fss_payload_read_print_object_end_extended(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_object_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_object_end_extended_
#ifndef _di_fss_payload_read_print_set_end_
- void fss_payload_read_print_set_end(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_set_end(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_set_end_
#ifndef _di_fss_payload_read_print_set_end_extended_
- void fss_payload_read_print_set_end_extended(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_set_end_extended(fll_program_data_t * const main) {
if (main->parameters.array[fss_payload_read_parameter_pipe_e].result == f_console_result_found_e) {
f_print_character(fss_payload_read_pipe_content_end_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_set_end_extended_
#ifndef _di_fss_payload_read_print_one_
- void fss_payload_read_print_one(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_one(fll_program_data_t * const main) {
f_print_dynamic_raw(f_string_ascii_1_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
#endif // _di_fss_payload_read_print_one_
#ifndef _di_fss_payload_read_print_zero_
- void fss_payload_read_print_zero(fss_payload_read_main_t * const main) {
+ void fss_payload_read_print_zero(fll_program_data_t * const main) {
f_print_dynamic_raw(f_string_ascii_0_s, main->output.to.stream);
f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
* The program data.
*/
#ifndef _di_fss_payload_read_print_at_
- extern void fss_payload_read_print_at(fss_payload_read_main_t * const main, const bool is_payload, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_at(fll_program_data_t * const main, const bool is_payload, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_at_
/**
* The program data.
*/
#ifndef _di_fss_payload_read_print_at_extended_
- extern void fss_payload_read_print_at_extended(fss_payload_read_main_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_at_extended(fll_program_data_t * const main, const f_array_length_t at, const f_fss_delimits_t delimits_object, const f_fss_delimits_t delimits_content, fss_payload_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_at_extended_
/**
* The delimits to be applied to an Object.
*/
#ifndef _di_fss_payload_read_print_at_object_
- extern void fss_payload_read_print_at_object(fss_payload_read_main_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_at_object(fll_program_data_t * const main, fss_payload_read_data_t * const data, const f_array_length_t at, const f_fss_delimits_t delimits_object) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_at_object_
/**
* F_success on success and something was matched (and total was printed).
*/
#ifndef _di_fss_payload_read_print_at_total_extended_
- extern f_status_t fss_payload_read_print_at_total_extended(fss_payload_read_main_t * const main, const f_array_length_t at, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_print_at_total_extended(fll_program_data_t * const main, const f_array_length_t at, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_at_total_extended_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_content_end_extended_
- extern void fss_payload_read_print_content_end_extended(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_content_end_extended(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_content_end_extended_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_content_ignore_
- extern void fss_payload_read_print_content_ignore(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_content_ignore(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_content_ignore_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_object_end_
- extern void fss_payload_read_print_object_end(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_object_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_object_end_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_object_end_extended_
- extern void fss_payload_read_print_object_end_extended(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_object_end_extended(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_object_end_extended_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_one_
- extern void fss_payload_read_print_one(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_one(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_one_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_set_end_
- extern void fss_payload_read_print_set_end(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_set_end(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_set_end_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_set_end_extended_
- extern void fss_payload_read_print_set_end_extended(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_set_end_extended(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_set_end_extended_
/**
* The main program data.
*/
#ifndef _di_fss_payload_read_print_zero_
- extern void fss_payload_read_print_zero(fss_payload_read_main_t * const main) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_zero(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_zero_
#ifdef __cplusplus
#endif // _di_fss_payload_read_delimit_object_is_
#ifndef _di_fss_payload_read_depth_process_
- f_status_t fss_payload_read_depth_process(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_payload_read_file_identify_
#ifndef _di_fss_payload_read_load_
- f_status_t fss_payload_read_load(fss_payload_read_main_t * const main, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) {
f_state_t state = macro_f_state_t_initialize(fss_payload_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
f_string_range_t input = macro_f_string_range_t_initialize(data->buffer.used);
#endif // _di_fss_payload_read_load_
#ifndef _di_fss_payload_read_load_number_
- f_status_t fss_payload_read_load_number(fss_payload_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
+ f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) {
if (main->parameters.array[parameter].result == f_console_result_additional_e) {
const f_array_length_t index = main->parameters.array[parameter].values.array[main->parameters.array[parameter].values.used - 1];
#endif // _di_fss_payload_read_load_number_
#ifndef _di_fss_payload_read_process_
- f_status_t fss_payload_read_process(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
f_status_t status = fss_payload_read_process_option(main, arguments, data);
if (F_status_is_error(status)) return status;
#endif // _di_fss_payload_read_process_
#ifndef _di_fss_payload_read_process_at_
- f_status_t fss_payload_read_process_at(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
if (data->depths.array[0].value_at >= data->objects.used) {
if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
#endif // _di_fss_payload_read_process_at_
#ifndef _di_fss_payload_read_process_at_extended_
- f_status_t fss_payload_read_process_at_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
if (data->depths.array[data->depths.used - 1].value_at >= data->objects_header.used) {
if (data->option & (fss_payload_read_data_option_columns_d | fss_payload_read_data_option_total_d)) {
#endif // _di_fss_payload_read_process_at_extended_
#ifndef _di_fss_payload_read_process_at_line_
- f_status_t fss_payload_read_process_at_line(fss_payload_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) {
+ f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) {
if (data->option & fss_payload_read_data_option_object_d) {
if (*line == data->line) {
#endif // _di_fss_payload_read_process_at_line_
#ifndef _di_fss_payload_read_process_columns_
- f_status_t fss_payload_read_process_columns(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
if (!(data->option & fss_payload_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_payload_read_process_columns_
#ifndef _di_fss_payload_read_process_columns_extended_
- f_status_t fss_payload_read_process_columns_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
if (!(data->option & fss_payload_read_data_option_content_d)) {
flockfile(main->output.to.stream);
#endif // _di_fss_payload_read_process_columns_extended_
#ifndef _di_fss_payload_read_process_line_
- f_status_t fss_payload_read_process_line(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object : &except_none;
#endif // _di_fss_payload_read_process_line_
#ifndef _di_fss_payload_read_process_line_extended_
- f_status_t fss_payload_read_process_line_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
f_array_lengths_t except_none = f_array_lengths_t_initialize;
f_array_lengths_t *delimits_object = fss_payload_read_delimit_object_is(0, data) ? &data->delimits_object_header : &except_none;
#endif // _di_fss_payload_read_process_name_extended_
#ifndef _di_fss_payload_read_process_option_
- f_status_t fss_payload_read_process_option(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
+ f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) {
f_status_t status = F_none;
#endif // _di_fss_payload_read_process_option_
#ifndef _di_fss_payload_read_process_total_
- f_status_t fss_payload_read_process_total(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
f_string_range_t range = f_string_range_t_initialize;
#endif // _di_fss_payload_read_process_total_
#ifndef _di_fss_payload_read_process_total_extended_
- f_status_t fss_payload_read_process_total_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) {
+ f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) {
f_array_length_t total = 0;
* @see fss_payload_read_depths_resize()
*/
#ifndef _di_fss_payload_read_depth_process_
- extern f_status_t fss_payload_read_depth_process(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_depth_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_depth_process_
/**
* @see fss_payload_read_process_option()
*/
#ifndef _di_fss_payload_read_load_
- extern f_status_t fss_payload_read_load(fss_payload_read_main_t * const main, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_load_
/**
* @see fss_payload_read_depths_resize()
*/
#ifndef _di_fss_payload_read_load_number_
- extern f_status_t fss_payload_read_load_number(fss_payload_read_main_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_t name, const f_console_arguments_t *arguments, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_load_number_
/**
* @see fss_payload_read_process_option()
*/
#ifndef _di_fss_payload_read_process_
- extern f_status_t fss_payload_read_process(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_
/**
* @see fss_payload_read_process_at_line()
*/
#ifndef _di_fss_payload_read_process_at_
- extern f_status_t fss_payload_read_process_at(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_
/**
* @see fss_payload_read_process_at_line()
*/
#ifndef _di_fss_payload_read_process_at_extended_
- extern f_status_t fss_payload_read_process_at_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_extended_
/**
* F_success on success and the line was matched (and possibly printed).
*/
#ifndef _di_fss_payload_read_process_at_line_
- extern f_status_t fss_payload_read_process_at_line(fss_payload_read_main_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_at_line(fll_program_data_t * const main, const f_array_length_t at, const f_array_lengths_t delimits_object, const f_array_lengths_t delimits_content, fss_payload_read_data_t *data, f_array_length_t *line) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_at_line_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_columns_
- extern f_status_t fss_payload_read_process_columns(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_columns(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_columns_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_columns_extended_
- extern f_status_t fss_payload_read_process_columns_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_columns_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_columns_extended_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_line_
- extern f_status_t fss_payload_read_process_line(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_line(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_line_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_line_extended_
- extern f_status_t fss_payload_read_process_line_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_line_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_line_extended_
/**
* @see fss_payload_read_load_setting()
*/
#ifndef _di_fss_payload_read_process_option_
- extern f_status_t fss_payload_read_process_option(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_option(fll_program_data_t * const main, const f_console_arguments_t *arguments, fss_payload_read_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_option_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_total_
- extern f_status_t fss_payload_read_process_total(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_total(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_total_
/**
* F_none on success.
*/
#ifndef _di_fss_payload_read_process_total_extended_
- extern f_status_t fss_payload_read_process_total_extended(fss_payload_read_main_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_read_process_total_extended(fll_program_data_t * const main, fss_payload_read_data_t *data, bool names[]) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_process_total_extended_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_payload_write_program_version_
- const f_string_static_t fss_payload_write_program_version_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_version_s, 0, FSS_PAYLOAD_WRITE_program_version_s_length);
-#endif // _di_fss_payload_write_program_version_
-
-#ifndef _di_fss_payload_write_program_name_
- const f_string_static_t fss_payload_write_program_name_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_s, 0, FSS_PAYLOAD_WRITE_program_name_s_length);
- const f_string_static_t fss_payload_write_program_name_long_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_program_name_long_s, 0, FSS_PAYLOAD_WRITE_program_name_long_s_length);
-#endif // _di_fss_payload_write_program_name_
+#ifndef _di_fss_payload_write_defines_
+ const f_string_static_t fss_payload_write_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_end_s, 0, FSS_PAYLOAD_WRITE_pipe_content_end_s_length);
+ const f_string_static_t fss_payload_write_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_ignore_s, 0, FSS_PAYLOAD_WRITE_pipe_content_ignore_s_length);
+ const f_string_static_t fss_payload_write_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_pipe_content_start_s, 0, FSS_PAYLOAD_WRITE_pipe_content_start_s_length);
+#endif // _di_fss_payload_write_defines_
+
+##ifndef _di_fss_payload_write_parameters_
+ const f_string_static_t fss_payload_write_short_file_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_file_s, 0, FSS_PAYLOAD_WRITE_short_file_s_length);
+ const f_string_static_t fss_payload_write_short_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_content_s, 0, FSS_PAYLOAD_WRITE_short_content_s_length);
+ const f_string_static_t fss_payload_write_short_double_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_double_s, 0, FSS_PAYLOAD_WRITE_short_double_s_length);
+ const f_string_static_t fss_payload_write_short_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_ignore_s, 0, FSS_PAYLOAD_WRITE_short_ignore_s_length);
+ const f_string_static_t fss_payload_write_short_object_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_object_s, 0, FSS_PAYLOAD_WRITE_short_object_s_length);
+ const f_string_static_t fss_payload_write_short_partial_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_partial_s, 0, FSS_PAYLOAD_WRITE_short_partial_s_length);
+ const f_string_static_t fss_payload_write_short_prepend_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_prepend_s, 0, FSS_PAYLOAD_WRITE_short_prepend_s_length);
+ const f_string_static_t fss_payload_write_short_single_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_single_s, 0, FSS_PAYLOAD_WRITE_short_single_s_length);
+ const f_string_static_t fss_payload_write_short_trim_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_short_trim_s, 0, FSS_PAYLOAD_WRITE_short_trim_s_length);
+
+ const f_string_static_t fss_payload_write_long_file_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_file_s, 0, FSS_PAYLOAD_WRITE_long_file_s_length);
+ const f_string_static_t fss_payload_write_long_content_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_content_s, 0, FSS_PAYLOAD_WRITE_long_content_s_length);
+ const f_string_static_t fss_payload_write_long_double_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_double_s, 0, FSS_PAYLOAD_WRITE_long_double_s_length);
+ const f_string_static_t fss_payload_write_long_ignore_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_ignore_s, 0, FSS_PAYLOAD_WRITE_long_ignore_s_length);
+ const f_string_static_t fss_payload_write_long_object_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_object_s, 0, FSS_PAYLOAD_WRITE_long_object_s_length);
+ const f_string_static_t fss_payload_write_long_partial_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_partial_s, 0, FSS_PAYLOAD_WRITE_long_partial_s_length);
+ const f_string_static_t fss_payload_write_long_prepend_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_prepend_s, 0, FSS_PAYLOAD_WRITE_long_prepend_s_length);
+ const f_string_static_t fss_payload_write_long_single_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_single_s, 0, FSS_PAYLOAD_WRITE_long_single_s_length);
+ const f_string_static_t fss_payload_write_long_trim_s = macro_f_string_static_t_initialize(FSS_PAYLOAD_WRITE_long_trim_s, 0, FSS_PAYLOAD_WRITE_long_trim_s_length);
+#endif // _di_fss_payload_write_parameters_
#ifndef _di_fss_payload_write_main_delete_
- f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+ f_status_t fss_payload_write_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_payload_write_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_payload_write_program_version_
#define FSS_PAYLOAD_WRITE_program_version_major_s F_string_ascii_0_s
#define FSS_PAYLOAD_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_payload_write_program_version_s;
#endif // _di_fss_payload_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_payload_write_program_name_
#define FSS_PAYLOAD_WRITE_program_name_s "fss_payload_write"
#define FSS_PAYLOAD_WRITE_program_name_long_s "FSS Payload Write"
extern const f_string_static_t fss_payload_write_program_name_long_s;
#endif // _di_fss_payload_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_fss_payload_write_defines_
#define fss_payload_write_signal_check_d 10000
- #define fss_payload_write_pipe_content_end_s '\f'
- #define fss_payload_write_pipe_content_ignore_s '\v'
- #define fss_payload_write_pipe_content_start_s '\b'
-
- #define fss_payload_write_short_file_s "f"
- #define fss_payload_write_short_content_s "c"
- #define fss_payload_write_short_double_s "d"
- #define fss_payload_write_short_ignore_s "I"
- #define fss_payload_write_short_object_s "o"
- #define fss_payload_write_short_partial_s "p"
- #define fss_payload_write_short_prepend_s "P"
- #define fss_payload_write_short_single_s "s"
- #define fss_payload_write_short_trim_s "T"
-
- #define fss_payload_write_long_file_s "file"
- #define fss_payload_write_long_content_s "content"
- #define fss_payload_write_long_double_s "double"
- #define fss_payload_write_long_ignore_s "ignore"
- #define fss_payload_write_long_object_s "object"
- #define fss_payload_write_long_partial_s "partial"
- #define fss_payload_write_long_prepend_s "prepend"
- #define fss_payload_write_long_single_s "single"
- #define fss_payload_write_long_trim_s "trim"
+ #define FSS_PAYLOAD_WRITE_pipe_content_end_s "\f"
+ #define FSS_PAYLOAD_WRITE_pipe_content_ignore_s "\v"
+ #define FSS_PAYLOAD_WRITE_pipe_content_start_s "\b"
+
+ #define FSS_PAYLOAD_WRITE_pipe_content_end_s_length 1
+ #define FSS_PAYLOAD_WRITE_pipe_content_ignore_s_length 1
+ #define FSS_PAYLOAD_WRITE_pipe_content_start_s_length 1
+
+ extern const f_string_static_t fss_payload_write_pipe_content_end_s;
+ extern const f_string_static_t fss_payload_write_pipe_content_ignore_s;
+ extern const f_string_static_t fss_payload_write_pipe_content_start_s;
+#endif // _di_fss_payload_write_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_payload_write_parameters_
+ #define FSS_PAYLOAD_WRITE_short_file_s "f"
+ #define FSS_PAYLOAD_WRITE_short_content_s "c"
+ #define FSS_PAYLOAD_WRITE_short_double_s "d"
+ #define FSS_PAYLOAD_WRITE_short_ignore_s "I"
+ #define FSS_PAYLOAD_WRITE_short_object_s "o"
+ #define FSS_PAYLOAD_WRITE_short_partial_s "p"
+ #define FSS_PAYLOAD_WRITE_short_prepend_s "P"
+ #define FSS_PAYLOAD_WRITE_short_single_s "s"
+ #define FSS_PAYLOAD_WRITE_short_trim_s "T"
+
+ #define FSS_PAYLOAD_WRITE_long_file_s "file"
+ #define FSS_PAYLOAD_WRITE_long_content_s "content"
+ #define FSS_PAYLOAD_WRITE_long_double_s "double"
+ #define FSS_PAYLOAD_WRITE_long_ignore_s "ignore"
+ #define FSS_PAYLOAD_WRITE_long_object_s "object"
+ #define FSS_PAYLOAD_WRITE_long_partial_s "partial"
+ #define FSS_PAYLOAD_WRITE_long_prepend_s "prepend"
+ #define FSS_PAYLOAD_WRITE_long_single_s "single"
+ #define FSS_PAYLOAD_WRITE_long_trim_s "trim"
+
+ #define FSS_PAYLOAD_WRITE_short_file_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_content_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_double_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_ignore_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_object_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_partial_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_prepend_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_single_s_length 1
+ #define FSS_PAYLOAD_WRITE_short_trim_s_length 1
+
+ #define FSS_PAYLOAD_WRITE_long_file_s_length 4
+ #define FSS_PAYLOAD_WRITE_long_content_s_length 7
+ #define FSS_PAYLOAD_WRITE_long_double_s_length 6
+ #define FSS_PAYLOAD_WRITE_long_ignore_s_length 6
+ #define FSS_PAYLOAD_WRITE_long_object_s_length 6
+ #define FSS_PAYLOAD_WRITE_long_partial_s_length 7
+ #define FSS_PAYLOAD_WRITE_long_prepend_s_length 7
+ #define FSS_PAYLOAD_WRITE_long_single_s_length 6
+ #define FSS_PAYLOAD_WRITE_long_trim_s_length 4
+
+ extern const f_string_static_t fss_payload_write_short_file_s;
+ extern const f_string_static_t fss_payload_write_short_content_s;
+ extern const f_string_static_t fss_payload_write_short_double_s;
+ extern const f_string_static_t fss_payload_write_short_ignore_s;
+ extern const f_string_static_t fss_payload_write_short_object_s;
+ extern const f_string_static_t fss_payload_write_short_partial_s;
+ extern const f_string_static_t fss_payload_write_short_prepend_s;
+ extern const f_string_static_t fss_payload_write_short_single_s;
+ extern const f_string_static_t fss_payload_write_short_trim_s;
+
+ extern const f_string_static_t fss_payload_write_long_file_s;
+ extern const f_string_static_t fss_payload_write_long_content_s;
+ extern const f_string_static_t fss_payload_write_long_double_s;
+ extern const f_string_static_t fss_payload_write_long_ignore_s;
+ extern const f_string_static_t fss_payload_write_long_object_s;
+ extern const f_string_static_t fss_payload_write_long_partial_s;
+ extern const f_string_static_t fss_payload_write_long_prepend_s;
+ extern const f_string_static_t fss_payload_write_long_single_s;
+ extern const f_string_static_t fss_payload_write_long_trim_s;
enum {
fss_payload_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_file_s, fss_payload_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s, fss_payload_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s, fss_payload_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s, fss_payload_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s, fss_payload_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_file_s.string, fss_payload_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s.string, fss_payload_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s.string, fss_payload_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s.string, fss_payload_write_long_ignore_s.string, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s.string, fss_payload_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s.string, fss_payload_write_long_partial_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s.string, fss_payload_write_long_prepend_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s.string, fss_payload_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s.string, fss_payload_write_long_trim_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_payload_write_total_parameters_d 18
-#endif // _di_fss_payload_write_defines_
-
-#ifndef _di_fss_payload_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_string_static_t prepend;
-
- f_color_context_t context;
- } fss_payload_write_main_t;
-
- #define fss_payload_write_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_payload_write_main_t_
+#endif // _di_fss_payload_write_parameters_
/**
* Deallocate main.
* @see fss_payload_write_main()
*/
#ifndef _di_fss_payload_write_main_delete_
- extern f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main);
+ extern f_status_t fss_payload_write_main_delete(fll_program_data_t * const main);
#endif // _di_fss_payload_write_main_delete_
#ifdef __cplusplus
#endif // _di_fss_payload_write_print_help_
#ifndef _di_fss_payload_write_main_
- f_status_t fss_payload_write_main(fss_payload_write_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_payload_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_payload_write_parameter_no_color_e, fss_payload_write_parameter_light_e, fss_payload_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
* @see fss_payload_write_main_delete()
*/
#ifndef _di_fss_payload_write_main_
- extern f_status_t fss_payload_write_main(fss_payload_write_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_payload_write_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_payload_write_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_payload_write_main_t data = fss_payload_write_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_payload_write_print_signal_received_
- void fss_payload_write_print_signal_received(fss_payload_write_main_t * const main, const f_status_t signal) {
+ void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_payload_write_print_signal_received_
#ifndef _di_fss_payload_write_signal_received_
- f_status_t fss_payload_write_signal_received(fss_payload_write_main_t * const main) {
+ f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_payload_write_print_signal_received_
- extern void fss_payload_write_print_signal_received(fss_payload_write_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_payload_write_signal_received_
- extern f_status_t fss_payload_write_signal_received(fss_payload_write_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_payload_write_error_parameter_same_times_print_
- void fss_payload_write_error_parameter_same_times_print(fss_payload_write_main_t * const main) {
+ void fss_payload_write_error_parameter_same_times_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_payload_write_error_parameter_same_times_print_
#ifndef _di_fss_payload_write_error_parameter_unsupported_eol_print_
- void fss_payload_write_error_parameter_unsupported_eol_print(fss_payload_write_main_t * const main) {
+ void fss_payload_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_payload_write_error_parameter_unsupported_eol_print_
#ifndef _di_fss_payload_write_error_parameter_value_missing_print_
- void fss_payload_write_error_parameter_value_missing_print(fss_payload_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) {
+ void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) {
if (main->error.verbosity == f_console_verbosity_quiet_e) {
return;
#endif // _di_fss_payload_write_error_parameter_value_missing_print_
#ifndef _di_fss_payload_write_process_
- f_status_t fss_payload_write_process(fss_payload_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
+ f_status_t fss_payload_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_state_t state = macro_f_state_t_initialize(fss_payload_write_common_allocation_large_d, fss_payload_write_common_allocation_small_d, 0, 0, 0, 0, 0);
#endif // _di_fss_payload_write_process_
#ifndef _di_fss_payload_write_process_pipe_
- f_status_t fss_payload_write_process_pipe(fss_payload_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
+ f_status_t fss_payload_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
f_status_t status_pipe = F_none;
* The main program data.
*/
#ifndef _di_fss_payload_write_error_parameter_same_times_print_
- void fss_payload_write_error_parameter_same_times_print(fss_payload_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_payload_write_error_parameter_same_times_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_error_parameter_same_times_print_
/**
* The main program data.
*/
#ifndef _di_fss_payload_write_error_parameter_unsupported_eol_print_
- void fss_payload_write_error_parameter_unsupported_eol_print(fss_payload_write_main_t * const main) F_attribute_visibility_internal_d;
+ void fss_payload_write_error_parameter_unsupported_eol_print(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_error_parameter_unsupported_eol_print_
/**
* The parameter name, such as "help" in "--help".
*/
#ifndef _di_fss_payload_write_error_parameter_value_missing_print_
- void fss_payload_write_error_parameter_value_missing_print(fss_payload_write_main_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
+ void fss_payload_write_error_parameter_value_missing_print(fll_program_data_t * const main, const f_string_t symbol, const f_string_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_error_parameter_value_missing_print_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_payload_write_process_
- extern f_status_t fss_payload_write_process(fss_payload_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_process_
/**
* F_failure (with error bit) for any othe failure.
*/
#ifndef _di_fss_payload_write_process_pipe_
- extern f_status_t fss_payload_write_process_pipe(fss_payload_write_main_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fss_payload_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_process_pipe_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_status_code_program_version_
- const f_string_static_t fss_status_code_program_version_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_version_s, 0, FSS_STATUS_CODE_program_version_s_length);
-#endif // _di_fss_status_code_program_version_
-
-#ifndef _di_fss_status_code_program_name_
- const f_string_static_t fss_status_code_program_name_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_name_s, 0, FSS_STATUS_CODE_program_name_s_length);
- const f_string_static_t fss_status_code_program_name_long_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_name_long_s, 0, FSS_STATUS_CODE_program_name_long_s_length);
-#endif // _di_fss_status_code_program_name_
+#ifndef _di_fss_status_code_program_help_parameters_
+ const f_string_static_t fss_status_code_program_help_parameters_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_program_help_parameters_s, 0, FSS_STATUS_CODE_program_help_parameters_s_length);
+#endif // _di_fss_status_code_program_help_parameters_
+
+#ifndef _di_fss_status_code_parameters_
+ const f_string_static_t fss_status_code_short_is_fine_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_short_is_fine_s, 0, FSS_STATUS_CODE_short_is_fine_s_length);
+ const f_string_static_t fss_status_code_short_is_warning_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_short_is_warning_s, 0, FSS_STATUS_CODE_short_is_warning_s_length);
+ const f_string_static_t fss_status_code_short_is_error_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_short_is_error_s, 0, FSS_STATUS_CODE_short_is_error_s_length);
+ const f_string_static_t fss_status_code_short_number_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_short_number_s, 0, FSS_STATUS_CODE_short_number_s_length);
+
+ const f_string_static_t fss_status_code_long_is_fine_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_long_is_fine_s, 0, FSS_STATUS_CODE_long_is_fine_s_length);
+ const f_string_static_t fss_status_code_long_is_warning_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_long_is_warning_s, 0, FSS_STATUS_CODE_long_is_warning_s_length);
+ const f_string_static_t fss_status_code_long_is_error_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_long_is_error_s, 0, FSS_STATUS_CODE_long_is_error_s_length);
+ const f_string_static_t fss_status_code_long_number_s = macro_f_string_static_t_initialize(FSS_STATUS_CODE_long_number_s, 0, FSS_STATUS_CODE_long_number_s_length);
+#endif // _di_fss_status_code_parameters_
#ifndef _di_fss_status_code_main_delete_
- f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+ f_status_t fss_status_code_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_fss_status_code_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_fss_status_code_program_version_
#define FSS_STATUS_code_program_version_major_s F_string_ascii_0_s
#define FSS_STATUS_code_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t fss_status_code_program_version_s;
#endif // _di_fss_status_code_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_fss_status_code_program_name_
#define FSS_STATUS_code_program_name_s "FSS_STATUS_code"
#define FSS_STATUS_code_program_name_long_s "FSS Status Code"
const f_string_static_t fss_status_code_program_name_long_s;
#endif // _di_fss_status_code_program_name_
+/**
+ * The program help related data.
+ */
+#ifndef _di_fss_status_code_program_help_parameters_
+ #define FSS_STATUS_CODE_program_help_parameters_s "status code(s)"
+ #define FSS_STATUS_CODE_program_help_parameters_s_length 14
+
+ extern const f_string_static_t fss_status_code_program_help_parameters_s;
+#endif // _di_fss_status_code_program_help_parameters_
+
+/**
+ * The program defines.
+ */
#ifndef _di_fss_status_code_defines_
#define fss_status_code_signal_check_d 10000
+#endif // _di_fss_status_code_defines_
- #define fss_status_code_short_is_fine_s "f"
- #define fss_status_code_short_is_warning_s "w"
- #define fss_status_code_short_is_error_s "e"
- #define fss_status_code_short_number_s "n"
-
- #define fss_status_code_long_is_fine_s "is_fine"
- #define fss_status_code_long_is_warning_s "is_warning"
- #define fss_status_code_long_is_error_s "is_error"
- #define fss_status_code_long_number_s "number"
+/**
+ * The main program parameters.
+ */
+#ifndef _di_fss_status_code_parameters_
+ #define FSS_STATUS_CODE_short_is_fine_s "f"
+ #define FSS_STATUS_CODE_short_is_warning_s "w"
+ #define FSS_STATUS_CODE_short_is_error_s "e"
+ #define FSS_STATUS_CODE_short_number_s "n"
+
+ #define FSS_STATUS_CODE_long_is_fine_s "is_fine"
+ #define FSS_STATUS_CODE_long_is_warning_s "is_warning"
+ #define FSS_STATUS_CODE_long_is_error_s "is_error"
+ #define FSS_STATUS_CODE_long_number_s "number"
+
+ #define FSS_STATUS_CODE_short_is_fine_s_length 1
+ #define FSS_STATUS_CODE_short_is_warning_s_length 1
+ #define FSS_STATUS_CODE_short_is_error_s_length 1
+ #define FSS_STATUS_CODE_short_number_s_length 1
+
+ #define FSS_STATUS_CODE_long_is_fine_s_length 7
+ #define FSS_STATUS_CODE_long_is_warning_s_length 10
+ #define FSS_STATUS_CODE_long_is_error_s_length 8
+ #define FSS_STATUS_CODE_long_number_s_length 6
+
+ extern const f_string_static_t fss_status_code_short_is_fine_s;
+ extern const f_string_static_t fss_status_code_short_is_warning_s;
+ extern const f_string_static_t fss_status_code_short_is_error_s;
+ extern const f_string_static_t fss_status_code_short_number_s;
+
+ extern const f_string_static_t fss_status_code_long_is_fine_s;
+ extern const f_string_static_t fss_status_code_long_is_warning_s;
+ extern const f_string_static_t fss_status_code_long_is_error_s;
+ extern const f_string_static_t fss_status_code_long_number_s;
enum {
fss_status_code_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_number_s, fss_status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_is_fine_s.string, fss_status_code_long_is_fine_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s.string, fss_status_code_long_is_warning_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s.string, fss_status_code_long_is_error_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_number_s.string, fss_status_code_long_number_s.string, 0, 0, f_console_type_normal_e), \
}
#define fss_status_code_total_parameters_d 13
#endif // _di_fss_status_code_defines_
-#ifndef _di_fss_status_code_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } fss_status_code_main_t;
-
- #define fss_status_code_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_status_code_main_t_
-
/**
* Deallocate main.
*
* @see fss_status_code_main()
*/
#ifndef _di_fss_status_code_main_delete_
- extern f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main);
+ extern f_status_t fss_status_code_main_delete(fll_program_data_t * const main);
#endif // _di_fss_status_code_main_delete_
#ifdef __cplusplus
fll_program_print_help_option(file, context, fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise.");
fll_program_print_help_option(file, context, fss_status_code_short_number_s, fss_status_code_long_number_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number.");
- fll_program_print_help_usage(file, context, fss_status_code_program_name_s, "status code(s)");
+ fll_program_print_help_usage(file, context, fss_status_code_program_name_s, fss_status_code_program_help_parameters_s);
funlockfile(file.stream);
#endif // _di_fss_status_code_print_help_
#ifndef _di_fss_status_code_main_
- f_status_t fss_status_code_main(fss_status_code_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fss_status_code_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { fss_status_code_parameter_no_color_e, fss_status_code_parameter_light_e, fss_status_code_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
return F_status_set_error(status);
}
- if (main->remaining.used == 0 && !main->process_pipe) {
+ if (main->parameters.remaining.used == 0 && !main->process_pipe) {
fll_print_format("%[You failed to specify an error code.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
fss_status_code_main_delete(main);
// @todo call fss_status_code_process_check() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_status_code_signal_check_d)) {
if (fss_status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = fss_status_code_process_check(main, arguments->argv[main->remaining.array[i]]);
+ status2 = fss_status_code_process_check(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
// @todo call fss_status_code_process_number() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_status_code_signal_check_d)) {
if (fss_status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = fss_status_code_process_number(main, arguments->argv[main->remaining.array[i]]);
+ status2 = fss_status_code_process_number(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
// @todo call fss_status_code_process_normal() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % fss_status_code_signal_check_d)) {
if (fss_status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = fss_status_code_process_normal(main, arguments->argv[main->remaining.array[i]]);
+ status2 = fss_status_code_process_normal(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
* @see fss_status_code_main_delete()
*/
#ifndef _di_fss_status_code_main_
- extern f_status_t fss_status_code_main(fss_status_code_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fss_status_code_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_status_code_main_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- fss_status_code_main_t data = fss_status_code_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_fss_status_code_print_signal_received_
- void fss_status_code_print_signal_received(fss_status_code_main_t * const main, const f_status_t signal) {
+ void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_fss_status_code_print_signal_received_
#ifndef _di_fss_status_code_signal_received_
- f_status_t fss_status_code_signal_received(fss_status_code_main_t * const main) {
+ f_status_t fss_status_code_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_fss_status_code_print_signal_received_
- extern void fss_status_code_print_signal_received(fss_status_code_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_fss_status_code_signal_received_
- extern f_status_t fss_status_code_signal_received(fss_status_code_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fss_status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fss_status_code_process_check_
- f_status_t fss_status_code_process_check(fss_status_code_main_t * const main, const f_string_t value) {
+ f_status_t fss_status_code_process_check(fll_program_data_t * const main, const f_string_t value) {
f_number_unsigned_t number = 0;
#endif // _di_fss_status_code_process_check_
#ifndef _di_fss_status_code_process_number_
- f_status_t fss_status_code_process_number(fss_status_code_main_t * const main, const f_string_t value) {
+ f_status_t fss_status_code_process_number(fll_program_data_t * const main, const f_string_t value) {
f_status_t status = F_none;
#endif // _di_fss_status_code_process_number_
#ifndef _di_fss_status_code_process_normal_
- f_status_t fss_status_code_process_normal(fss_status_code_main_t * const main, const f_string_t value) {
+ f_status_t fss_status_code_process_normal(fll_program_data_t * const main, const f_string_t value) {
f_number_unsigned_t number = 0;
#endif // _di_fss_status_code_process_normal_
#ifndef _di_fss_status_code_convert_number_
- f_status_t fss_status_code_convert_number(fss_status_code_main_t * const main, const f_string_t value, f_number_unsigned_t *number) {
+ f_status_t fss_status_code_convert_number(fll_program_data_t * const main, const f_string_t value, f_number_unsigned_t *number) {
const f_string_range_t range = macro_f_string_range_t_initialize(strlen(value));
* @see fss_status_code_convert_number()
*/
#ifndef _di_fss_status_code_process_check_
- extern f_status_t fss_status_code_process_check(fss_status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t fss_status_code_process_check(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_process_check_
/**
* @see fll_fss_status_string_from()
*/
#ifndef _di_fss_status_code_process_number_
- extern f_status_t fss_status_code_process_number(fss_status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t fss_status_code_process_number(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_process_number_
/**
* @see fss_status_code_convert_number()
*/
#ifndef _di_fss_status_code_process_normal_
- extern f_status_t fss_status_code_process_normal(fss_status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t fss_status_code_process_normal(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_process_normal_
/**
* @see fl_console_parameter_to_number_unsigned()
*/
#ifndef _di_fss_status_code_convert_number_
- extern f_status_t fss_status_code_convert_number(fss_status_code_main_t * const main, const f_string_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t fss_status_code_convert_number(fll_program_data_t * const main, const f_string_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_convert_number_
#ifdef __cplusplus
const f_string_static_t iki_read_program_name_long_s = macro_f_string_static_t_initialize(IKI_READ_program_name_long_s, 0, IKI_READ_program_name_long_s_length);
#endif // _di_iki_read_program_name_
+#ifndef _di_iki_read_parameters_
+ const f_string_static_t iki_read_short_at_s = macro_f_string_static_t_initialize(IKI_READ_short_at_s, 0, IKI_READ_short_at_s_length);
+ const f_string_static_t iki_read_short_content_s = macro_f_string_static_t_initialize(IKI_READ_short_content_s, 0, IKI_READ_short_content_s_length);
+ const f_string_static_t iki_read_short_line_s = macro_f_string_static_t_initialize(IKI_READ_short_line_s, 0, IKI_READ_short_line_s_length);
+ const f_string_static_t iki_read_short_literal_s = macro_f_string_static_t_initialize(IKI_READ_short_literal_s, 0, IKI_READ_short_literal_s_length);
+ const f_string_static_t iki_read_short_name_s = macro_f_string_static_t_initialize(IKI_READ_short_name_s, 0, IKI_READ_short_name_s_length);
+ const f_string_static_t iki_read_short_object_s = macro_f_string_static_t_initialize(IKI_READ_short_object_s, 0, IKI_READ_short_object_s_length);
+ const f_string_static_t iki_read_short_substitute_s = macro_f_string_static_t_initialize(IKI_READ_short_substitute_s, 0, IKI_READ_short_substitute_s_length);
+ const f_string_static_t iki_read_short_total_s = macro_f_string_static_t_initialize(IKI_READ_short_total_s, 0, IKI_READ_short_total_s_length);
+ const f_string_static_t iki_read_short_whole_s = macro_f_string_static_t_initialize(IKI_READ_short_whole_s, 0, IKI_READ_short_whole_s_length);
+
+ const f_string_static_t iki_read_long_at_s = macro_f_string_static_t_initialize(IKI_READ_long_at_s, 0, IKI_READ_long_at_s_length);
+ const f_string_static_t iki_read_long_content_s = macro_f_string_static_t_initialize(IKI_READ_long_content_s, 0, IKI_READ_long_content_s_length);
+ const f_string_static_t iki_read_long_line_s = macro_f_string_static_t_initialize(IKI_READ_long_line_s, 0, IKI_READ_long_line_s_length);
+ const f_string_static_t iki_read_long_literal_s = macro_f_string_static_t_initialize(IKI_READ_long_literal_s, 0, IKI_READ_long_literal_s_length);
+ const f_string_static_t iki_read_long_name_s = macro_f_string_static_t_initialize(IKI_READ_long_name_s, 0, IKI_READ_long_name_s_length);
+ const f_string_static_t iki_read_long_object_s = macro_f_string_static_t_initialize(IKI_READ_long_object_s, 0, IKI_READ_long_object_s_length);
+ const f_string_static_t iki_read_long_substitute_s = macro_f_string_static_t_initialize(IKI_READ_long_substitute_s, 0, IKI_READ_long_substitute_s_length);
+ const f_string_static_t iki_read_long_total_s = macro_f_string_static_t_initialize(IKI_READ_long_total_s, 0, IKI_READ_long_total_s_length);
+ const f_string_static_t iki_read_long_whole_s = macro_f_string_static_t_initialize(IKI_READ_long_whole_s, 0, IKI_READ_long_whole_s_length);
+#endif // _di_iki_read_parameters_
+
#ifndef _di_iki_read_main_delete_
f_status_t iki_read_main_delete(iki_read_main_t * const main) {
f_console_parameters_delete(&main->parameters);
- f_type_array_lengths_resize(0, &main->remaining);
f_string_dynamic_resize(0, &main->buffer);
macro_f_color_context_t_delete_simple(main->context);
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_iki_read_program_version_
#define IKI_READ_program_version_major_s F_string_ascii_0_s
#define IKI_READ_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t iki_read_program_version_s;
#endif // _di_iki_read_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_iki_read_program_name_
#define IKI_READ_program_name_s "iki_read"
#define IKI_READ_program_name_long_s "IKI Read"
extern const f_string_static_t iki_read_program_name_long_s;
#endif // _di_iki_read_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_iki_read_defines_
#define iki_read_signal_check_d 10000
iki_read_mode_object_e,
iki_read_mode_total_e,
};
+#endif // _di_iki_read_defines_
- #define iki_read_short_at_s "a"
- #define iki_read_short_content_s "c"
- #define iki_read_short_line_s "l"
- #define iki_read_short_literal_s "L"
- #define iki_read_short_name_s "n"
- #define iki_read_short_object_s "o"
- #define iki_read_short_substitute_s "s"
- #define iki_read_short_total_s "t"
- #define iki_read_short_whole_s "w"
-
- #define iki_read_long_at_s "at"
- #define iki_read_long_content_s "content"
- #define iki_read_long_line_s "line"
- #define iki_read_long_literal_s "literal"
- #define iki_read_long_name_s "name"
- #define iki_read_long_object_s "object"
- #define iki_read_long_substitute_s "substitute"
- #define iki_read_long_total_s "total"
- #define iki_read_long_whole_s "whole"
+/**
+ * The main program parameters.
+ */
+#ifndef _di_iki_read_parameters_
+ #define IKI_READ_short_at_s "a"
+ #define IKI_READ_short_content_s "c"
+ #define IKI_READ_short_line_s "l"
+ #define IKI_READ_short_literal_s "L"
+ #define IKI_READ_short_name_s "n"
+ #define IKI_READ_short_object_s "o"
+ #define IKI_READ_short_substitute_s "s"
+ #define IKI_READ_short_total_s "t"
+ #define IKI_READ_short_whole_s "w"
+
+ #define IKI_READ_long_at_s "at"
+ #define IKI_READ_long_content_s "content"
+ #define IKI_READ_long_line_s "line"
+ #define IKI_READ_long_literal_s "literal"
+ #define IKI_READ_long_name_s "name"
+ #define IKI_READ_long_object_s "object"
+ #define IKI_READ_long_substitute_s "substitute"
+ #define IKI_READ_long_total_s "total"
+ #define IKI_READ_long_whole_s "whole"
+
+ #define IKI_READ_short_at_s_length 1
+ #define IKI_READ_short_content_s_length 1
+ #define IKI_READ_short_line_s_length 1
+ #define IKI_READ_short_literal_s_length 1
+ #define IKI_READ_short_name_s_length 1
+ #define IKI_READ_short_object_s_length 1
+ #define IKI_READ_short_substitute_s_length 1
+ #define IKI_READ_short_total_s_length 1
+ #define IKI_READ_short_whole_s_length 1
+
+ #define IKI_READ_long_at_s_length 2
+ #define IKI_READ_long_content_s_length 7
+ #define IKI_READ_long_line_s_length 4
+ #define IKI_READ_long_literal_s_length 7
+ #define IKI_READ_long_name_s_length 4
+ #define IKI_READ_long_object_s_length 7
+ #define IKI_READ_long_substitute_s_length 10
+ #define IKI_READ_long_total_s_length 5
+ #define IKI_READ_long_whole_s_length 5
+
+ extern const f_string_static_t iki_read_short_at_s;
+ extern const f_string_static_t iki_read_short_content_s;
+ extern const f_string_static_t iki_read_short_line_s;
+ extern const f_string_static_t iki_read_short_literal_s;
+ extern const f_string_static_t iki_read_short_name_s;
+ extern const f_string_static_t iki_read_short_object_s;
+ extern const f_string_static_t iki_read_short_substitute_s;
+ extern const f_string_static_t iki_read_short_total_s;
+ extern const f_string_static_t iki_read_short_whole_s;
+
+ extern const f_string_static_t iki_read_long_at_s;
+ extern const f_string_static_t iki_read_long_content_s;
+ extern const f_string_static_t iki_read_long_line_s;
+ extern const f_string_static_t iki_read_long_literal_s;
+ extern const f_string_static_t iki_read_long_name_s;
+ extern const f_string_static_t iki_read_long_object_s;
+ extern const f_string_static_t iki_read_long_substitute_s;
+ extern const f_string_static_t iki_read_long_total_s;
+ extern const f_string_static_t iki_read_long_whole_s;
enum {
iki_read_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_at_s, iki_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_content_s, iki_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_line_s, iki_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_literal_s, iki_read_long_literal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_name_s, iki_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_object_s, iki_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_whole_s, iki_read_long_whole_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_substitute_s, iki_read_long_substitute_s, 0, 3, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_total_s, iki_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_at_s.string, iki_read_long_at_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_content_s.string, iki_read_long_content_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_line_s.string, iki_read_long_line_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_literal_s.string, iki_read_long_literal_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_name_s.string, iki_read_long_name_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_object_s.string, iki_read_long_object_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_whole_s.string, iki_read_long_whole_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_substitute_s.string, iki_read_long_substitute_s.string, 0, 3, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_total_s.string, iki_read_long_total_s.string, 0, 0, f_console_type_normal_e), \
}
#define iki_read_total_parameters_d 18
-#endif // _di_iki_read_defines_
+#endif // _di_iki_read_parameters_
#ifndef _di_iki_read_substitution_t_
#define iki_read_substitution_vocabulary_s "vocabulary"
#define macro_iki_read_substitutions_t_adjust(status, replacements, length) macro_f_memory_structure_adjust(status, replacements, iki_read_substitution_t, length)
#endif // _di_iki_read_substitutions_t_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * remaining: The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_iki_read_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
fl_print_t output;
extern "C" {
#endif
-#ifndef _di_iki_read_program_version_
- const f_string_static_t iki_read_program_version_s = macro_f_string_static_t_initialize(IKI_READ_program_version_s, 0, IKI_READ_program_version_s_length);
-#endif // _di_iki_read_program_version_
-
-#ifndef _di_iki_read_program_name_
- const f_string_static_t iki_read_program_name_s = macro_f_string_static_t_initialize(IKI_READ_program_name_s, 0, IKI_READ_program_name_s_length);
- const f_string_static_t iki_read_program_name_long_s = macro_f_string_static_t_initialize(IKI_READ_program_name_long_s, 0, IKI_READ_program_name_long_s_length);
-#endif // _di_iki_read_program_name_
-
#ifndef _di_iki_read_print_help_
f_status_t iki_read_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, iki_read_short_substitute_s, iki_read_long_substitute_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Substitute the entire variable for the given name and content value with the given string.");
- fll_program_print_help_usage(file, context, iki_read_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, iki_read_program_name_s, fll_program_parameter_filenames_s);
fl_print_format(" %[Notes:%]%r", file.stream, context.set.important, context.set.important, f_string_eol_s);
fl_print_format(" This program will find and print variables, vocabularies, or content following the IKI standard, without focusing on any particular vocabulary specification.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
f_console_parameter_id_t ids[3] = { iki_read_parameter_no_color_e, iki_read_parameter_light_e, iki_read_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
return F_none;
}
- if (main->remaining.used > 0 || main->process_pipe) {
+ if (main->parameters.remaining.used > 0 || main->process_pipe) {
if (main->parameters.array[iki_read_parameter_at_e].result == f_console_result_found_e) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
flockfile(main->error.to.stream);
f_string_dynamic_resize(0, &main->buffer);
}
- if (F_status_is_fine(status) && main->remaining.used > 0) {
+ if (F_status_is_fine(status) && main->parameters.remaining.used > 0) {
f_array_length_t i = 0;
f_array_length_t total = 0;
f_file_t file = f_file_t_initialize;
- for (uint16_t signal_check = 0; i < main->remaining.used; ++i) {
+ for (uint16_t signal_check = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % iki_read_signal_check_d)) {
if (iki_read_signal_received(main)) {
macro_f_file_t_reset(file);
total = 0;
- status = f_file_open(arguments->argv[main->remaining.array[i]], 0, &file);
+ status = f_file_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}
status = f_file_size_by_id(file.id, &total);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
f_file_stream_close(F_true, &file);
break;
f_file_stream_close(F_true, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->parameters.remaining.array[i]], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}
- status = iki_read_process_buffer(main, arguments, arguments->argv[main->remaining.array[i]]);
+ status = iki_read_process_buffer(main, arguments, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status)) break;
// Clear buffers before repeating the loop.
const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length);
#endif // _di_iki_write_program_name_
+#ifndef _di_iki_write_parameters_
+ const f_string_static_t iki_write_short_file_s = macro_f_string_static_t_initialize(IKI_WRITE_short_file_s, 0, IKI_WRITE_short_file_s_length);
+ const f_string_static_t iki_write_short_content_s = macro_f_string_static_t_initialize(IKI_WRITE_short_content_s, 0, IKI_WRITE_short_content_s_length);
+ const f_string_static_t iki_write_short_double_s = macro_f_string_static_t_initialize(IKI_WRITE_short_double_s, 0, IKI_WRITE_short_double_s_length);
+ const f_string_static_t iki_write_short_object_s = macro_f_string_static_t_initialize(IKI_WRITE_short_object_s, 0, IKI_WRITE_short_object_s_length);
+ const f_string_static_t iki_write_short_single_s = macro_f_string_static_t_initialize(IKI_WRITE_short_single_s, 0, IKI_WRITE_short_single_s_length);
+
+ const f_string_static_t iki_write_long_file_s = macro_f_string_static_t_initialize(IKI_WRITE_long_file_s, 0, IKI_WRITE_long_file_s_length);
+ const f_string_static_t iki_write_long_content_s = macro_f_string_static_t_initialize(IKI_WRITE_long_content_s, 0, IKI_WRITE_long_content_s_length);
+ const f_string_static_t iki_write_long_double_s = macro_f_string_static_t_initialize(IKI_WRITE_long_double_s, 0, IKI_WRITE_long_double_s_length);
+ const f_string_static_t iki_write_long_object_s = macro_f_string_static_t_initialize(IKI_WRITE_long_object_s, 0, IKI_WRITE_long_object_s_length);
+ const f_string_static_t iki_write_long_single_s = macro_f_string_static_t_initialize(IKI_WRITE_long_single_s, 0, IKI_WRITE_long_single_s_length);
+#endif // _di_iki_write_parameters_
+
#ifndef _di_iki_write_main_delete_
f_status_t iki_write_main_delete(iki_write_main_t * const main) {
f_console_parameters_delete(&main->parameters);
- f_type_array_lengths_resize(0, &main->remaining);
f_string_dynamic_resize(0, &main->buffer);
macro_f_color_context_t_delete_simple(main->context);
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_iki_write_program_version_
#define IKI_WRITE_program_version_major_s F_string_ascii_0_s
#define IKI_WRITE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t iki_write_program_version_s;
#endif // _di_iki_write_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_iki_write_program_name_
#define iki_write_program_name_s "iki_write"
#define iki_write_program_name_long_s "IKI Write"
extern const f_string_static_t iki_write_program_name_long_s;
#endif // _di_iki_write_program_name_
+/**
+ * The program defines.
+ */
#ifndef _di_iki_write_defines_
#define iki_write_signal_check_d 10000
+#endif // _di_iki_write_defines_
- #define iki_write_short_file_s "f"
- #define iki_write_short_content_s "c"
- #define iki_write_short_double_s "d"
- #define iki_write_short_object_s "o"
- #define iki_write_short_single_s "s"
-
- #define iki_write_long_file_s "file"
- #define iki_write_long_content_s "content"
- #define iki_write_long_double_s "double"
- #define iki_write_long_object_s "object"
- #define iki_write_long_single_s "single"
+/**
+ * The main program parameters.
+ */
+#ifndef _di_iki_write_parameters_
+ #define IKI_WRITE_short_file_s "f"
+ #define IKI_WRITE_short_content_s "c"
+ #define IKI_WRITE_short_double_s "d"
+ #define IKI_WRITE_short_object_s "o"
+ #define IKI_WRITE_short_single_s "s"
+
+ #define IKI_WRITE_long_file_s "file"
+ #define IKI_WRITE_long_content_s "content"
+ #define IKI_WRITE_long_double_s "double"
+ #define IKI_WRITE_long_object_s "object"
+ #define IKI_WRITE_long_single_s "single"
+
+ #define IKI_WRITE_short_file_s_length 1
+ #define IKI_WRITE_short_content_s_length 1
+ #define IKI_WRITE_short_double_s_length 1
+ #define IKI_WRITE_short_object_s_length 1
+ #define IKI_WRITE_short_single_s_length 1
+
+ #define IKI_WRITE_long_file_s_length 4
+ #define IKI_WRITE_long_content_s_length 7
+ #define IKI_WRITE_long_double_s_length 6
+ #define IKI_WRITE_long_object_s_length 6
+ #define IKI_WRITE_long_single_s_length 6
+
+ extern const f_string_static_t iki_write_short_file_s;
+ extern const f_string_static_t iki_write_short_content_s;
+ extern const f_string_static_t iki_write_short_double_s;
+ extern const f_string_static_t iki_write_short_object_s;
+ extern const f_string_static_t iki_write_short_single_s;
+
+ extern const f_string_static_t iki_write_long_file_s;
+ extern const f_string_static_t iki_write_long_content_s;
+ extern const f_string_static_t iki_write_long_double_s;
+ extern const f_string_static_t iki_write_long_object_s;
+ extern const f_string_static_t iki_write_long_single_s;
enum {
iki_write_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_file_s, iki_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_content_s, iki_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_double_s, iki_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_object_s, iki_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_single_s, iki_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_file_s.string, iki_write_long_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_content_s.string, iki_write_long_content_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_double_s.string, iki_write_long_double_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_object_s.string, iki_write_long_object_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_single_s.string, iki_write_long_single_s.string, 0, 0, f_console_type_normal_e), \
}
#define iki_write_total_parameters_d 14
-#endif // _di_iki_write_defines_
+#endif // _di_iki_write_parameters_
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * remaining: The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ *
+ * @todo
+ */
#ifndef _di_iki_write_main_t_
typedef struct {
f_console_parameters_t parameters;
- f_array_lengths_t remaining;
bool process_pipe;
fl_print_t output;
extern "C" {
#endif
-#ifndef _di_iki_write_program_version_
- const f_string_static_t iki_write_program_version_s = macro_f_string_static_t_initialize(IKI_WRITE_program_version_s, 0, IKI_WRITE_program_version_s_length);
-#endif // _di_iki_write_program_version_
-
-#ifndef _di_iki_write_program_name_
- const f_string_static_t iki_write_program_name_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_s, 0, IKI_WRITE_program_name_s_length);
- const f_string_static_t iki_write_program_name_long_s = macro_f_string_static_t_initialize(IKI_WRITE_program_name_long_s, 0, IKI_WRITE_program_name_long_s_length);
-#endif // _di_iki_write_program_name_
-
#ifndef _di_iki_write_print_help_
f_status_t iki_write_print_help(const f_file_t file, const f_color_context_t context) {
f_console_parameter_id_t ids[3] = { iki_write_parameter_no_color_e, iki_write_parameter_light_e, iki_write_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length);
#endif // _di_status_code_program_name_
-#ifndef _di_status_code_main_delete_
- f_status_t status_code_main_delete(status_code_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
+#ifndef _di_status_code_program_help_parameters_
+ const f_string_static_t status_code_program_help_parameters_s = macro_f_string_static_t_initialize(STATUS_CODE_program_help_parameters_s, 0, STATUS_CODE_program_help_parameters_s_length);
+#endif // _di_status_code_program_help_parameters_
+
+#ifndef _di_status_code_parameters_
+ const f_string_static_t status_code_short_is_fine_s = macro_f_string_static_t_initialize(STATUS_CODE_short_is_fine_s, 0, STATUS_CODE_short_is_fine_s_length);
+ const f_string_static_t status_code_short_is_warning_s = macro_f_string_static_t_initialize(STATUS_CODE_short_is_warning_s, 0, STATUS_CODE_short_is_warning_s_length);
+ const f_string_static_t status_code_short_is_error_s = macro_f_string_static_t_initialize(STATUS_CODE_short_is_error_s, 0, STATUS_CODE_short_is_error_s_length);
+ const f_string_static_t status_code_short_number_s = macro_f_string_static_t_initialize(STATUS_CODE_short_number_s, 0, STATUS_CODE_short_number_s_length);
+
+ const f_string_static_t status_code_long_is_fine_s = macro_f_string_static_t_initialize(STATUS_CODE_long_is_fine_s, 0, STATUS_CODE_long_is_fine_s_length);
+ const f_string_static_t status_code_long_is_warning_s = macro_f_string_static_t_initialize(STATUS_CODE_long_is_warning_s, 0, STATUS_CODE_long_is_warning_s_length);
+ const f_string_static_t status_code_long_is_error_s = macro_f_string_static_t_initialize(STATUS_CODE_long_is_error_s, 0, STATUS_CODE_long_is_error_s_length);
+ const f_string_static_t status_code_long_number_s = macro_f_string_static_t_initialize(STATUS_CODE_long_number_s, 0, STATUS_CODE_long_number_s_length);
+#endif // _di_status_code_parameters_
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
+#ifndef _di_status_code_main_delete_
+ f_status_t status_code_main_delete(fll_program_data_t * const main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_status_code_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_status_code_program_version_
#define STATUS_CODE_program_version_major_s F_string_ascii_0_s
#define STATUS_CODE_program_version_minor_s F_string_ascii_5_s
extern const f_string_static_t status_code_program_version_s;
#endif // _di_status_code_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_status_code_program_name_
#define STATUS_CODE_progam_name_s "status_code"
#define STATUS_CODE_progam_name_long_s "FSS Status Code"
extern const f_string_static_t status_code_program_name_long_s;
#endif // _di_status_code_program_name_
+/**
+ * The program help related data.
+ */
+#ifndef _di_status_code_program_help_parameters_
+ #define STATUS_CODE_program_help_parameters_s "status code(s)"
+ #define STATUS_CODE_program_help_parameters_s_length 14
+
+ extern const f_string_static_t status_code_program_help_parameters_s;
+#endif // _di_status_code_program_help_parameters_
+
+/**
+ * The program defines.
+ */
#ifndef _di_status_code_defines_
#define status_code_signal_check_d 10000
+#endif // _di_status_code_defines_
- #define status_code_short_is_fine_s "f"
- #define status_code_short_is_warning_s "w"
- #define status_code_short_is_error_s "e"
- #define status_code_short_number_s "n"
-
- #define status_code_long_is_fine_s "is_fine"
- #define status_code_long_is_warning_s "is_warning"
- #define status_code_long_is_error_s "is_error"
- #define status_code_long_number_s "number"
+/**
+ * The main program parameters.
+ */
+#ifndef _di_status_code_parameters_
+ #define STATUS_CODE_short_is_fine_s "f"
+ #define STATUS_CODE_short_is_warning_s "w"
+ #define STATUS_CODE_short_is_error_s "e"
+ #define STATUS_CODE_short_number_s "n"
+
+ #define STATUS_CODE_long_is_fine_s "is_fine"
+ #define STATUS_CODE_long_is_warning_s "is_warning"
+ #define STATUS_CODE_long_is_error_s "is_error"
+ #define STATUS_CODE_long_number_s "number"
+
+ #define STATUS_CODE_short_is_fine_s_length 1
+ #define STATUS_CODE_short_is_warning_s_length 1
+ #define STATUS_CODE_short_is_error_s_length 1
+ #define STATUS_CODE_short_number_s_length 1
+
+ #define STATUS_CODE_long_is_fine_s_length 7
+ #define STATUS_CODE_long_is_warning_s_length 10
+ #define STATUS_CODE_long_is_error_s_length 8
+ #define STATUS_CODE_long_number_s_length 6
+
+ extern const f_string_static_t status_code_short_is_fine_s;
+ extern const f_string_static_t status_code_short_is_warning_s;
+ extern const f_string_static_t status_code_short_is_error_s;
+ extern const f_string_static_t status_code_short_number_s;
+
+ extern const f_string_static_t status_code_long_is_fine_s;
+ extern const f_string_static_t status_code_long_is_warning_s;
+ extern const f_string_static_t status_code_long_is_error_s;
+ extern const f_string_static_t status_code_long_number_s;
enum {
status_code_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(status_code_short_is_fine_s, status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_is_warning_s, status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_is_error_s, status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_number_s, status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_is_fine_s.string, status_code_long_is_fine_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_is_warning_s.string, status_code_long_is_warning_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_is_error_s.string, status_code_long_is_error_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_number_s.string, status_code_long_number_s.string, 0, 0, f_console_type_normal_e), \
}
#define status_code_total_parameters_d 13
-#endif // _di_status_code_defines_
-
-#ifndef _di_status_code_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } status_code_main_t;
-
- #define status_code_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_status_code_main_t_
+#endif // _di_status_code_parameters_
/**
* Deallocate main.
* @see status_code_main()
*/
#ifndef _di_status_code_main_delete_
- extern f_status_t status_code_main_delete(status_code_main_t * const main);
+ extern f_status_t status_code_main_delete(fll_program_data_t * const main);
#endif // _di_status_code_main_delete_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- status_code_main_t data = status_code_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
#endif
#ifndef _di_status_code_print_signal_received_
- void status_code_print_signal_received(status_code_main_t * const main, const f_status_t signal) {
+ void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
#endif // _di_status_code_print_signal_received_
#ifndef _di_status_code_signal_received_
- f_status_t status_code_signal_received(status_code_main_t * const main) {
+ f_status_t status_code_signal_received(fll_program_data_t * const main) {
if (main->signal.id == -1) {
return F_false;
* The signal received.
*/
#ifndef _di_status_code_print_signal_received_
- extern void status_code_print_signal_received(status_code_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_status_code_print_signal_received_
/**
* @see f_signal_read()
*/
#ifndef _di_status_code_signal_received_
- extern f_status_t status_code_signal_received(status_code_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_status_code_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_status_code_process_check_
- f_status_t status_code_process_check(status_code_main_t * const main, const f_string_t value) {
+ f_status_t status_code_process_check(fll_program_data_t * const main, const f_string_t value) {
f_number_unsigned_t number = 0;
f_status_t status = status_code_convert_number(main, value, &number);
#endif // _di_status_code_process_check_
#ifndef _di_status_code_process_number_
- f_status_t status_code_process_number(status_code_main_t * const main, const f_string_t value) {
+ f_status_t status_code_process_number(fll_program_data_t * const main, const f_string_t value) {
f_status_t status = F_none;
#endif // _di_status_code_process_number_
#ifndef _di_status_code_process_normal_
- f_status_t status_code_process_normal(status_code_main_t * const main, const f_string_t value) {
+ f_status_t status_code_process_normal(fll_program_data_t * const main, const f_string_t value) {
f_number_unsigned_t number = 0;
f_status_t status = status_code_convert_number(main, value, &number);
#endif // _di_status_code_process_normal_
#ifndef _di_status_code_convert_number_
- f_status_t status_code_convert_number(status_code_main_t * const main, const f_string_t value, f_number_unsigned_t *number) {
+ f_status_t status_code_convert_number(fll_program_data_t * const main, const f_string_t value, f_number_unsigned_t *number) {
const f_string_range_t range = macro_f_string_range_t_initialize(strlen(value));
* @see fss_status_code_convert_number()
*/
#ifndef _di_status_code_process_check_
- extern f_status_t status_code_process_check(status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t status_code_process_check(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_status_code_process_check_
/**
* @see fll_fss_status_string_from()
*/
#ifndef _di_status_code_process_number_
- extern f_status_t status_code_process_number(status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t status_code_process_number(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_status_code_process_number_
/**
* @see fss_status_code_convert_number()
*/
#ifndef _di_status_code_process_normal_
- extern f_status_t status_code_process_normal(status_code_main_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
+ extern f_status_t status_code_process_normal(fll_program_data_t * const main, const f_string_t value) F_attribute_visibility_internal_d;
#endif // _di_status_code_process_normal_
/**
* @see fl_console_parameter_to_number_unsigned()
*/
#ifndef _di_status_code_convert_number_
- extern f_status_t status_code_convert_number(status_code_main_t * const main, const f_string_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
+ extern f_status_t status_code_convert_number(fll_program_data_t * const main, const f_string_t value, f_number_unsigned_t *number) F_attribute_visibility_internal_d;
#endif // _di_status_code_convert_number_
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_status_code_program_version_
- const f_string_static_t status_code_progam_version_s = macro_f_string_static_t_initialize(STATUS_CODE_progam_version_s, 0, STATUS_CODE_progam_version_s_length);
-#endif // _di_status_code_program_version_
-
-#ifndef _di_status_code_program_name_
- const f_string_static_t status_code_program_name_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_s, 0, STATUS_CODE_program_name_s_length);
- const f_string_static_t status_code_program_name_long_s = macro_f_string_static_t_initialize(STATUS_CODE_program_name_long_s, 0, STATUS_CODE_program_name_long_s_length);
-#endif // _di_status_code_program_name_
-
#ifndef _di_status_code_print_help_
f_status_t status_code_print_help(const f_file_t file, const f_color_context_t context) {
fll_program_print_help_option(file, context, status_code_short_is_error_s, status_code_long_is_error_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise.");
fll_program_print_help_option(file, context, status_code_short_number_s, status_code_long_number_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number.");
- fll_program_print_help_usage(file, context, status_code_progam_name_s, "status code(s)");
+ fll_program_print_help_usage(file, context, status_code_progam_name_s, status_code_program_help_parameters_s);
funlockfile(file.stream);
#endif // _di_status_code_print_help_
#ifndef _di_status_code_main_
- f_status_t status_code_main(status_code_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t status_code_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { status_code_parameter_no_color_e, status_code_parameter_light_e, status_code_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
return F_status_set_error(status);
}
- if (main->remaining.used == 0 && !main->process_pipe) {
+ if (main->parameters.remaining.used == 0 && !main->process_pipe) {
fll_print_format("%[You failed to specify a status code.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
status_code_main_delete(main);
// @todo call status_code_process_check() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % status_code_signal_check_d)) {
if (status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = status_code_process_check(main, arguments->argv[main->remaining.array[i]]);
+ status2 = status_code_process_check(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
// @todo call status_code_process_number() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % status_code_signal_check_d)) {
if (status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = status_code_process_number(main, arguments->argv[main->remaining.array[i]]);
+ status2 = status_code_process_number(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
// @todo call status_code_process_normal() here for all main from pipe that is space separated.
}
- if (main->remaining.used > 0) {
+ if (main->parameters.remaining.used > 0) {
uint16_t signal_check = 0;
flockfile(main->output.to.stream);
- for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % status_code_signal_check_d)) {
if (status_code_signal_received(main)) {
signal_check = 0;
}
- status2 = status_code_process_normal(main, arguments->argv[main->remaining.array[i]]);
+ status2 = status_code_process_normal(main, arguments->argv[main->parameters.remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
status = status2;
* @see status_code_main_delete()
*/
#ifndef _di_status_code_main_
- extern f_status_t status_code_main(status_code_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t status_code_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_status_code_main_
#ifdef __cplusplus
const f_string_static_t utf8_program_name_long_s = macro_f_string_static_t_initialize(UTF8_program_name_long_s, 0, UTF8_program_name_long_s_length);
#endif // _di_utf8_program_name_
-#ifndef _di_utf8_main_delete_
- f_status_t utf8_main_delete(utf8_main_t *main) {
+#ifndef _di_utf8_program_help_parameters_
+ const f_string_static_t utf8_program_help_parameters_s = macro_f_string_static_t_initialize(UTF8_program_help_parameters_s, 0, UTF8_program_help_parameters_s_length);
+#endif // _di_utf8_program_help_parameters_
+
+#ifndef _di_utf8_defines_
+ const f_string_static_t utf8_string_combining_is_s = macro_f_string_static_t_initialize(UTF8_string_combining_is_s, 0, UTF8_string_combining_is_s_length);
+ const f_string_static_t utf8_string_combining_not_s = macro_f_string_static_t_initialize(UTF8_string_combining_not_s, 0, UTF8_string_combining_not_s_length);
+ const f_string_static_t utf8_string_unknown_s = macro_f_string_static_t_initialize(UTF8_string_unknown_s, 0, UTF8_string_unknown_s_length);
+
+ const f_string_static_t utf8_string_from_s = macro_f_string_static_t_initialize(UTF8_string_from_s, 0, UTF8_string_from_s_length);
+ const f_string_static_t utf8_string_to_s = macro_f_string_static_t_initialize(UTF8_string_to_s, 0, UTF8_string_to_s_length);
+
+ const f_string_static_t utf8_string_prepend_padding_s = macro_f_string_static_t_initialize(UTF8_string_prepend_padding_s, 0, UTF8_string_prepend_padding_s_length);
+
+ const f_string_static_t utf8_string_valid_not_s = macro_f_string_static_t_initialize(UTF8_string_valid_not_s, 0, UTF8_string_valid_not_s_length);
+
+ const f_string_static_t utf8_string_verified_valid_s = macro_f_string_static_t_initialize(UTF8_string_verified_valid_s, 0, UTF8_string_verified_valid_s_length);
+ const f_string_static_t utf8_string_verified_valid_not_s = macro_f_string_static_t_initialize(UTF8_string_verified_valid_not_s, 0, UTF8_string_verified_valid_not_s_length);
- f_console_parameters_delete(&main->parameters);
+ const f_string_static_t utf8_string_width_0_s = macro_f_string_static_t_initialize(UTF8_string_width_0_s, 0, UTF8_string_width_0_s_length);
+ const f_string_static_t utf8_string_width_1_s = macro_f_string_static_t_initialize(UTF8_string_width_1_s, 0, UTF8_string_width_1_s_length);
+ const f_string_static_t utf8_string_width_2_s = macro_f_string_static_t_initialize(UTF8_string_width_2_s, 0, UTF8_string_width_2_s_length);
+#endif // _di_utf8_defines_
- f_type_array_lengths_resize(0, &main->remaining);
+#ifndef _di_utf8_parameters_
+ const f_string_static_t utf8_short_from_binary_s = macro_f_string_static_t_initialize(UTF8_short_from_binary_s, 0, UTF8_short_from_binary_s_length);
+ const f_string_static_t utf8_short_from_codepoint_s = macro_f_string_static_t_initialize(UTF8_short_from_codepoint_s, 0, UTF8_short_from_codepoint_s_length);
+ const f_string_static_t utf8_short_from_file_s = macro_f_string_static_t_initialize(UTF8_short_from_file_s, 0, UTF8_short_from_file_s_length);
- macro_f_color_context_t_delete_simple(main->context);
+ const f_string_static_t utf8_short_headers_s = macro_f_string_static_t_initialize(UTF8_short_headers_s, 0, UTF8_short_headers_s_length);
+ const f_string_static_t utf8_short_separate_s = macro_f_string_static_t_initialize(UTF8_short_separate_s, 0, UTF8_short_separate_s_length);
+ const f_string_static_t utf8_short_strip_invalid_s = macro_f_string_static_t_initialize(UTF8_short_strip_invalid_s, 0, UTF8_short_strip_invalid_s_length);
+ const f_string_static_t utf8_short_verify_s = macro_f_string_static_t_initialize(UTF8_short_verify_s, 0, UTF8_short_verify_s_length);
+
+ const f_string_static_t utf8_short_to_binary_s = macro_f_string_static_t_initialize(UTF8_short_to_binary_s, 0, UTF8_short_to_binary_s_length);
+ const f_string_static_t utf8_short_to_codepoint_s = macro_f_string_static_t_initialize(UTF8_short_to_codepoint_s, 0, UTF8_short_to_codepoint_s_length);
+ const f_string_static_t utf8_short_to_combining_s = macro_f_string_static_t_initialize(UTF8_short_to_combining_s, 0, UTF8_short_to_combining_s_length);
+ const f_string_static_t utf8_short_to_file_s = macro_f_string_static_t_initialize(UTF8_short_to_file_s, 0, UTF8_short_to_file_s_length);
+ const f_string_static_t utf8_short_to_width_s = macro_f_string_static_t_initialize(UTF8_short_to_width_s, 0, UTF8_short_to_width_s_length);
+
+ const f_string_static_t utf8_long_from_binary_s = macro_f_string_static_t_initialize(UTF8_long_from_binary_s, 0, UTF8_long_from_binary_s_length);
+ const f_string_static_t utf8_long_from_codepoint_s = macro_f_string_static_t_initialize(UTF8_long_from_codepoint_s, 0, UTF8_long_from_codepoint_s_length);
+ const f_string_static_t utf8_long_from_file_s = macro_f_string_static_t_initialize(UTF8_long_from_file_s, 0, UTF8_long_from_file_s_length);
+
+ const f_string_static_t utf8_long_headers_s = macro_f_string_static_t_initialize(UTF8_long_headers_s, 0, UTF8_long_headers_s_length);
+ const f_string_static_t utf8_long_separate_s = macro_f_string_static_t_initialize(UTF8_long_separate_s, 0, UTF8_long_separate_s_length);
+ const f_string_static_t utf8_long_strip_invalid_s = macro_f_string_static_t_initialize(UTF8_long_strip_invalid_s, 0, UTF8_long_strip_invalid_s_length);
+ const f_string_static_t utf8_long_verify_s = macro_f_string_static_t_initialize(UTF8_long_verify_s, 0, UTF8_long_verify_s_length);
+
+ const f_string_static_t utf8_long_to_binary_s = macro_f_string_static_t_initialize(UTF8_long_to_binary_s, 0, UTF8_long_to_binary_s_length);
+ const f_string_static_t utf8_long_to_codepoint_s = macro_f_string_static_t_initialize(UTF8_long_to_codepoint_s, 0, UTF8_long_to_codepoint_s_length);
+ const f_string_static_t utf8_long_to_combining_s = macro_f_string_static_t_initialize(UTF8_long_to_combining_s, 0, UTF8_long_to_combining_s_length);
+ const f_string_static_t utf8_long_to_file_s = macro_f_string_static_t_initialize(UTF8_long_to_file_s, 0, UTF8_long_to_file_s_length);
+ const f_string_static_t utf8_long_to_width_s = macro_f_string_static_t_initialize(UTF8_long_to_width_s, 0, UTF8_long_to_width_s_length);
+#endif // _di_utf8_parameters_
+
+#ifndef _di_utf8_main_delete_
+ f_status_t utf8_main_delete(fll_program_data_t *main) {
- return F_none;
+ return fll_program_data_delete(main);
}
#endif // _di_utf8_main_delete_
extern "C" {
#endif
+/**
+ * The program version.
+ */
#ifndef _di_utf8_program_version_
#define UTF8_program_version_major_s F_string_ascii_0_s
#define UTF8_program_version_minor_s F_string_ascii_5_s
#define UTF8_program_version_s_length UTF8_program_version_major_s_length + F_string_ascii_period_s_length + UTF8_program_version_minor_s_length + F_string_ascii_period_s_length + UTF8_program_version_micro_s_length + UTF8_program_version_nano_prefix_s_length + UTF8_program_version_nano_s_length
- extern const f_string_static_t utf8_program_version_s;
+ extern const f_string_static_t utf8_program_version_s;
#endif // _di_utf8_program_version_
+/**
+ * The program name.
+ */
#ifndef _di_utf8_program_name_
#define UTF8_program_name_s "utf8"
#define UTF8_program_name_long_s "UTF-8"
#endif // _di_utf8_program_name_
/**
+ * The program help related data.
+ */
+#ifndef _di_utf8_program_help_parameters_
+ #define UTF8_program_help_parameters_s "character(s)"
+ #define UTF8_program_help_parameters_s_length 12
+
+ extern const f_string_static_t utf8_program_help_parameters_s;
+#endif // _di_utf8_program_help_parameters_
+
+/**
* Set to at least 4 to provide a UTF-8 friendly allocation step.
*/
#ifndef _di_utf8_default_allocation_step_
#define utf8_default_allocation_step_d 16
#endif // _di_utf8_default_allocation_step_
+/**
+ * The program defines.
+ */
#ifndef _di_utf8_defines_
#define utf8_signal_check_d 10000
- #define utf8_string_from_s "from"
- #define utf8_string_to_s "to"
+ #define UTF8_string_combining_is_s "C"
+ #define UTF8_string_combining_not_s "N"
+ #define UTF8_string_unknown_s "?"
+
+ #define UTF8_string_from_s "from"
+ #define UTF8_string_to_s "to"
+
+ #define UTF8_string_prepend_padding_s " "
- #define utf8_string_verified_valid_s "Verified Valid"
- #define utf8_string_verified_valid_not_s "Verified Invalid"
+ #define UTF8_string_valid_not_s "�"
- #define utf8_string_combining_is_s "C"
- #define utf8_string_combining_not_s "N"
- #define utf8_string_unknown_s "?"
+ #define UTF8_string_verified_valid_s "Verified Valid"
+ #define UTF8_string_verified_valid_not_s "Verified Invalid"
- #define utf8_string_width_0_s "0"
- #define utf8_string_width_1_s "1"
- #define utf8_string_width_2_s "2"
+ #define UTF8_string_width_0_s "0"
+ #define UTF8_string_width_1_s "1"
+ #define UTF8_string_width_2_s "2"
- #define utf8_string_from_s_length 4
- #define utf8_string_to_s_length 2
+ #define UTF8_string_combining_is_s_length 1
+ #define UTF8_string_combining_not_s_length 1
+ #define UTF8_string_unknown_s_length 1
- #define utf8_string_verified_valid_s_length 14
- #define utf8_string_verified_valid_not_s_length 16
+ #define UTF8_string_from_s_length 4
+ #define UTF8_string_to_s_length 2
- #define utf8_string_combining_is_s_length 1
- #define utf8_string_combining_not_s_length 1
- #define utf8_string_unknown_s_length 1
+ #define UTF8_string_prepend_padding_s_length 2
- #define utf8_string_width_0_s_length 1
- #define utf8_string_width_1_s_length 1
- #define utf8_string_width_2_s_length 1
+ #define UTF8_string_valid_not_s_length 3
- #define utf8_character_valid_not_s "�"
+ #define UTF8_string_verified_valid_s_length 14
+ #define UTF8_string_verified_valid_not_s_length 16
- #define utf8_short_from_binary_s "b"
- #define utf8_short_from_codepoint_s "c"
- #define utf8_short_from_file_s "f"
+ #define UTF8_string_width_0_s_length 1
+ #define UTF8_string_width_1_s_length 1
+ #define UTF8_string_width_2_s_length 1
- #define utf8_short_headers_s "H"
- #define utf8_short_separate_s "S"
- #define utf8_short_strip_invalid_s "s"
- #define utf8_short_verify_s "v"
+ extern const f_string_static_t utf8_string_combining_is_s;
+ extern const f_string_static_t utf8_string_combining_not_s;
+ extern const f_string_static_t utf8_string_unknown_s;
- #define utf8_short_to_binary_s "B"
- #define utf8_short_to_codepoint_s "C"
- #define utf8_short_to_combining_s "O"
- #define utf8_short_to_file_s "F"
- #define utf8_short_to_width_s "W"
+ extern const f_string_static_t utf8_string_from_s;
+ extern const f_string_static_t utf8_string_to_s;
- #define utf8_long_from_binary_s "from_binary"
- #define utf8_long_from_codepoint_s "from_codepoint"
- #define utf8_long_from_file_s "from_file"
+ extern const f_string_static_t utf8_string_prepend_padding_s;
- #define utf8_long_headers_s "headers"
- #define utf8_long_separate_s "separate"
- #define utf8_long_strip_invalid_s "strip_invalid"
- #define utf8_long_verify_s "verify"
+ extern const f_string_static_t utf8_string_verified_valid_s;
+ extern const f_string_static_t utf8_string_verified_valid_not_s;
- #define utf8_long_to_binary_s "to_binary"
- #define utf8_long_to_codepoint_s "to_codepoint"
- #define utf8_long_to_combining_s "to_combining"
- #define utf8_long_to_file_s "to_file"
- #define utf8_long_to_width_s "to_width"
+ extern const f_string_static_t utf8_string_width_0_s;
+ extern const f_string_static_t utf8_string_width_1_s;
+ extern const f_string_static_t utf8_string_width_2_s;
+
+ extern const f_string_static_t utf8_string_valid_not_s;
+#endif // _di_utf8_defines_
+
+/**
+ * The main program parameters.
+ */
+#ifndef _di_utf8_parameters_
+ #define UTF8_short_from_binary_s "b"
+ #define UTF8_short_from_codepoint_s "c"
+ #define UTF8_short_from_file_s "f"
+
+ #define UTF8_short_headers_s "H"
+ #define UTF8_short_separate_s "S"
+ #define UTF8_short_strip_invalid_s "s"
+ #define UTF8_short_verify_s "v"
+
+ #define UTF8_short_to_binary_s "B"
+ #define UTF8_short_to_codepoint_s "C"
+ #define UTF8_short_to_combining_s "O"
+ #define UTF8_short_to_file_s "F"
+ #define UTF8_short_to_width_s "W"
+
+ #define UTF8_long_from_binary_s "from_binary"
+ #define UTF8_long_from_codepoint_s "from_codepoint"
+ #define UTF8_long_from_file_s "from_file"
+
+ #define UTF8_long_headers_s "headers"
+ #define UTF8_long_separate_s "separate"
+ #define UTF8_long_strip_invalid_s "strip_invalid"
+ #define UTF8_long_verify_s "verify"
+
+ #define UTF8_long_to_binary_s "to_binary"
+ #define UTF8_long_to_codepoint_s "to_codepoint"
+ #define UTF8_long_to_combining_s "to_combining"
+ #define UTF8_long_to_file_s "to_file"
+ #define UTF8_long_to_width_s "to_width"
+
+ #define UTF8_short_from_binary_s_length 1
+ #define UTF8_short_from_codepoint_s_length 1
+ #define UTF8_short_from_file_s_length 1
+
+ #define UTF8_short_headers_s_length 1
+ #define UTF8_short_separate_s_length 1
+ #define UTF8_short_strip_invalid_s_length 1
+ #define UTF8_short_verify_s_length 1
+
+ #define UTF8_short_to_binary_s_length 1
+ #define UTF8_short_to_codepoint_s_length 1
+ #define UTF8_short_to_combining_s_length 1
+ #define UTF8_short_to_file_s_length 1
+ #define UTF8_short_to_width_s_length 1
+
+ #define UTF8_long_from_binary_s_length 11
+ #define UTF8_long_from_codepoint_s_length 14
+ #define UTF8_long_from_file_s_length 9
+
+ #define UTF8_long_headers_s_length 7
+ #define UTF8_long_separate_s_length 8
+ #define UTF8_long_strip_invalid_s_length 13
+ #define UTF8_long_verify_s_length 6
+
+ #define UTF8_long_to_binary_s_length 9
+ #define UTF8_long_to_codepoint_s_length 12
+ #define UTF8_long_to_combining_s_length 12
+ #define UTF8_long_to_file_s_length 7
+ #define UTF8_long_to_width_s_length 8
+
+ extern const f_string_static_t utf8_short_from_binary_s;
+ extern const f_string_static_t utf8_short_from_codepoint_s;
+ extern const f_string_static_t utf8_short_from_file_s;
+
+ extern const f_string_static_t utf8_short_headers_s;
+ extern const f_string_static_t utf8_short_separate_s;
+ extern const f_string_static_t utf8_short_strip_invalid_s;
+ extern const f_string_static_t utf8_short_verify_s;
+
+ extern const f_string_static_t utf8_short_to_binary_s;
+ extern const f_string_static_t utf8_short_to_codepoint_s;
+ extern const f_string_static_t utf8_short_to_combining_s;
+ extern const f_string_static_t utf8_short_to_file_s;
+ extern const f_string_static_t utf8_short_to_width_s;
+
+ extern const f_string_static_t utf8_long_from_binary_s;
+ extern const f_string_static_t utf8_long_from_codepoint_s;
+ extern const f_string_static_t utf8_long_from_file_s;
+
+ extern const f_string_static_t utf8_long_headers_s;
+ extern const f_string_static_t utf8_long_separate_s;
+ extern const f_string_static_t utf8_long_strip_invalid_s;
+ extern const f_string_static_t utf8_long_verify_s;
+
+ extern const f_string_static_t utf8_long_to_binary_s;
+ extern const f_string_static_t utf8_long_to_codepoint_s;
+ extern const f_string_static_t utf8_long_to_combining_s;
+ extern const f_string_static_t utf8_long_to_file_s;
+ extern const f_string_static_t utf8_long_to_width_s;
enum {
utf8_parameter_help_e,
macro_f_console_parameter_t_initialize(f_console_standard_short_verbose_s.string, f_console_standard_long_verbose_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_debug_s.string, f_console_standard_long_debug_s.string, 0, 0, f_console_type_inverse_e), \
macro_f_console_parameter_t_initialize(f_console_standard_short_version_s.string, f_console_standard_long_version_s.string, 0, 0, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(utf8_short_from_binary_s, utf8_long_from_binary_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_from_file_s, utf8_long_from_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_headers_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_separate_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_binary_s, utf8_long_to_binary_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_combining_s, utf8_long_to_combining_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_file_s, utf8_long_to_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_width_s, utf8_long_to_width_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_verify_s, utf8_long_verify_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_from_binary_s.string, utf8_long_from_binary_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s.string, utf8_long_from_codepoint_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_from_file_s.string, utf8_long_from_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_headers_s.string, utf8_long_headers_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_separate_s.string, utf8_long_headers_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s.string, utf8_long_strip_invalid_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_binary_s.string, utf8_long_to_binary_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s.string, utf8_long_to_codepoint_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_combining_s.string, utf8_long_to_combining_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_file_s.string, utf8_long_to_file_s.string, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_width_s.string, utf8_long_to_width_s.string, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_verify_s.string, utf8_long_verify_s.string, 0, 0, f_console_type_normal_e), \
}
#define utf8_total_parameters_d 21
-#endif // _di_utf8_defines_
+#endif // _di_utf8_parameters_
/**
* Modes used to designate how to the input and output are to be processed.
#endif // _di_utf8_modes_
/**
- * The main program data.
- *
- * parameters: The state of pre-defined parameters passed to the program.
- * remaining: The remaining, non-pre-defined parameters, passed to the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * output: The output file for general printing.
- * error: The output file for error printing.
- * warning: The output file for warning printing.
- * signal: The process signal management structure.
- * context: The color context.
- */
-#ifndef _di_utf8_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- f_array_lengths_t remaining;
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- f_color_context_t context;
- } utf8_main_t;
-
- #define utf8_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- f_array_lengths_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_utf8_main_t_
-
-/**
* Deallocate main.
*
* Be sure to call this after executing utf8_main().
* @see utf8_main()
*/
#ifndef _di_utf8_main_delete_
- extern f_status_t utf8_main_delete(utf8_main_t *main);
+ extern f_status_t utf8_main_delete(fll_program_data_t *main);
#endif // _di_utf8_main_delete_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv) {
const f_console_arguments_t arguments = { argc, argv };
- utf8_main_t data = utf8_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
* The program data.
*
* main: The main program data.
- * argv: The argument structure in utf8_main_t.parameters for simplifying syntax.
+ * argv: The argument structure in fll_program_data_t.parameters for simplifying syntax.
* file: The output file for writing the processed data to (may potentially default to "output").
* mode: The input/output mode (see utf8_modes).
* valid: Designate the output context set for valid characters.
* valid_not: Designate the output context set for invalid characters.
* append: A string to append. A value of NULL results in not appending.
* prepend: A string to prepend. A value of NULL results in not prepending.
- * file_name: The name of the file being output to for processed data (is empty if defaulting to "output").
* buffer: A buffer to use for printing output (generally for storing a block of input from an input file).
* text: A buffer for storing a series of characters for processing (generally for codepoint processing).
*/
#ifndef _di_utf8_data_t_
typedef struct {
- utf8_main_t *main;
+ fll_program_data_t *main;
f_string_static_t *argv;
f_file_t file;
f_color_set_t valid;
f_color_set_t valid_not;
- f_string_t append;
- f_string_t prepend;
+ f_string_static_t append;
+ f_string_static_t prepend;
- f_string_static_t file_name;
f_string_dynamic_t buffer;
f_string_dynamic_t text;
} utf8_data_t;
utf8_mode_from_binary_d | utf8_mode_to_codepoint_d, \
f_color_set_t_initialize, \
f_color_set_t_initialize, \
- f_string_t_initialize, \
- f_string_t_initialize, \
+ f_string_static_t_initialize, \
f_string_static_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
#ifndef _di_utf8_print_binary_
void utf8_print_binary(utf8_data_t * const data, const f_string_static_t character) {
- fl_print_format("%s%r%s", data->file.stream, data->prepend, character, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, character, data->append);
}
#endif // _di_utf8_print_binary_
utf8_print_combining_or_width(data, character);
}
else if (data->mode & utf8_mode_to_binary_d) {
- fl_print_format("%s%[%r%]%s", data->file.stream, data->prepend, data->valid_not, character, data->valid_not, data->append);
+ fl_print_format("%r%[%r%]%r", data->file.stream, data->prepend, data->valid_not, character, data->valid_not, data->append);
}
else if (data->mode & utf8_mode_from_codepoint_d) {
- fl_print_format("%s%[%Q%]%s", data->file.stream, data->prepend, data->valid_not, character, data->valid_not, data->append);
+ fl_print_format("%r%[%Q%]%r", data->file.stream, data->prepend, data->valid_not, character, data->valid_not, data->append);
}
else {
- fl_print_format("%s%[0x", data->file.stream, data->prepend, data->valid_not);
+ fl_print_format("%r%[0x", data->file.stream, data->prepend, data->valid_not);
for (uint8_t i = 0; i < character.used; ++i) {
fl_print_format("%02_uii", data->file.stream, (uint8_t) character.string[i]);
} // for
- fl_print_format("%]%s", data->file.stream, data->valid_not, data->append);
+ fl_print_format("%]%r", data->file.stream, data->valid_not, data->append);
}
}
#endif // _di_utf8_print_character_invalid_
void utf8_print_codepoint(utf8_data_t * const data, const uint32_t codepoint) {
if (codepoint < 0xffff) {
- fl_print_format("%sU+%04_U%s", data->file.stream, data->prepend, codepoint, data->append);
+ fl_print_format("%rU+%04_U%r", data->file.stream, data->prepend, codepoint, data->append);
}
else if (codepoint < 0x100000) {
- fl_print_format("%sU+%05_U%s", data->file.stream, data->prepend, codepoint, data->append);
+ fl_print_format("%rU+%05_U%r", data->file.stream, data->prepend, codepoint, data->append);
}
else {
- fl_print_format("%sU+%06_U%s", data->file.stream, data->prepend, codepoint, data->append);
+ fl_print_format("%rU+%06_U%r", data->file.stream, data->prepend, codepoint, data->append);
}
}
#endif // _di_utf8_print_codepoint_
status = f_utf_is_combining(character.string, character.used);
if (status == F_true) {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_combining_is_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_combining_is_s, data->append);
}
else if (status == F_false) {
status = f_utf_is_private(character.string, character.used);
if (status == F_true) {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_unknown_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_unknown_s, data->append);
}
else if (data->mode & utf8_mode_to_width_d) {
utf8_print_width(data, character);
}
else {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_combining_not_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_combining_not_s, data->append);
}
}
else if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) {
- fl_print_format("%s%[%s%]%s", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append);
+ fl_print_format("%r%[%r%]%r", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append);
}
}
else if (data->mode & utf8_mode_to_width_d) {
flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to find the %s file '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, from ? utf8_string_from_s : utf8_string_to_s, data->main->context.set.error);
+ fl_print_format("%r%[%QFailed to find the %r file '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, from ? utf8_string_from_s : utf8_string_to_s, data->main->context.set.error);
fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->context.set.notable, name, data->main->context.set.notable);
fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error, f_string_eol_s);
#endif // _di_utf8_print_error_parameter_file_to_too_many_
#ifndef _di_utf8_print_section_header_file_
- void utf8_print_section_header_file(utf8_data_t * const data, const f_string_t name) {
+ void utf8_print_section_header_file(utf8_data_t * const data, const f_string_static_t name) {
if (data->main->parameters.array[utf8_parameter_headers_e].result == f_console_result_none_e) return;
if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) return;
fl_print_format("%r%[File%] ", data->main->output.to.stream, f_string_eol_s, data->main->output.set->title, data->main->output.set->title);
if (data->file.stream == data->main->output.to.stream) {
- fl_print_format("%[%S%]:%r", data->main->output.to.stream, data->main->output.set->notable, name, data->main->output.set->notable, f_string_eol_s);
+ fl_print_format("%[%Q%]:%r", data->main->output.to.stream, data->main->output.set->notable, name, data->main->output.set->notable, f_string_eol_s);
}
else {
- fl_print_format("%[%S%]: %S.%r", data->main->output.to.stream, data->main->output.set->notable, name, data->main->output.set->notable, data->file_name, f_string_eol_s);
+ fl_print_format("%[%Q%]: %Q.%r", data->main->output.to.stream, data->main->output.set->notable, name, data->main->output.set->notable, data->argv[data->main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_string_eol_s);
}
funlockfile(data->main->output.to.stream);
f_status_t status = f_utf_is_wide(character.string, character.used);
if (status == F_true) {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_width_2_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_width_2_s, data->append);
return;
}
status = f_utf_is_graph(character.string, character.used);
if (status == F_true) {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_width_1_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_width_1_s, data->append);
return;
}
if (status == F_false) {
- fl_print_format("%s%s%s", data->file.stream, data->prepend, utf8_string_width_0_s, data->append);
+ fl_print_format("%r%r%r", data->file.stream, data->prepend, utf8_string_width_0_s, data->append);
return;
}
}
if (data->main->parameters.array[utf8_parameter_strip_invalid_e].result == f_console_result_none_e && data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) {
- fl_print_format("%s%[%s%]%s", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append);
+ fl_print_format("%r%[%r%]%r", data->file.stream, data->prepend, data->valid_not, utf8_string_unknown_s, data->valid_not, data->append);
}
}
#endif // _di_utf8_print_width_
* The name of the file.
*/
#ifndef _di_utf8_print_section_header_file_
- extern void utf8_print_section_header_file(utf8_data_t * const data, const f_string_t name) F_attribute_visibility_internal_d;
+ extern void utf8_print_section_header_file(utf8_data_t * const data, const f_string_static_t name) F_attribute_visibility_internal_d;
#endif // _di_utf8_print_section_header_file_
/**
#endif // _di_utf8_data_delete_
#ifndef _di_utf8_process_text_
- f_status_t utf8_process_text(utf8_data_t * const data, const f_string_t text) {
+ f_status_t utf8_process_text(utf8_data_t * const data, f_string_static_t text) {
- if (!text) {
+ if (!text.used) {
return F_true;
}
bool valid = F_true;
uint8_t mode_codepoint = utf8_codepoint_mode_ready_e;
- f_string_static_t current = macro_f_string_static_t_initialize2(text, 0);
-
- utf8_process_text_width(¤t);
+ utf8_process_text_width(&text);
flockfile(data->file.stream);
- for (uint16_t signal_check = 0; current.string[0] && F_status_is_error_not(status); ) {
+ for (uint16_t signal_check = 0; text.string[0] && F_status_is_error_not(status); ) {
if (!((++signal_check) % utf8_signal_check_d)) {
if (utf8_signal_received(data)) {
utf8_print_signal_received(data, status);
status = F_status_set_error(F_signal);
+
break;
}
}
status = F_none;
if (data->mode & utf8_mode_from_binary_d) {
- status = utf8_convert_binary(data, current);
+ status = utf8_convert_binary(data, text);
}
else {
- status = utf8_detect_codepoint(data, current, &mode_codepoint);
+ status = utf8_detect_codepoint(data, text, &mode_codepoint);
if (F_status_is_error(status)) {
fll_error_print(data->main->error, F_status_set_fine(status), "utf8_detect_codepoint", F_true);
}
if (F_status_is_fine(status) && status != F_next) {
- status = utf8_convert_codepoint(data, current, &mode_codepoint);
+ status = utf8_convert_codepoint(data, text, &mode_codepoint);
}
}
valid = F_false;
}
- current.string += current.used;
- utf8_process_text_width(¤t);
+ text.string += text.used;
+ utf8_process_text_width(&text);
} // for
if (F_status_is_error_not(status) && !(data->mode & utf8_mode_from_binary_d)) {
valid = F_false;
}
- current.used = 0;
+ text.used = 0;
- status = utf8_convert_codepoint(data, current, &mode_codepoint);
+ status = utf8_convert_codepoint(data, text, &mode_codepoint);
}
}
* @see utf8_signal_received()
*/
#ifndef _di_utf8_process_text_
- extern f_status_t utf8_process_text(utf8_data_t * const data, const f_string_t text) F_attribute_visibility_internal_d;
+ extern f_status_t utf8_process_text(utf8_data_t * const data, f_string_static_t text) F_attribute_visibility_internal_d;
#endif // _di_utf8_process_text_
/**
extern "C" {
#endif
-#ifndef _di_utf8_program_version_
- const f_string_static_t utf8_program_version_s = macro_f_string_static_t_initialize(UTF8_program_version_s, 0, UTF8_program_version_s_length);
-#endif // _di_utf8_program_version_
-
-#ifndef _di_utf8_program_name_
- const f_string_static_t utf8_program_name_s = macro_f_string_static_t_initialize(UTF8_program_name_s, 0, UTF8_program_name_s_length);
- const f_string_static_t utf8_program_name_long_s = macro_f_string_static_t_initialize(UTF8_program_name_long_s, 0, UTF8_program_name_s_long_length);
-#endif // _di_utf8_program_name_
-
#ifndef _di_utf8_print_help_
f_status_t utf8_print_help(const f_file_t file, const f_color_context_t context) {
flockfile(file.stream);
- fll_program_print_help_header(file, context, utf8_program_name_long_s, utf8_version_s);
+ fll_program_print_help_header(file, context, utf8_program_name_long_s, utf8_program_version_s);
fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message.");
fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds.");
fll_program_print_help_option(file, context, utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Strip invalid Unicode characters (do not print invalid sequences).");
fll_program_print_help_option(file, context, utf8_short_verify_s, utf8_long_verify_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Only perform verification of valid sequences.");
- fll_program_print_help_usage(file, context, utf8_program_name_s, "filename(s)");
+ fll_program_print_help_usage(file, context, utf8_program_name_s, utf8_program_help_parameters_s);
fl_print_format(" The default behavior is to assume the expected input is binary from the command line to be output to the screen as codepoints.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
fl_print_format(" Multiple input sources are allowed but only a single output destination is allowed.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the parameter '%[%r%s%]', no data is printed and 0 is returned if valid or 1 is returned if invalid.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_verify_s, context.set.notable, f_string_eol_s, f_string_eol_s);
+ fl_print_format(" When using the parameter '%[%r%r%]', no data is printed and 0 is returned if valid or 1 is returned if invalid.%r%r", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_verify_s, context.set.notable, f_string_eol_s, f_string_eol_s);
- fl_print_format(" When using the parameter '%[%r%s%]' with the parameter ", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_to_combining_s, context.set.notable);
- fl_print_format("'%[%r%s%]', the ", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_to_width_s, context.set.notable);
- fl_print_format("'%[%s%]' character is printed to represent the combining and the digits are used to represent widths.%r", file.stream, context.set.notable, utf8_string_combining_is_s, context.set.notable, f_string_eol_s);
+ fl_print_format(" When using the parameter '%[%r%r%]' with the parameter ", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_to_combining_s, context.set.notable);
+ fl_print_format("'%[%r%r%]', the ", file.stream, context.set.notable, f_console_symbol_long_enable_s, utf8_long_to_width_s, context.set.notable);
+ fl_print_format("'%[%r%]' character is printed to represent the combining and the digits are used to represent widths.%r", file.stream, context.set.notable, utf8_string_combining_is_s, context.set.notable, f_string_eol_s);
fl_print_format(" The combining characters should be considered 1-width by themselves or 0-width when combined.%r%r", file.stream, f_string_eol_s, f_string_eol_s);
funlockfile(file.stream);
#endif // _di_utf8_print_help_
#ifndef _di_utf8_main_
- f_status_t utf8_main(utf8_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t utf8_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
f_console_parameter_id_t ids[3] = { utf8_parameter_no_color_e, utf8_parameter_light_e, utf8_parameter_dark_e };
const f_console_parameter_ids_t choices = macro_f_console_parameter_ids_t_initialize(ids, 3);
- status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->remaining, &main->context);
+ status = fll_program_parameter_process(*arguments, &main->parameters, choices, F_true, &main->context);
main->output.set = &main->context.set;
main->error.set = &main->context.set;
}
if (main->parameters.array[utf8_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, utf8_version_s);
+ fll_program_print_version(main->output.to, utf8_program_version_s);
utf8_data_delete(&data);
utf8_main_delete(main);
index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
- if (arguments->argv[index][0]) {
+ if (!data.argv[index].used) {
if (!f_file_exists(data.argv[index])) {
utf8_print_error_parameter_file_not_found(&data, F_true, data.argv[index]);
status = F_status_set_error(F_parameter);
}
else {
- data.file_name.string = arguments->argv[main->parameters.array[utf8_parameter_to_file_e].values.array[0]];
- data.file_name.used = strnlen(data.file_name.string, PATH_MAX);
-
- if (data.file_name.used) {
- status = f_file_stream_open(data.file_name.string, "a", &data.file);
+ if (data.argv[main->parameters.array[utf8_parameter_to_file_e].values.array[0]].used) {
+ status = f_file_stream_open(data.argv[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_append_s, &data.file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.file_name.string, f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[main->parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
}
}
else {
}
if (F_status_is_error_not(status)) {
- if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_none_e && !(main->process_pipe || main->remaining.used)) {
+ if (main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_none_e && !(main->process_pipe || main->parameters.remaining.used)) {
utf8_print_error_no_from(&data);
status = F_status_set_error(F_parameter);
if (!(data.mode & utf8_mode_to_binary_d)) {
if (main->parameters.array[utf8_parameter_separate_e].result == f_console_result_found_e || main->parameters.array[utf8_parameter_headers_e].result == f_console_result_found_e) {
- data.prepend = " ";
+ data.prepend = utf8_string_prepend_padding_s;
data.append = f_string_eol_s;
}
else {
}
if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) {
- fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, 0, f_file_operation_process_s, fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, f_string_empty_s, f_file_operation_process_s, fll_error_file_type_pipe_e);
}
}
index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
- utf8_print_section_header_file(&data, arguments->argv[index]);
+ utf8_print_section_header_file(&data, data.argv[index]);
- status = f_file_stream_open(arguments->argv[index], 0, &file);
+ status = f_file_stream_open(data.argv[index], f_string_empty_s, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments->argv[index], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, data.argv[index], f_file_operation_open_s, fll_error_file_type_file_e);
break;
}
}
if (F_status_is_error(status) && F_status_set_fine(status) != F_utf_fragment) {
- fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, arguments->argv[index], f_file_operation_process_s, fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), data.mode & utf8_mode_from_binary_d ? "utf8_process_file_binary" : "utf8_process_file_codepoint", F_true, data.argv[index], f_file_operation_process_s, fll_error_file_type_file_e);
break;
}
} // for
}
- if (F_status_is_error_not(status) && status != F_signal && main->remaining.used) {
- f_array_length_t i = 0;
- f_array_length_t index = 0;
+ if (F_status_is_error_not(status) && status != F_signal && main->parameters.remaining.used) {
+ uint16_t signal_check = 0;
- for (uint16_t signal_check = 0; F_status_is_error_not(status) && i < main->remaining.used; ++i) {
+ for (f_array_length_t i = 0; F_status_is_error_not(status) && i < main->parameters.remaining.used; ++i) {
if (!((++signal_check) % utf8_signal_check_d)) {
if (utf8_signal_received(&data)) {
status = F_status_set_error(F_signal);
+
break;
}
signal_check = 0;
}
- index = main->remaining.array[i];
-
- utf8_print_section_header_parameter(&data, index);
+ utf8_print_section_header_parameter(&data, main->parameters.remaining.array[i]);
- status = utf8_process_text(&data, arguments->argv[index]);
+ status = utf8_process_text(&data, data.argv[main->parameters.remaining.array[i]]);
if (main->parameters.array[utf8_parameter_verify_e].result == f_console_result_found_e) {
if (status == F_false) {
* @see utf8_main_delete()
*/
#ifndef _di_utf8_main_
- extern f_status_t utf8_main(utf8_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t utf8_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_utf8_main_
#ifdef __cplusplus