From f4516274c83085c8e74b7f87ab101effd86341a0 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 9 Feb 2022 22:01:02 -0600 Subject: [PATCH] Progress: Continue mass converting to f_string_static_t. --- level_3/fss_basic_list_read/c/common.h | 6 ++-- level_3/fss_basic_list_write/c/common.c | 1 + level_3/fss_basic_list_write/c/common.h | 12 +++++++ level_3/fss_basic_list_write/c/private-write.c | 2 ++ level_3/fss_basic_read/c/common.c | 1 + level_3/fss_basic_read/c/common.h | 18 +++++++++-- level_3/fss_basic_read/c/fss_basic_read.c | 26 +++++++-------- level_3/fss_basic_read/c/private-read.c | 26 ++++++++------- level_3/fss_basic_read/c/private-read.h | 6 ++-- level_3/fss_basic_write/c/common.c | 1 + level_3/fss_basic_write/c/common.h | 12 +++++++ level_3/fss_basic_write/c/fss_basic_write.c | 10 ++---- level_3/fss_basic_write/c/private-write.c | 13 ++++---- level_3/fss_embedded_list_read/c/common.c | 8 ++++- level_3/fss_embedded_list_read/c/common.h | 12 +++++++ .../c/fss_embedded_list_read.c | 17 +++++----- level_3/fss_embedded_list_read/c/private-read.c | 37 +++++++++++----------- level_3/fss_embedded_list_read/c/private-read.h | 12 ++----- level_3/fss_embedded_list_write/c/common.c | 1 + level_3/fss_embedded_list_write/c/common.h | 12 +++++++ .../c/fss_embedded_list_write.c | 14 ++++---- level_3/fss_embedded_list_write/c/private-write.c | 33 ++++++++++++------- level_3/fss_embedded_list_write/c/private-write.h | 4 +-- level_3/fss_extended_list_read/c/common.c | 1 + level_3/fss_extended_list_read/c/common.h | 16 ++++++++-- .../c/fss_extended_list_read.c | 18 +++++------ level_3/fss_extended_list_read/c/private-print.c | 6 ++-- level_3/fss_extended_list_read/c/private-read.c | 18 ++++++----- level_3/fss_extended_list_read/c/private-read.h | 6 ++-- level_3/fss_extended_list_write/c/common.c | 1 + level_3/fss_extended_list_write/c/common.h | 12 +++++++ .../c/fss_extended_list_write.c | 11 +++---- level_3/fss_extended_list_write/c/private-write.c | 20 ++++++------ level_3/fss_extended_list_write/c/private-write.h | 4 +-- level_3/fss_extended_read/c/common.c | 1 + level_3/fss_extended_read/c/common.h | 12 +++++++ level_3/fss_extended_read/c/fss_extended_read.c | 12 +++---- level_3/fss_extended_read/c/private-read.c | 14 ++++---- level_3/fss_extended_read/c/private-read.h | 6 ++-- level_3/fss_extended_write/c/common.c | 1 + level_3/fss_extended_write/c/common.h | 12 +++++++ level_3/fss_extended_write/c/fss_extended_write.c | 17 ++++------ level_3/fss_extended_write/c/private-write.c | 12 +++---- level_3/fss_identify/c/fss_identify.c | 22 ++++++------- level_3/fss_payload_read/c/fss_payload_read.c | 10 +++--- level_3/fss_payload_read/c/private-read.c | 16 +++++----- level_3/fss_payload_read/c/private-read.h | 6 ++-- level_3/fss_payload_write/c/fss_payload_write.c | 6 ++-- level_3/fss_payload_write/c/private-write.c | 12 +++---- 49 files changed, 336 insertions(+), 220 deletions(-) diff --git a/level_3/fss_basic_list_read/c/common.h b/level_3/fss_basic_list_read/c/common.h index 83e71a1..df3718e 100644 --- a/level_3/fss_basic_list_read/c/common.h +++ b/level_3/fss_basic_list_read/c/common.h @@ -64,9 +64,9 @@ extern "C" { * * fss_basic_list_read_pipe_*: * - name: A name used to represent the pipe when printing file names. - * - content_end: A code used to reprsent the end of Content for use in binary formats. - * - content_ignore: A code used to reprsent the ignoring Content for use in binary formats. - * - content_start: A code used to reprsent the start of Content for use in binary formats. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_basic_list_read_defines_ #define fss_basic_list_read_signal_check_d 10000 diff --git a/level_3/fss_basic_list_write/c/common.c b/level_3/fss_basic_list_write/c/common.c index 2cdfa3e..e424b74 100644 --- a/level_3/fss_basic_list_write/c/common.c +++ b/level_3/fss_basic_list_write/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_basic_list_write_program_name_ #ifndef _di_fss_basic_list_write_defines_ + const f_string_static_t fss_basic_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_LIST_WRITE_pipe_name_s, 0, FSS_BASIC_LIST_WRITE_pipe_name_s_length); 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); diff --git a/level_3/fss_basic_list_write/c/common.h b/level_3/fss_basic_list_write/c/common.h index 732c37d..297dd93 100644 --- a/level_3/fss_basic_list_write/c/common.h +++ b/level_3/fss_basic_list_write/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_basic_list_write_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_basic_list_write_defines_ #define fss_basic_list_write_signal_check_d 10000 + #define FSS_BASIC_LIST_WRITE_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_basic_list_write/c/private-write.c b/level_3/fss_basic_list_write/c/private-write.c index 1b2aee9..5dfedd5 100644 --- a/level_3/fss_basic_list_write/c/private-write.c +++ b/level_3/fss_basic_list_write/c/private-write.c @@ -169,6 +169,7 @@ extern "C" { if (fss_basic_list_write_signal_received(main)) { status = F_status_set_error(F_interrupt); + break; } @@ -258,6 +259,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true); + break; } diff --git a/level_3/fss_basic_read/c/common.c b/level_3/fss_basic_read/c/common.c index 6c0f50a..c099553 100644 --- a/level_3/fss_basic_read/c/common.c +++ b/level_3/fss_basic_read/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_basic_read_program_name_ #ifndef _di_fss_basic_read_defines_ + const f_string_static_t fss_basic_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_READ_pipe_name_s, 0, FSS_BASIC_READ_pipe_name_s_length); 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); diff --git a/level_3/fss_basic_read/c/common.h b/level_3/fss_basic_read/c/common.h index 1ab5079..99724d2 100644 --- a/level_3/fss_basic_read/c/common.h +++ b/level_3/fss_basic_read/c/common.h @@ -24,9 +24,9 @@ extern "C" { #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s - #define FSS_BASIC_READ_program_version_major_s F_string_ascii_0_s_length - #define FSS_BASIC_READ_program_version_minor_s F_string_ascii_5_s_length - #define FSS_BASIC_READ_program_version_micro_s F_string_ascii_8_s_length + #define FSS_BASIC_READ_program_version_major_s_length F_string_ascii_0_s_length + #define FSS_BASIC_READ_program_version_minor_s_length F_string_ascii_5_s_length + #define FSS_BASIC_READ_program_version_micro_s_length F_string_ascii_8_s_length #if !(defined(FSS_BASIC_READ_program_version_nano_prefix_s) && defined(FSS_BASIC_READ_program_version_nano_prefix_s_length)) #define FSS_BASIC_READ_program_version_nano_prefix_s @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_basic_read_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_basic_read_defines_ #define fss_basic_read_signal_check_d 10000 + #define FSS_BASIC_READ_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 73a5009..af533bf 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -222,7 +222,7 @@ extern "C" { data.files.array = files_array; data.files.used = 1; data.files.size = main->parameters.remaining.used + 1; - data.files.array[0].name = "(pipe)"; + data.files.array[0].name = fss_basic_read_pipe_name_s; data.files.array[0].range.start = 1; data.files.array[0].range.stop = 0; @@ -237,7 +237,7 @@ extern "C" { fss_basic_read_parameter_delimit_e, }; - const f_string_t parameter_name[] = { + const f_string_static_t parameter_name[] = { fss_basic_read_long_at_s, fss_basic_read_long_depth_s, fss_basic_read_long_line_s, @@ -266,7 +266,7 @@ extern "C" { fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter_name[i], main->error.notable); - fl_print_format("%[' requires a %r.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s); + fl_print_format("%[' requires a %s.%]%r", main->error.to.stream, main->error.context, parameter_message[i], main->error.context, f_string_eol_s); funlockfile(main->error.to.stream); @@ -286,7 +286,7 @@ extern "C" { fss_basic_read_parameter_total_e, }; - const f_string_t parameter_name[] = { + const f_string_static_t parameter_name[] = { fss_basic_read_long_depth_s, fss_basic_read_long_line_s, fss_basic_read_long_pipe_s, @@ -382,13 +382,13 @@ extern "C" { break; } - else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_none_s.string, argv[index], fss_basic_read_delimit_mode_name_none_s.used) == F_equal_to) { + else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_none_s, argv[index]) == F_equal_to) { data.delimit_mode = fss_basic_read_delimit_mode_none_e; } - else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_all_s.string, argv[index], fss_basic_read_delimit_mode_name_all_s.used) == F_equal_to) { + else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_all_s, argv[index]) == F_equal_to) { data.delimit_mode = fss_basic_read_delimit_mode_all_e; } - else if (fl_string_dynamic_compare_string(fss_basic_read_delimit_mode_name_object_s.string, argv[index], fss_basic_read_delimit_mode_name_object_s.used) == F_equal_to) { + else if (fl_string_dynamic_compare(fss_basic_read_delimit_mode_name_object_s, argv[index]) == F_equal_to) { switch (data.delimit_mode) { case 0: data.delimit_mode = fss_basic_read_delimit_mode_object_e; @@ -425,7 +425,7 @@ extern "C" { data.delimit_mode = fss_basic_read_delimit_mode_content_object_e; } - if (argv[index][length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) { + if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_greater_s.string[0]) { if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) { if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) { data.delimit_mode = fss_basic_read_delimit_mode_content_greater_object_e; @@ -438,7 +438,7 @@ extern "C" { // Shorten the length to better convert the remainder to a number. --length; } - else if (argv[index][length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) { + else if (argv[index].string[length - 1] == fss_basic_read_delimit_mode_name_lesser_s.string[0]) { if (!(data.delimit_mode == fss_basic_read_delimit_mode_none_e || data.delimit_mode == fss_basic_read_delimit_mode_all_e)) { if (data.delimit_mode == fss_basic_read_delimit_mode_content_object_e) { data.delimit_mode = fss_basic_read_delimit_mode_content_lesser_object_e; @@ -455,7 +455,7 @@ extern "C" { f_string_range_t range = macro_f_string_range_t_initialize(length); // Ignore leading plus sign. - if (argv[index][0] == '+') { + if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) { ++range.start; } @@ -541,7 +541,7 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); @@ -568,7 +568,7 @@ extern "C" { file.stream = 0; file.id = -1; - status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file); + status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 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, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); @@ -602,7 +602,7 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); diff --git a/level_3/fss_basic_read/c/private-read.c b/level_3/fss_basic_read/c/private-read.c index a0681d9..a8016a2 100644 --- a/level_3/fss_basic_read/c/private-read.c +++ b/level_3/fss_basic_read/c/private-read.c @@ -61,6 +61,8 @@ extern "C" { f_array_length_t position_at = 0; f_array_length_t position_name = 0; + f_string_static_t * const argv = main->parameters.arguments.array; + for (f_array_length_t i = 0; i < data->depths.used; ++i) { if (fss_basic_read_signal_received(main)) { @@ -80,9 +82,9 @@ extern "C" { else { position_depth = main->parameters.array[fss_basic_read_parameter_depth_e].values.array[i]; - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[position_depth])); + const f_string_range_t range = macro_f_string_range_t_initialize(argv[position_depth].used); - status = fl_conversion_string_to_number_unsigned(argv[position_depth], range, &data->depths.array[i].depth); + status = fl_conversion_string_to_number_unsigned(argv[position_depth].string, range, &data->depths.array[i].depth); if (F_status_is_error(status)) { fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_depth_s, argv[position_depth]); @@ -104,9 +106,9 @@ extern "C" { data->depths.array[i].index_at = main->parameters.array[fss_basic_read_parameter_at_e].values.array[position_at]; - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[data->depths.array[i].index_at])); + const f_string_range_t range = macro_f_string_range_t_initialize(argv[data->depths.array[i].index_at].used); - status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at], range, &data->depths.array[i].value_at); + status = fl_conversion_string_to_number_unsigned(argv[data->depths.array[i].index_at].string, range, &data->depths.array[i].value_at); if (F_status_is_error(status)) { fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_basic_read_long_at_s, argv[data->depths.array[i].index_at]); @@ -130,7 +132,7 @@ extern "C" { data->depths.array[i].index_name = main->parameters.array[fss_basic_read_parameter_name_e].values.array[position_name]; if (main->parameters.array[fss_basic_read_parameter_trim_e].result == f_console_result_found_e) { - status = fl_string_dynamic_rip(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name); + status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name); } else { status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name); @@ -224,7 +226,7 @@ extern "C" { const f_status_t status = fll_fss_basic_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes, &data->delimits, 0); if (F_status_is_error(status)) { - const f_string_t file_name = fss_basic_read_file_identify(input.start, data->files); + const f_string_static_t file_name = fss_basic_read_file_identify(input.start, data->files); fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); @@ -246,16 +248,16 @@ extern "C" { #endif // _di_fss_basic_read_load_ #ifndef _di_fss_basic_read_load_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) { + f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, 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]; - const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(argv[index], F_console_parameter_size_d)); + const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used); - const f_status_t status = fl_conversion_string_to_number_unsigned(argv[index].string, range, number); + const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]); return status; } @@ -563,7 +565,7 @@ extern "C" { if (main->parameters.array[fss_basic_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_line_d; - status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, arguments, &data->line); + status = fss_basic_read_load_number(main, fss_basic_read_parameter_line_e, fss_basic_read_long_line_s, &data->line); if (F_status_is_error(status)) return status; } @@ -582,7 +584,7 @@ extern "C" { if (main->parameters.array[fss_basic_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_basic_read_data_option_select_d; - status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, arguments, &data->select); + status = fss_basic_read_load_number(main, fss_basic_read_parameter_select_e, fss_basic_read_long_select_s, &data->select); if (F_status_is_error(status)) return status; } diff --git a/level_3/fss_basic_read/c/private-read.h b/level_3/fss_basic_read/c/private-read.h index b85bbc9..9e0f387 100644 --- a/level_3/fss_basic_read/c/private-read.h +++ b/level_3/fss_basic_read/c/private-read.h @@ -74,7 +74,7 @@ extern "C" { * On failure to identify, an empty string is returned. */ #ifndef _di_fss_basic_read_file_identify_ - extern f_string_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) F_attribute_visibility_internal_d; + extern f_string_static_t fss_basic_read_file_identify(const f_array_length_t at, const fss_basic_read_files_t files) F_attribute_visibility_internal_d; #endif // _di_fss_basic_read_file_identify_ /** @@ -114,8 +114,6 @@ extern "C" { * An ID representing the parameter. * @param name * The parameter name to print on error. - * @param arguments - * The console arguments passed to the program. * @param number * The location to store the loaded number. * @@ -130,7 +128,7 @@ extern "C" { * @see fss_basic_read_depths_resize() */ #ifndef _di_fss_basic_read_load_number_ - 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; + extern f_status_t fss_basic_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d; #endif // _di_fss_basic_read_load_number_ /** diff --git a/level_3/fss_basic_write/c/common.c b/level_3/fss_basic_write/c/common.c index 14f0638..a26044b 100644 --- a/level_3/fss_basic_write/c/common.c +++ b/level_3/fss_basic_write/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_basic_write_program_name_ #ifndef _di_fss_basic_write_defines_ + const f_string_static_t fss_basic_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_BASIC_WRITE_pipe_name_s, 0, FSS_BASIC_WRITE_pipe_name_s_length); 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); diff --git a/level_3/fss_basic_write/c/common.h b/level_3/fss_basic_write/c/common.h index 46bc033..e958aa4 100644 --- a/level_3/fss_basic_write/c/common.h +++ b/level_3/fss_basic_write/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_basic_write_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_basic_write_defines_ #define fss_basic_write_signal_check_d 10000 + #define FSS_BASIC_WRITE_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index c867b3e..8452c41 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -397,18 +397,18 @@ extern "C" { } } - f_fss_quote_t quote = F_fss_delimit_quote_double_s; + f_fss_quote_t quote = f_fss_quote_type_double_e; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_basic_write_parameter_double_e].result == f_console_result_found_e) { if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { if (main->parameters.array[fss_basic_write_parameter_double_e].location < main->parameters.array[fss_basic_write_parameter_single_e].location) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } } else if (main->parameters.array[fss_basic_write_parameter_single_e].result == f_console_result_found_e) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } @@ -433,8 +433,6 @@ extern "C" { if (F_status_is_error_not(status)) { if (main->parameters.array[fss_basic_write_parameter_partial_e].result == f_console_result_found_e) { if (main->parameters.array[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) { - content.used = 0; - for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) { if (fss_basic_write_signal_received(main)) { @@ -448,8 +446,6 @@ extern "C" { } // for } else { - object.used = 0; - for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_content_e].values.used; ++i) { if (fss_basic_write_signal_received(main)) { diff --git a/level_3/fss_basic_write/c/private-write.c b/level_3/fss_basic_write/c/private-write.c index 8b81abb..bdee78f 100644 --- a/level_3/fss_basic_write/c/private-write.c +++ b/level_3/fss_basic_write/c/private-write.c @@ -216,21 +216,21 @@ extern "C" { for (; range.start <= range.stop; range.start++) { - if (block.string[range.start] == fss_basic_write_pipe_content_start_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_start_s.string[0]) { state = 0x2; ++range.start; break; } - if (block.string[range.start] == fss_basic_write_pipe_content_end_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s.string[0]) { // This is not used by objects. continue; @@ -267,7 +267,7 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_basic_write_pipe_content_start_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_start_s.string[0]) { if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s); } @@ -277,14 +277,14 @@ extern "C" { break; } - if (block.string[range.start] == fss_basic_write_pipe_content_end_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_basic_write_pipe_content_ignore_s.string[0]) { // This is not used by this program. continue; @@ -294,6 +294,7 @@ extern "C" { fss_basic_write_error_parameter_unsupported_eol_print(main); status = F_status_set_error(F_supported_not); + break; } diff --git a/level_3/fss_embedded_list_read/c/common.c b/level_3/fss_embedded_list_read/c/common.c index c0c599f..97edc75 100644 --- a/level_3/fss_embedded_list_read/c/common.c +++ b/level_3/fss_embedded_list_read/c/common.c @@ -13,6 +13,13 @@ extern "C" { 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_defines_ + const f_string_static_t fss_embedded_list_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_name_s, 0, FSS_EMBEDDED_LIST_READ_pipe_name_s_length); + const f_string_static_t fss_embedded_list_read_pipe_content_end_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_end_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_end_s_length); + const f_string_static_t fss_embedded_list_read_pipe_content_ignore_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_ignore_s_length); + const f_string_static_t fss_embedded_list_read_pipe_content_start_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_pipe_content_start_s, 0, FSS_EMBEDDED_LIST_READ_pipe_content_start_s_length); +#endif // _di_fss_embedded_list_read_defines_ + #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); @@ -48,7 +55,6 @@ extern "C" { #ifndef _di_fss_embedded_list_read_delimit_mode_ const f_string_static_t fss_embedded_list_read_delimit_mode_name_none_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_none_s_length); const f_string_static_t fss_embedded_list_read_delimit_mode_name_all_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_all_s_length); - const f_string_static_t fss_embedded_list_read_delimit_mode_name_object_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_object_s_length); const f_string_static_t fss_embedded_list_read_delimit_mode_name_greater_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_greater_s_length); const f_string_static_t fss_embedded_list_read_delimit_mode_name_lesser_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s, 0, FSS_EMBEDDED_LIST_READ_delimit_mode_name_lesser_s_length); #endif // _di_fss_embedded_list_read_delimit_mode_ diff --git a/level_3/fss_embedded_list_read/c/common.h b/level_3/fss_embedded_list_read/c/common.h index e504479..0c25f79 100644 --- a/level_3/fss_embedded_list_read/c/common.h +++ b/level_3/fss_embedded_list_read/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_embedded_list_read_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_embedded_list_read_defines_ #define fss_embedded_list_read_signal_check_d 10000 + #define FSS_EMBEDDED_LIST_READ_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index d37aa47..c697762 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -155,6 +155,7 @@ extern "C" { if (F_status_is_error(status)) { fss_embedded_list_read_main_delete(main); + return F_status_set_error(status); } } @@ -360,13 +361,13 @@ extern "C" { else { main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_e; - if (argv[index][length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) { + if (argv[index].string[length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) { main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_greater_e; // Shorten the length to better convert the remainder to a number. --length; } - else if (argv[index][length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) { + else if (argv[index].string[length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) { main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_lesser_e; // Shorten the length to better convert the remainder to a number. @@ -376,7 +377,7 @@ extern "C" { f_string_range_t range = macro_f_string_range_t_initialize(length); // Ignore leading plus sign. - if (argv[index][0] == f_string_ascii_plus_s[0]) { + if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) { ++range.start; } @@ -395,10 +396,10 @@ extern "C" { f_fss_delimits_t contents_delimits = f_fss_delimits_t_initialize; f_fss_comments_t comments = f_fss_comments_t_initialize; - f_array_length_t original_size = main->quantity.total; + const f_array_length_t original_size = main->quantity.total; if (F_status_is_error_not(status)) { - status = fss_embedded_list_read_main_preprocess_depth(main, arguments, &depths); + status = fss_embedded_list_read_main_preprocess_depth(main, &depths); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_preprocess_depth", F_true); @@ -428,7 +429,7 @@ extern "C" { fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } else { - status = fss_embedded_list_read_main_process_file(main, arguments, f_string_ascii_minus_s, depths, &objects_delimits, &contents_delimits, &comments); + status = fss_embedded_list_read_main_process_file(main, f_string_ascii_minus_s, 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, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); @@ -451,7 +452,7 @@ extern "C" { f_file_t file = f_file_t_initialize; - status = f_file_open(argv[main->parameters.remaining.array[i]], f_string_empty_s, &file); + status = f_file_open(argv[main->parameters.remaining.array[i]], 0, &file); main->quantity.total = original_size; @@ -493,7 +494,7 @@ extern "C" { break; } - status = fss_embedded_list_read_main_process_file(main, arguments, argv[main->parameters.remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments); + status = fss_embedded_list_read_main_process_file(main, 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, argv[main->parameters.remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e); diff --git a/level_3/fss_embedded_list_read/c/private-read.c b/level_3/fss_embedded_list_read/c/private-read.c index 1cd96d4..3a01112 100644 --- a/level_3/fss_embedded_list_read/c/private-read.c +++ b/level_3/fss_embedded_list_read/c/private-read.c @@ -8,7 +8,7 @@ extern "C" { #endif #ifndef _di_fss_embedded_list_read_main_preprocess_depth_ - f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_embedded_list_read_depths_t *depths) { + f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, fss_embedded_list_read_depths_t *depths) { f_status_t status = F_none; @@ -116,13 +116,14 @@ extern "C" { } } - // provide default level-0 depth values. + // Provide default level-0 depth values. depths->array[0].depth = 0; depths->array[0].index_at = 0; depths->array[0].index_name = 0; depths->array[0].value_at = 0; { + f_string_static_t * const argv = main->parameters.arguments.array; f_number_unsigned_t number = 0; bool first_depth = F_true; @@ -133,9 +134,9 @@ extern "C" { } if (values_type[i] == fss_embedded_list_read_parameter_depth_e || values_type[i] == fss_embedded_list_read_parameter_at_e) { - const f_string_range_t range = macro_f_string_range_t_initialize(strlen(argv[values_order[i]])); + const f_string_range_t range = macro_f_string_range_t_initialize(argv[values_order[i]].used); - status = fl_conversion_string_to_number_unsigned(argv[values_order[i]], range, &number); + status = fl_conversion_string_to_number_unsigned(argv[values_order[i]].string, range, &number); if (F_status_is_error(status)) { fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_depth_s, argv[values_order[i]]); @@ -172,7 +173,7 @@ extern "C" { depths->array[depths->used].value_name.used = 0; if (main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) { - status = fl_string_rip(argv[values_order[i]], strnlen(argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name); + status = fl_string_rip(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "fl_string_rip", F_true); @@ -181,7 +182,7 @@ extern "C" { } } else { - status = f_string_append(argv[values_order[i]], strnlen(argv[values_order[i]], F_console_parameter_size_d), &depths->array[depths->used].value_name); + status = f_string_append(argv[values_order[i]].string, argv[values_order[i]].used, &depths->array[depths->used].value_name); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true); @@ -235,7 +236,7 @@ extern "C" { #endif // _di_fss_embedded_list_read_main_preprocess_depth_ #ifndef _di_fss_embedded_list_read_main_process_file_ - f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) { + f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) { f_status_t status = F_none; @@ -301,12 +302,12 @@ extern "C" { if (main->parameters.array[fss_embedded_list_read_parameter_select_e].result == f_console_result_additional_e) { const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_select_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_select_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(argv[index]); + const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used); - status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &select); + status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &select); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_select_s, main->parameters.arguments.array[index]); return status; } @@ -322,12 +323,12 @@ extern "C" { if (main->parameters.array[fss_embedded_list_read_parameter_line_e].result == f_console_result_additional_e) { const f_array_length_t index = main->parameters.array[fss_embedded_list_read_parameter_line_e].values.array[main->parameters.array[fss_embedded_list_read_parameter_line_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); + const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used); - status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &line); + status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, &line); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_embedded_list_read_long_line_s, main->parameters.arguments.array[index]); return status; } @@ -341,15 +342,15 @@ extern "C" { if (main->parameters.array[fss_embedded_list_read_parameter_raw_e].result == f_console_result_found_e) { f_fss_delimits_t except_none = f_fss_delimits_t_initialize; - return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, 0, line, parents, &except_none, &except_none); + return fss_embedded_list_read_main_process_for_depth(main, filename, depths, 0, line, parents, &except_none, &except_none); } - return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, 0, line, parents, objects_delimits, contents_delimits); + return fss_embedded_list_read_main_process_for_depth(main, filename, depths, 0, line, parents, objects_delimits, contents_delimits); } #endif // _di_fss_embedded_list_read_main_process_file_ #ifndef _di_fss_embedded_list_read_main_process_for_depth_ - f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { + f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) { f_fss_items_t *items = &main->nest.depth[depths.array[depths_index].depth]; @@ -491,7 +492,7 @@ extern "C" { } // for } - return fss_embedded_list_read_main_process_for_depth(main, arguments, filename, depths, depths_index + 1, line, parents_next, objects_delimits, contents_delimits); + return fss_embedded_list_read_main_process_for_depth(main, filename, depths, depths_index + 1, line, parents_next, objects_delimits, contents_delimits); } // Process objects. @@ -666,7 +667,7 @@ extern "C" { f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.to.stream); if (main->parameters.array[fss_embedded_list_read_parameter_pipe_e].result == f_console_result_found_e) { - f_print_character(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream); + f_print_dynamic_raw(fss_embedded_list_read_pipe_content_end_s, main->output.to.stream); } } // for diff --git a/level_3/fss_embedded_list_read/c/private-read.h b/level_3/fss_embedded_list_read/c/private-read.h index e7c9e2b..e747ddb 100644 --- a/level_3/fss_embedded_list_read/c/private-read.h +++ b/level_3/fss_embedded_list_read/c/private-read.h @@ -19,8 +19,6 @@ extern "C" { * * @param main * The main program data. - * @param arguments - * The console arguments to pre-process. * @param depths * This stores the pre-processed depth parameters. * @@ -30,7 +28,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fss_embedded_list_read_main_preprocess_depth_ - extern f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, fss_embedded_list_read_depths_t *depths) F_attribute_visibility_internal_d; + extern f_status_t fss_embedded_list_read_main_preprocess_depth(fss_embedded_list_read_main_t * const main, fss_embedded_list_read_depths_t *depths) F_attribute_visibility_internal_d; #endif // _di_fss_embedded_list_read_main_preprocess_depth_ /** @@ -38,8 +36,6 @@ extern "C" { * * @param main * The main program data. - * @param arguments - * The console arguments passed to the program. * @param file_name * The name of the file being processed. * @param depths @@ -61,7 +57,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fss_embedded_list_read_main_process_file_ - extern f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t file_name, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) F_attribute_visibility_internal_d; + extern f_status_t fss_embedded_list_read_main_process_file(fss_embedded_list_read_main_t * const main, const f_string_static_t file_name, const fss_embedded_list_read_depths_t depths, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits, f_fss_comments_t *comments) F_attribute_visibility_internal_d; #endif // _di_fss_embedded_list_read_main_process_file_ /** @@ -71,8 +67,6 @@ extern "C" { * * @param main * The main program data. - * @param arguments - * The console arguments passed to the program. * @param file_name * The name of the file being processed. * @param depths @@ -97,7 +91,7 @@ extern "C" { * @see fss_embedded_list_read_main_process_file() */ #ifndef _di_fss_embedded_list_read_main_process_for_depth_ - extern f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments, const f_string_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d; + extern f_status_t fss_embedded_list_read_main_process_for_depth(fss_embedded_list_read_main_t * const main, const f_string_static_t filename, const fss_embedded_list_read_depths_t depths, const f_array_length_t depths_index, const f_array_length_t line, const fss_embedded_list_read_skip_t parents, f_fss_delimits_t *objects_delimits, f_fss_delimits_t *contents_delimits) F_attribute_visibility_internal_d; #endif // _di_fss_embedded_list_read_main_process_for_depth_ /** diff --git a/level_3/fss_embedded_list_write/c/common.c b/level_3/fss_embedded_list_write/c/common.c index 30df6b0..273ffd0 100644 --- a/level_3/fss_embedded_list_write/c/common.c +++ b/level_3/fss_embedded_list_write/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_embedded_list_write_program_name_ #ifndef _di_fss_embedded_list_write_defines_ + const f_string_static_t fss_embedded_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EMBEDDED_LIST_WRITE_pipe_name_s, 0, FSS_EMBEDDED_LIST_WRITE_pipe_name_s_length); 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); diff --git a/level_3/fss_embedded_list_write/c/common.h b/level_3/fss_embedded_list_write/c/common.h index 3234dbf..cb78b80 100644 --- a/level_3/fss_embedded_list_write/c/common.h +++ b/level_3/fss_embedded_list_write/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_embedded_list_write_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_embedded_list_write_defines_ #define fss_embedded_list_write_signal_check_d 10000 + #define FSS_EMBEDDED_LIST_WRITE_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index d7fdc8a..eb95c17 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -191,7 +191,7 @@ extern "C" { } } else if (main->parameters.array[fss_embedded_list_write_parameter_file_e].result == f_console_result_found_e) { - fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string.string, fss_embedded_list_write_long_file_s); + fss_embedded_list_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s, fss_embedded_list_write_long_file_s); status = F_status_set_error(F_parameter); } } @@ -331,7 +331,7 @@ extern "C" { for (; range.start < argv[index].used; ++range.start) { - status = f_fss_is_space(main->parameter->arguments.array[index], range); + status = f_fss_is_space(argv[index], range); if (F_status_is_error(status)) break; if (status == F_false) { @@ -399,18 +399,18 @@ extern "C" { } } - f_fss_quote_t quote = F_fss_delimit_quote_double_s; + f_fss_quote_t quote = f_fss_quote_type_double_e; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_embedded_list_write_parameter_double_e].result == f_console_result_found_e) { if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { if (main->parameters.array[fss_embedded_list_write_parameter_double_e].location < main->parameters.array[fss_embedded_list_write_parameter_single_e].location) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } } else if (main->parameters.array[fss_embedded_list_write_parameter_single_e].result == f_console_result_found_e) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } @@ -461,7 +461,7 @@ extern "C" { break; } - status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); + status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; status = fss_embedded_list_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]], &ignore, &buffer); @@ -478,7 +478,7 @@ extern "C" { break; } - status = fss_embedded_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); + status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; status = fss_embedded_list_write_process(main, output, quote, &argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_embedded_list_write_parameter_content_e].values.array[i]], &ignore, &buffer); diff --git a/level_3/fss_embedded_list_write/c/private-write.c b/level_3/fss_embedded_list_write/c/private-write.c index 8ffb042..07ec520 100644 --- a/level_3/fss_embedded_list_write/c/private-write.c +++ b/level_3/fss_embedded_list_write/c/private-write.c @@ -108,7 +108,16 @@ extern "C" { range.start = 0; range.stop = content->used - 1; - status = fl_fss_embedded_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, &main->prepend, ignore, state, &range, buffer); + f_string_static_t *prepend = 0; + + if (main->parameters.array[fss_embedded_list_write_parameter_prepend_e].result == f_console_result_additional_e) { + const f_array_length_t index = main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_embedded_list_write_parameter_prepend_e].values.used - 1]; + + prepend = &main->parameters.arguments.array[index]; + } + + + status = fl_fss_embedded_list_content_write(*content, object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, ignore, state, &range, buffer); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "fl_fss_embedded_list_content_write", F_true); @@ -213,22 +222,22 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s) { + if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s.string[0]) { state = 0x2; ++range.start; break; } - if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s) { + if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s) { - // this is not used by objects. + if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s.string[0]) { + // This is not used by objects. continue; } @@ -263,7 +272,7 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s) { + if (block.string[range.start] == fss_embedded_list_write_pipe_content_start_s.string[0]) { if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s); } @@ -273,14 +282,14 @@ extern "C" { break; } - if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s) { + if (block.string[range.start] == fss_embedded_list_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_embedded_list_write_pipe_content_ignore_s.string[0]) { if (ignore) { if (range_ignore.start > range_ignore.stop) { range_ignore.start = content.used; @@ -353,7 +362,7 @@ extern "C" { #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(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 fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) { f_status_t status = F_none; @@ -365,6 +374,8 @@ extern "C" { f_number_unsigned_t number = 0; + f_string_static_t * const argv = main->parameters.arguments.array; + range.start = 0; for (; i < main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) { @@ -405,7 +416,7 @@ extern "C" { range.stop = argv[index].used - 1; // allow and ignore the positive sign. - if (range.stop && argv[index][0] == f_string_ascii_plus_s[0]) { + if (range.stop && argv[index].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } @@ -425,7 +436,7 @@ extern "C" { range.stop = argv[index].used - 1; // Allow and ignore the positive sign. - if (range.stop && argv[index][0] == f_string_ascii_plus_s[0]) { + if (range.stop && argv[index].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } diff --git a/level_3/fss_embedded_list_write/c/private-write.h b/level_3/fss_embedded_list_write/c/private-write.h index bf59fd0..30fba16 100644 --- a/level_3/fss_embedded_list_write/c/private-write.h +++ b/level_3/fss_embedded_list_write/c/private-write.h @@ -105,8 +105,6 @@ extern "C" { * * @param main * The main program data. - * @param arguments - * The parameters passed to the process. * @param contents * The console parameter locations array for the content parameter. * @param location @@ -119,7 +117,7 @@ extern "C" { * 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(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; + extern f_status_t fss_embedded_list_write_process_parameter_ignore(fll_program_data_t * const main, 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 diff --git a/level_3/fss_extended_list_read/c/common.c b/level_3/fss_extended_list_read/c/common.c index 6c95bd6..7675a99 100644 --- a/level_3/fss_extended_list_read/c/common.c +++ b/level_3/fss_extended_list_read/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_extended_list_read_program_name_ #ifndef _di_fss_extended_list_read_defines_ + const f_string_static_t fss_extended_list_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_READ_pipe_name_s, 0, FSS_EXTENDED_LIST_READ_pipe_name_s_length); 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); diff --git a/level_3/fss_extended_list_read/c/common.h b/level_3/fss_extended_list_read/c/common.h index 3e23909..af62d04 100644 --- a/level_3/fss_extended_list_read/c/common.h +++ b/level_3/fss_extended_list_read/c/common.h @@ -38,15 +38,21 @@ extern "C" { #define FSS_EXTENDED_LIST_READ_program_version_nano_s_length 0 #endif // !(defined(FSS_EXTENDED_LIST_READ_program_version_nano_s) && defined(FSS_EXTENDED_LIST_READ_program_version_nano_s_length)) - #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_version_nano_prefix_s FSS_EXTENDED_LIST_READ_version_nano_s + #define FSS_EXTENDED_LIST_READ_program_version_s FSS_EXTENDED_LIST_READ_program_version_major_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_minor_s F_string_ascii_period_s FSS_EXTENDED_LIST_READ_program_version_micro_s FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s FSS_EXTENDED_LIST_READ_program_version_nano_s - #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_version_nano_s_length + #define FSS_EXTENDED_LIST_READ_program_version_s_length FSS_EXTENDED_LIST_READ_program_version_major_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_minor_s_length + F_string_ascii_period_s_length + FSS_EXTENDED_LIST_READ_program_version_micro_s_length + FSS_EXTENDED_LIST_READ_program_version_nano_prefix_s_length + FSS_EXTENDED_LIST_READ_program_version_nano_s_length extern const f_string_static_t fss_extended_list_read_program_version_s; #endif // _di_fss_extended_list_read_program_version_ /** * The program name. + * + * fss_extended_list_read_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_extended_list_read_program_name_ #define FSS_EXTENDED_LIST_READ_program_name_s "fss_extended_list_read" @@ -65,14 +71,20 @@ extern "C" { #ifndef _di_fss_extended_list_read_defines_ #define fss_extended_list_read_signal_check_d 10000 + #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index 070e494..b596019 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -222,7 +222,7 @@ extern "C" { data.files.array = files_array; data.files.used = 1; data.files.size = main->parameters.remaining.used + 1; - data.files.array[0].name = "(pipe)"; + data.files.array[0].name = fss_extended_list_read_pipe_name_s; data.files.array[0].range.start = 1; data.files.array[0].range.stop = 0; @@ -237,7 +237,7 @@ extern "C" { fss_extended_list_read_parameter_delimit_e, }; - const f_string_t parameter_name[] = { + const f_string_static_t parameter_name[] = { fss_extended_list_read_long_at_s, fss_extended_list_read_long_depth_s, fss_extended_list_read_long_line_s, @@ -425,7 +425,7 @@ extern "C" { data.delimit_mode = fss_extended_list_read_delimit_mode_content_object_e; } - if (argv[index][length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) { + if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_greater_s.string[0]) { if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) { if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) { data.delimit_mode = fss_extended_list_read_delimit_mode_content_greater_object_e; @@ -438,7 +438,7 @@ extern "C" { // Shorten the length to better convert the remainder to a number. --length; } - else if (argv[index][length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) { + else if (argv[index].string[length - 1] == fss_extended_list_read_delimit_mode_name_lesser_s.string[0]) { if (!(data.delimit_mode == fss_extended_list_read_delimit_mode_none_e || data.delimit_mode == fss_extended_list_read_delimit_mode_all_e)) { if (data.delimit_mode == fss_extended_list_read_delimit_mode_content_object_e) { data.delimit_mode = fss_extended_list_read_delimit_mode_content_lesser_object_e; @@ -455,7 +455,7 @@ extern "C" { f_string_range_t range = macro_f_string_range_t_initialize(length); // Ignore leading plus sign. - if (argv[index][0] == f_string_ascii_plus_s[0]) { + if (argv[index].string[0] == f_string_ascii_plus_s.string[0]) { ++range.start; } @@ -541,7 +541,7 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); @@ -568,7 +568,7 @@ extern "C" { file.stream = 0; file.id = -1; - status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file); + status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 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, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); @@ -601,10 +601,10 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } } } diff --git a/level_3/fss_extended_list_read/c/private-print.c b/level_3/fss_extended_list_read/c/private-print.c index 48e524d..dc7e45d 100644 --- a/level_3/fss_extended_list_read/c/private-print.c +++ b/level_3/fss_extended_list_read/c/private-print.c @@ -68,7 +68,7 @@ extern "C" { 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_dynamic_raw(fss_extended_list_read_pipe_content_ignore, main->output.to.stream); + f_print_dynamic_raw(fss_extended_list_read_pipe_content_ignore_s, main->output.to.stream); } } #endif // _di_fss_extended_list_read_print_content_ignore_ @@ -77,7 +77,7 @@ extern "C" { 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_dynamic_raw(fss_extended_list_read_pipe_content_start, main->output.to.stream); + f_print_dynamic_raw(fss_extended_list_read_pipe_content_start_s, main->output.to.stream); } else { if ((data->option & fss_extended_list_read_data_option_object_d) && (data->option & fss_extended_list_read_data_option_content_d)) { @@ -92,7 +92,7 @@ extern "C" { 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); + f_print_dynamic_raw(fss_extended_list_read_pipe_content_end_s, main->output.to.stream); } else { if (data->option & fss_extended_list_read_data_option_object_d) { diff --git a/level_3/fss_extended_list_read/c/private-read.c b/level_3/fss_extended_list_read/c/private-read.c index 7f7972a..e96ccd2 100644 --- a/level_3/fss_extended_list_read/c/private-read.c +++ b/level_3/fss_extended_list_read/c/private-read.c @@ -84,6 +84,8 @@ extern "C" { f_array_length_t position_at = 0; f_array_length_t position_name = 0; + f_string_static_t * const argv = main->parameters.arguments.array; + for (f_array_length_t i = 0; i < data->depths.used; ++i) { if (fss_extended_list_read_signal_received(main)) { @@ -153,7 +155,7 @@ extern "C" { data->depths.array[i].index_name = main->parameters.array[fss_extended_list_read_parameter_name_e].values.array[position_name]; if (main->parameters.array[fss_extended_list_read_parameter_trim_e].result == f_console_result_found_e) { - status = fl_string_dynamic_rip(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name); + status = fl_string_rip(argv[data->depths.array[i].index_name].string, argv[data->depths.array[i].index_name].used, &data->depths.array[i].value_name); } else { status = f_string_dynamic_append(argv[data->depths.array[i].index_name], &data->depths.array[i].value_name); @@ -246,7 +248,7 @@ extern "C" { const f_status_t status = fll_fss_extended_list_read(data->buffer, state, &input, &data->objects, &data->contents, &data->delimits_object, &data->delimits_content, &data->comments); if (F_status_is_error(status)) { - const f_string_t file_name = fss_extended_list_read_file_identify(input.start, data->files); + const f_string_static_t file_name = fss_extended_list_read_file_identify(input.start, data->files); fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_list_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); @@ -268,16 +270,16 @@ extern "C" { #endif // _di_fss_extended_list_read_load_ #ifndef _di_fss_extended_list_read_load_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) { + f_status_t fss_extended_list_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, 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]; - const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); + const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used); - const f_status_t status = fl_conversion_string_to_number_unsigned(argv[index].string, range, number); + const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]); return status; } @@ -670,7 +672,7 @@ extern "C" { if (main->parameters.array[fss_extended_list_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_line_d; - status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, arguments, &data->line); + status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_line_e, fss_extended_list_read_long_line_s, &data->line); if (F_status_is_error(status)) return status; } @@ -689,7 +691,7 @@ extern "C" { if (main->parameters.array[fss_extended_list_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_extended_list_read_data_option_select_d; - status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, arguments, &data->select); + status = fss_extended_list_read_load_number(main, fss_extended_list_read_parameter_select_e, fss_extended_list_read_long_select_s, &data->select); if (F_status_is_error(status)) return status; } diff --git a/level_3/fss_extended_list_read/c/private-read.h b/level_3/fss_extended_list_read/c/private-read.h index 35664c3..426cff4 100644 --- a/level_3/fss_extended_list_read/c/private-read.h +++ b/level_3/fss_extended_list_read/c/private-read.h @@ -90,7 +90,7 @@ extern "C" { * On failure to identify, an empty string is returned. */ #ifndef _di_fss_extended_list_read_file_identify_ - extern f_string_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) F_attribute_visibility_internal_d; + extern f_string_static_t fss_extended_list_read_file_identify(const f_array_length_t at, const fss_extended_list_read_files_t files) F_attribute_visibility_internal_d; #endif // _di_fss_extended_list_read_file_identify_ /** @@ -130,8 +130,6 @@ extern "C" { * An ID representing the parameter. * @param name * The parameter name to print on error. - * @param arguments - * The console arguments passed to the program. * @param number * The location to store the loaded number. * @@ -146,7 +144,7 @@ extern "C" { * @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(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; + 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_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d; #endif // _di_fss_extended_list_read_load_number_ /** diff --git a/level_3/fss_extended_list_write/c/common.c b/level_3/fss_extended_list_write/c/common.c index b5174cf..4adc3bb 100644 --- a/level_3/fss_extended_list_write/c/common.c +++ b/level_3/fss_extended_list_write/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_extended_list_write_program_name_ #ifndef _di_fss_extended_list_write_defines_ + const f_string_static_t fss_extended_list_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_LIST_WRITE_pipe_name_s, 0, FSS_EXTENDED_LIST_WRITE_pipe_name_s_length); 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); diff --git a/level_3/fss_extended_list_write/c/common.h b/level_3/fss_extended_list_write/c/common.h index 824c00f..3bb5648 100644 --- a/level_3/fss_extended_list_write/c/common.h +++ b/level_3/fss_extended_list_write/c/common.h @@ -61,10 +61,20 @@ extern "C" { /** * The program defines. + * + * fss_extended_list_write_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_extended_list_write_defines_ #define fss_extended_list_write_signal_check_d 10000 + #define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)" + + #define FSS_EXTENDED_LIST_READ_pipe_name_s_length 6 + #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" @@ -73,6 +83,8 @@ extern "C" { #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_read_pipe_name_s; + 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; diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index b301d3f..4099813 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -324,7 +324,6 @@ extern "C" { } else if (main->parameters.array[fss_extended_list_write_parameter_prepend_e].result == f_console_result_additional_e) { const f_array_length_t index = main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.array[main->parameters.array[fss_extended_list_write_parameter_prepend_e].values.used - 1]; - const f_array_length_t length = strnlen(argv[index], F_console_parameter_size_d); if (length) { f_string_range_t range = macro_f_string_range_t_initialize(length); @@ -403,18 +402,18 @@ extern "C" { } } - f_fss_quote_t quote = F_fss_delimit_quote_double_s; + f_fss_quote_t quote = f_fss_delimit_quote_double_s; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_extended_list_write_parameter_double_e].result == f_console_result_found_e) { if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { if (main->parameters.array[fss_extended_list_write_parameter_double_e].location < main->parameters.array[fss_extended_list_write_parameter_single_e].location) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } } else if (main->parameters.array[fss_extended_list_write_parameter_single_e].result == f_console_result_found_e) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } @@ -465,7 +464,7 @@ extern "C" { break; } - status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); + status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; status = fss_extended_list_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]], &ignore, &buffer); @@ -482,7 +481,7 @@ extern "C" { break; } - status = fss_extended_list_write_process_parameter_ignore(main, arguments, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); + status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore); if (F_status_is_error(status)) break; status = fss_extended_list_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_extended_list_write_parameter_content_e].values.array[i]], &ignore, &buffer); diff --git a/level_3/fss_extended_list_write/c/private-write.c b/level_3/fss_extended_list_write/c/private-write.c index 7d82be2..649eac7 100644 --- a/level_3/fss_extended_list_write/c/private-write.c +++ b/level_3/fss_extended_list_write/c/private-write.c @@ -209,21 +209,21 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s.string[0]) { state = 0x2; ++range.start; break; } - if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s.string[0]) { // This is not used by objects. continue; @@ -260,7 +260,7 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_start_s.string[0]) { if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s); } @@ -270,14 +270,14 @@ extern "C" { break; } - if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_end_s.string[0]) { state = 0x3; range.start++; break; } - if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_extended_list_write_pipe_content_ignore_s.string[0]) { if (ignore) { if (range_ignore.start > range_ignore.stop) { range_ignore.start = content.used; @@ -350,7 +350,7 @@ extern "C" { #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(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 fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, const f_array_lengths_t contents, const f_array_length_t location, f_string_ranges_t *ignore) { f_status_t status = F_none; @@ -362,6 +362,8 @@ extern "C" { f_number_unsigned_t number = 0; + f_string_static_t * const argv = main->parameters.arguments.array; + range.start = 0; for (; i < main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) { @@ -402,7 +404,7 @@ extern "C" { range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1; // allow and ignore the positive sign. - if (range.stop > 0 && argv[index][0] == '+') { + if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } @@ -422,7 +424,7 @@ extern "C" { range.stop = strnlen(argv[index], F_console_parameter_size_d) - 1; // allow and ignore the positive sign. - if (range.stop > 0 && argv[index][0] == '+') { + if (range.stop > 0 && argv[index].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } diff --git a/level_3/fss_extended_list_write/c/private-write.h b/level_3/fss_extended_list_write/c/private-write.h index 0883710..4f54ee7 100644 --- a/level_3/fss_extended_list_write/c/private-write.h +++ b/level_3/fss_extended_list_write/c/private-write.h @@ -105,8 +105,6 @@ extern "C" { * * @param main * The main program data. - * @param arguments - * The parameters passed to the process. * @param contents * The console parameter locations array for the content parameter. * @param location @@ -119,7 +117,7 @@ extern "C" { * 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(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; + extern f_status_t fss_extended_list_write_process_parameter_ignore(fll_program_data_t * const main, 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 diff --git a/level_3/fss_extended_read/c/common.c b/level_3/fss_extended_read/c/common.c index ddf08cc..db906b0 100644 --- a/level_3/fss_extended_read/c/common.c +++ b/level_3/fss_extended_read/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_extended_read_program_name_ #ifndef _di_fss_extended_read_defines_ + const f_string_static_t fss_extended_read_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_READ_pipe_name_s, 0, FSS_EXTENDED_READ_pipe_name_s_length); 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); diff --git a/level_3/fss_extended_read/c/common.h b/level_3/fss_extended_read/c/common.h index dd66d09..c22c4cd 100644 --- a/level_3/fss_extended_read/c/common.h +++ b/level_3/fss_extended_read/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The program defines. + * + * fss_extended_read_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_extended_read_defines_ #define fss_extended_read_signal_check_d 10000 + #define FSS_EXTENDED_READ_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index d3f24b5..05aba44 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -222,7 +222,7 @@ extern "C" { data.files.array = files_array; data.files.used = 1; data.files.size = main->parameters.remaining.used + 1; - data.files.array[0].name = "(pipe)"; + data.files.array[0].name = fss_extended_read_pipe_name_s; data.files.array[0].range.start = 1; data.files.array[0].range.stop = 0; @@ -543,10 +543,10 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } } else { @@ -574,7 +574,7 @@ extern "C" { file.stream = 0; file.id = -1; - status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 0, &file); + status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 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, argv[main->parameters.remaining.array[i]], f_file_operation_open_s, fll_error_file_type_file_e); @@ -608,10 +608,10 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } } } diff --git a/level_3/fss_extended_read/c/private-read.c b/level_3/fss_extended_read/c/private-read.c index eb35b51..272b21b 100644 --- a/level_3/fss_extended_read/c/private-read.c +++ b/level_3/fss_extended_read/c/private-read.c @@ -261,7 +261,7 @@ extern "C" { const f_status_t status = fll_fss_extended_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes_object, &data->quotes_content, &data->delimits_object, &data->delimits_content); if (F_status_is_error(status)) { - const f_string_t file_name = fss_extended_read_file_identify(input.start, data->files); + const f_string_static_t file_name = fss_extended_read_file_identify(input.start, data->files); fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); @@ -283,16 +283,16 @@ extern "C" { #endif // _di_fss_extended_read_load_ #ifndef _di_fss_extended_read_load_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) { + f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, 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]; - const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); + const f_string_range_t range = macro_f_string_range_t_initialize(main->parameters.arguments.array[index].used); - const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); + const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, arguments->argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]); return status; } @@ -600,7 +600,7 @@ extern "C" { if (main->parameters.array[fss_extended_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_line_d; - status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, arguments, &data->line); + status = fss_extended_read_load_number(main, fss_extended_read_parameter_line_e, fss_extended_read_long_line_s, &data->line); if (F_status_is_error(status)) return status; } @@ -619,7 +619,7 @@ extern "C" { if (main->parameters.array[fss_extended_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_extended_read_data_option_select_d; - status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, arguments, &data->select); + status = fss_extended_read_load_number(main, fss_extended_read_parameter_select_e, fss_extended_read_long_select_s, &data->select); if (F_status_is_error(status)) return status; } diff --git a/level_3/fss_extended_read/c/private-read.h b/level_3/fss_extended_read/c/private-read.h index 509e3ef..3cf437e 100644 --- a/level_3/fss_extended_read/c/private-read.h +++ b/level_3/fss_extended_read/c/private-read.h @@ -90,7 +90,7 @@ extern "C" { * On failure to identify, an empty string is returned. */ #ifndef _di_fss_extended_read_file_identify_ - extern f_string_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) F_attribute_visibility_internal_d; + extern f_string_static_t fss_extended_read_file_identify(const f_array_length_t at, const fss_extended_read_files_t files) F_attribute_visibility_internal_d; #endif // _di_fss_extended_read_file_identify_ /** @@ -130,8 +130,6 @@ extern "C" { * An ID representing the parameter. * @param name * The parameter name to print on error. - * @param arguments - * The console arguments passed to the program. * @param number * The location to store the loaded number. * @@ -146,7 +144,7 @@ extern "C" { * @see fss_extended_read_depths_resize() */ #ifndef _di_fss_extended_read_load_number_ - 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; + extern f_status_t fss_extended_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d; #endif // _di_fss_extended_read_load_number_ /** diff --git a/level_3/fss_extended_write/c/common.c b/level_3/fss_extended_write/c/common.c index d7ec540..95be75d 100644 --- a/level_3/fss_extended_write/c/common.c +++ b/level_3/fss_extended_write/c/common.c @@ -14,6 +14,7 @@ extern "C" { #endif // _di_fss_extended_write_program_name_ #ifndef _di_fss_extended_write_defines_ + const f_string_static_t fss_extended_write_pipe_name_s = macro_f_string_static_t_initialize(FSS_EXTENDED_WRITE_pipe_name_s, 0, FSS_EXTENDED_WRITE_pipe_name_s_length); 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); diff --git a/level_3/fss_extended_write/c/common.h b/level_3/fss_extended_write/c/common.h index 405778c..600e772 100644 --- a/level_3/fss_extended_write/c/common.h +++ b/level_3/fss_extended_write/c/common.h @@ -61,18 +61,30 @@ extern "C" { /** * The main program defines. + * + * fss_extended_write_pipe_*: + * - name: A name used to represent the pipe when printing file names. + * - content_end: A code used to represent the end of Content for use in binary formats. + * - content_ignore: A code used to represent the ignoring Content for use in binary formats. + * - content_start: A code used to represent the start of Content for use in binary formats. */ #ifndef _di_fss_extended_write_defines_ #define fss_extended_write_signal_check_d 10000 + #define FSS_EXTENDED_WRITE_pipe_name_s "(pipe)" + #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_name_s_length 6 + #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_name_s; + 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; diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 72aad1b..a1bab6c 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -187,7 +187,7 @@ extern "C" { } } else if (main->parameters.array[fss_extended_write_parameter_file_e].result == f_console_result_found_e) { - fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s,.string fss_extended_write_long_file_s); + fss_extended_write_error_parameter_value_missing_print(main, f_console_symbol_long_enable_s.string fss_extended_write_long_file_s); status = F_status_set_error(F_parameter); } } @@ -409,18 +409,18 @@ extern "C" { } } - f_fss_quote_t quote = F_fss_delimit_quote_double_s; + f_fss_quote_t quote = f_fss_quote_type_double_e; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_extended_write_parameter_double_e].result == f_console_result_found_e) { if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { if (main->parameters.array[fss_extended_write_parameter_double_e].location < main->parameters.array[fss_extended_write_parameter_single_e].location) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } } else if (main->parameters.array[fss_extended_write_parameter_single_e].result == f_console_result_found_e) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } @@ -489,10 +489,7 @@ extern "C" { for (; i < main->parameters.array[fss_extended_write_parameter_content_e].values.used; ++i) { - contents.array[contents.used].string = argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[i]]; - contents.array[contents.used].used = strnlen(contents.array[contents.used].string, F_console_parameter_size_d); - contents.array[contents.used].size = contents.array[contents.used].used; - ++contents.used; + contents.array[contents.used++] = argv[main->parameters.array[fss_extended_write_parameter_content_e].values.array[i]]; } // for status = fss_extended_write_process(main, output, quote, 0, &contents, &buffer); @@ -533,9 +530,7 @@ extern "C" { object_next = main->parameters.array[fss_extended_write_parameter_object_e].locations.array[i + 1]; } - object.string = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]]; - object.used = strnlen(object.string, F_console_parameter_size_d); - object.size = object.used; + object = argv[main->parameters.array[fss_extended_write_parameter_object_e].values.array[i]]; contents.used = 0; diff --git a/level_3/fss_extended_write/c/private-write.c b/level_3/fss_extended_write/c/private-write.c index ae349cc..e0190fd 100644 --- a/level_3/fss_extended_write/c/private-write.c +++ b/level_3/fss_extended_write/c/private-write.c @@ -230,21 +230,21 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_extended_write_pipe_content_start_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_start_s.string[0]) { state = 0x2; ++range.start; break; } - if (block.string[range.start] == fss_extended_write_pipe_content_end_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_end_s.string[0]) { state = 0x4; ++range.start; break; } - if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s.string[0]) { // This is not used by objects. continue; @@ -287,7 +287,7 @@ extern "C" { if (total) { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_extended_write_pipe_content_start_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_start_s.string[0]) { if (contents.used + 1 > contents.size) { status = f_string_dynamics_increase_by(F_fss_default_allocation_step_d, &contents); @@ -303,14 +303,14 @@ extern "C" { continue; } - if (block.string[range.start] == fss_extended_write_pipe_content_end_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_end_s.string[0]) { state = 0x4; ++range.start; break; } - if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_extended_write_pipe_content_ignore_s.string[0]) { // This is not used by this program. continue; diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index 5cf85f8..96e7c22 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -176,12 +176,12 @@ extern "C" { } else if (main->parameters.array[fss_identify_parameter_line_e].result == f_console_result_additional_e) { const f_array_length_t index = main->parameters.array[fss_identify_parameter_line_e].values.array[main->parameters.array[fss_identify_parameter_line_e].values.used - 1]; - const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); + const f_string_range_t range = macro_f_string_range_t_initialize(argv[index].used); - status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, &data.line); + status = fl_conversion_string_to_number_unsigned(argv[index].string, range, &data.line); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, arguments->argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, fss_identify_long_line_s, argv[index]); } } } @@ -229,7 +229,7 @@ extern "C" { } else if (main->parameters.array[fss_identify_parameter_name_e].result == f_console_result_additional_e) { const f_array_length_t index = main->parameters.array[fss_identify_parameter_name_e].values.array[main->parameters.array[fss_identify_parameter_name_e].values.used - 1]; - const f_array_length_t length = strnlen(arguments->argv[index], F_console_parameter_size_d); + const f_array_length_t length = argv[index].used; const f_string_range_t range = macro_f_string_range_t_initialize(length); if (length == 0) { @@ -255,7 +255,7 @@ extern "C" { for (f_array_length_t i = range.start; i <= range.stop; ++i) { - status = f_utf_is_word(arguments->argv[index] + i, length, F_true); + status = f_utf_is_word(argv[index].string + i, length, F_true); if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word", F_true); @@ -266,7 +266,7 @@ extern "C" { flockfile(main->error.to.stream); fl_print_format("%r%[%QThe value '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context); - fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, arguments->argv[index], main->error.notable); + fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, argv[index], main->error.notable); fl_print_format("%[' for the parameter '%]", main->error.to.stream, main->error.context, main->error.context); fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fss_identify_long_name_s, main->error.notable); fl_print_format("%[' may only contain word characters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s); @@ -278,7 +278,7 @@ extern "C" { break; } - data.name.string[data.name.used++] = arguments->argv[index][i]; + data.name.string[data.name.used++] = argv[index].string[i]; } // for } } @@ -322,16 +322,16 @@ extern "C" { file.size_read = 512; - status = f_file_stream_open(arguments->argv[main->parameters.remaining.array[i]], 0, &file); + status = f_file_stream_open(argv[main->parameters.remaining.array[i]], 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[main->parameters.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, 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->parameters.remaining.array[i]], &buffer, &range); + status = fss_identify_load_line(main, file, argv[main->parameters.remaining.array[i]], &buffer, &range); if (F_status_is_error_not(status)) { - status = fss_identify_process(main, arguments->argv[main->parameters.remaining.array[i]], buffer, &range, &data); + status = fss_identify_process(main, argv[main->parameters.remaining.array[i]], buffer, &range, &data); } } diff --git a/level_3/fss_payload_read/c/fss_payload_read.c b/level_3/fss_payload_read/c/fss_payload_read.c index 6c8c4d5..425f825 100644 --- a/level_3/fss_payload_read/c/fss_payload_read.c +++ b/level_3/fss_payload_read/c/fss_payload_read.c @@ -239,7 +239,7 @@ extern "C" { data.files.array = files_array; data.files.used = 1; data.files.size = main->parameters.remaining.used + 1; - data.files.array[0].name = "(pipe)"; + data.files.array[0].name = fss_payload_read_pipe_name_s; data.files.array[0].range.start = 1; data.files.array[0].range.stop = 0; @@ -572,10 +572,10 @@ extern "C" { // 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. // Guarantee that a newline exists at the end of the buffer. - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } } else { @@ -629,10 +629,10 @@ extern "C" { // Guarantee that a newline exists at the end of the buffer. // This is done as a pre-process on the next file because the "payload" must always be last and must not have a newline appended. if (buffer_used != data.buffer.used) { - status = f_string_append_assure(f_string_eol_s, 1, &data.buffer); + status = f_string_dynamic_append_assure(f_string_eol_s, &data.buffer); if (F_status_is_error(status)) { - fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e); + fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e); } } diff --git a/level_3/fss_payload_read/c/private-read.c b/level_3/fss_payload_read/c/private-read.c index 2506fd7..1a8b98e 100644 --- a/level_3/fss_payload_read/c/private-read.c +++ b/level_3/fss_payload_read/c/private-read.c @@ -255,7 +255,7 @@ extern "C" { f_status_t status = fll_fss_payload_read(data->buffer, state, &input, &data->objects, &data->contents, &data->delimits_object, &data->delimits_content, &data->comments); if (F_status_is_error(status)) { - const f_string_t file_name = fss_payload_read_file_identify(input.start, data->files); + const f_string_static_t file_name = fss_payload_read_file_identify(input.start, data->files); if (F_status_set_fine(status) == F_none || F_status_set_fine(status) == F_none_eos || F_status_set_fine(status) == F_none_stop || F_status_set_fine(status) == F_data_not_eos || F_status_set_fine(status) == F_data_not_stop) { if (main->error.verbosity != f_console_verbosity_quiet_e) { @@ -300,7 +300,7 @@ extern "C" { status = fll_fss_extended_read(data->buffer, state, &input_header, &data->objects_header, &data->contents_header, &data->quotes_object_header, &data->quotes_content_header, &data->delimits_object_header, &data->delimits_content_header); if (F_status_is_error(status)) { - const f_string_t file_name = fss_payload_read_file_identify(input.start, data->files); + const f_string_static_t file_name = fss_payload_read_file_identify(input.start, data->files); fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_extended_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e); @@ -314,16 +314,16 @@ extern "C" { #endif // _di_fss_payload_read_load_ #ifndef _di_fss_payload_read_load_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) { + f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, 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]; - const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(arguments->argv[index], F_console_parameter_size_d)); + const f_string_range_t range = macro_f_string_range_t_initialize(strnlen(main->parameters.arguments.array[index], F_console_parameter_size_d)); - const f_status_t status = fl_conversion_string_to_number_unsigned(arguments->argv[index], range, number); + const f_status_t status = fl_conversion_string_to_number_unsigned(main->parameters.arguments.array[index].string, range, number); if (F_status_is_error(status)) { - fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, arguments->argv[index]); + fll_error_parameter_integer_print(main->error, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", F_true, name, main->parameters.arguments.array[index]); return status; } @@ -1010,7 +1010,7 @@ extern "C" { if (main->parameters.array[fss_payload_read_parameter_line_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_line_d; - status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, arguments, &data->line); + status = fss_payload_read_load_number(main, fss_payload_read_parameter_line_e, fss_payload_read_long_line_s, &data->line); if (F_status_is_error(status)) return status; } @@ -1029,7 +1029,7 @@ extern "C" { if (main->parameters.array[fss_payload_read_parameter_select_e].result == f_console_result_additional_e) { data->option |= fss_payload_read_data_option_select_d; - status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, arguments, &data->select); + status = fss_payload_read_load_number(main, fss_payload_read_parameter_select_e, fss_payload_read_long_select_s, &data->select); if (F_status_is_error(status)) return status; } diff --git a/level_3/fss_payload_read/c/private-read.h b/level_3/fss_payload_read/c/private-read.h index 1d35991..cfe60df 100644 --- a/level_3/fss_payload_read/c/private-read.h +++ b/level_3/fss_payload_read/c/private-read.h @@ -92,7 +92,7 @@ extern "C" { * On failure to identify, an empty string is returned. */ #ifndef _di_fss_payload_read_file_identify_ - extern f_string_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) F_attribute_visibility_internal_d; + extern f_string_static_t fss_payload_read_file_identify(const f_array_length_t at, const fss_payload_read_files_t files) F_attribute_visibility_internal_d; #endif // _di_fss_payload_read_file_identify_ /** @@ -132,8 +132,6 @@ extern "C" { * An ID representing the parameter. * @param name * The parameter name to print on error. - * @param arguments - * The console arguments passed to the program. * @param number * The location to store the loaded number. * @@ -148,7 +146,7 @@ extern "C" { * @see fss_payload_read_depths_resize() */ #ifndef _di_fss_payload_read_load_number_ - 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; + extern f_status_t fss_payload_read_load_number(fll_program_data_t * const main, const f_array_length_t parameter, const f_string_static_t name, f_number_unsigned_t *number) F_attribute_visibility_internal_d; #endif // _di_fss_payload_read_load_number_ /** diff --git a/level_3/fss_payload_write/c/fss_payload_write.c b/level_3/fss_payload_write/c/fss_payload_write.c index 8b88fa6..77be49d 100644 --- a/level_3/fss_payload_write/c/fss_payload_write.c +++ b/level_3/fss_payload_write/c/fss_payload_write.c @@ -406,18 +406,18 @@ extern "C" { } } - f_fss_quote_t quote = F_fss_delimit_quote_double_s; + f_fss_quote_t quote = f_fss_quote_type_double_e; if (F_status_is_error_not(status)) { if (main->parameters.array[fss_payload_write_parameter_double_e].result == f_console_result_found_e) { if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { if (main->parameters.array[fss_payload_write_parameter_double_e].location < main->parameters.array[fss_payload_write_parameter_single_e].location) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } } else if (main->parameters.array[fss_payload_write_parameter_single_e].result == f_console_result_found_e) { - quote = F_fss_delimit_quote_single_s; + quote = f_fss_quote_type_single_e; } } diff --git a/level_3/fss_payload_write/c/private-write.c b/level_3/fss_payload_write/c/private-write.c index 0217d77..c2358b8 100644 --- a/level_3/fss_payload_write/c/private-write.c +++ b/level_3/fss_payload_write/c/private-write.c @@ -239,21 +239,21 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_payload_write_pipe_content_start_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_start_s.string[0]) { state = 0x2; ++range.start; break; } - if (block.string[range.start] == fss_payload_write_pipe_content_end_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s.string[0]) { // This is not used by objects. continue; @@ -320,7 +320,7 @@ extern "C" { for (; range.start <= range.stop; ++range.start) { - if (block.string[range.start] == fss_payload_write_pipe_content_start_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_start_s.string[0]) { if (main->error.verbosity != f_console_verbosity_quiet_e) { fll_print_format("%r%[%QThis standard only supports one content per object.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s); } @@ -330,14 +330,14 @@ extern "C" { break; } - if (block.string[range.start] == fss_payload_write_pipe_content_end_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_end_s.string[0]) { state = 0x3; ++range.start; break; } - if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s) { + if (block.string[range.start] == fss_payload_write_pipe_content_ignore_s.string[0]) { // This is not used by this program. continue; -- 1.8.3.1