From 52cfac5ba0a4b98fd3184137793938fd914d2b13 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 30 Jul 2024 21:45:20 -0500 Subject: [PATCH] Refactor: Change bit-wise enumerations into defines. I did some reviewing of how the enumerations used for flags are used. These generally are not being used as a type. An enumeration slightly increases the resulting binary size. Enumeration values might be limited to just type of int. This seems like an easy (small) optimization to just use defines rather than enumerations for flags and other bit-wise numbers. --- level_3/byte_dump/c/main/byte_dump.c | 10 +- level_3/byte_dump/c/main/common.c | 36 +++--- level_3/byte_dump/c/main/common/define.h | 57 +++++++++ level_3/byte_dump/c/main/common/enumeration.h | 61 --------- level_3/byte_dump/c/main/common/type.h | 2 +- level_3/byte_dump/c/main/main.c | 10 +- level_3/byte_dump/c/main/print/data.c | 82 ++++++------ level_3/byte_dump/c/main/process.c | 6 +- level_3/example/c/main/common.c | 10 +- level_3/example/c/main/common/define.h | 51 ++++++++ level_3/example/c/main/common/enumeration.h | 55 -------- level_3/example/c/main/common/type.h | 2 +- level_3/example/c/main/example.c | 8 +- level_3/example/c/main/main.c | 10 +- level_3/fake/c/main/build.c | 2 +- level_3/fake/c/main/build/load.c | 6 +- level_3/fake/c/main/common.c | 30 ++--- level_3/fake/c/main/common/define.h | 105 ++++++++++++++-- level_3/fake/c/main/common/enumeration.h | 87 ------------- level_3/fake/c/main/fake.c | 12 +- level_3/fake/c/main/fake/do.c | 14 +-- level_3/fake/c/main/fake/do.h | 8 +- level_3/fake/c/main/main.c | 18 +-- level_3/fake/c/main/make/operate_process_type.c | 4 +- level_3/fake/c/main/signal.c | 2 +- level_3/fake/c/main/signal.h | 4 +- level_3/firewall/c/main/common.c | 50 ++++---- level_3/firewall/c/main/common/define.h | 66 ++++++++++ level_3/firewall/c/main/common/enumeration.h | 70 ----------- level_3/firewall/c/main/common/type.h | 4 +- level_3/firewall/c/main/firewall.c | 10 +- level_3/firewall/c/main/operate.c | 28 ++--- level_3/firewall/c/main/operate/chains.c | 6 +- level_3/firewall/c/main/operate/process.c | 4 +- level_3/firewall/c/main/operate/show.c | 6 +- level_3/fss_identify/c/main/common.c | 46 +++---- level_3/fss_identify/c/main/common/define.h | 59 +++++++++ level_3/fss_identify/c/main/common/enumeration.h | 63 ---------- level_3/fss_identify/c/main/common/type.h | 2 +- level_3/fss_identify/c/main/fss_identify.c | 14 +-- level_3/fss_identify/c/main/main.c | 10 +- level_3/fss_identify/c/main/print/data.c | 6 +- level_3/fss_identify/c/main/process.c | 6 +- level_3/fss_read/c/basic/fss_read.c | 2 +- level_3/fss_read/c/basic/main.c | 14 +-- level_3/fss_read/c/basic/print.c | 4 +- level_3/fss_read/c/basic_list/fss_read.c | 2 +- level_3/fss_read/c/basic_list/main.c | 12 +- level_3/fss_read/c/basic_list/print.c | 4 +- level_3/fss_read/c/embedded_list/fss_read.c | 2 +- level_3/fss_read/c/embedded_list/main.c | 14 +-- level_3/fss_read/c/embedded_list/print.c | 6 +- level_3/fss_read/c/extended/fss_read.c | 2 +- level_3/fss_read/c/extended/main.c | 14 +-- level_3/fss_read/c/extended/print.c | 8 +- level_3/fss_read/c/extended_list/fss_read.c | 2 +- level_3/fss_read/c/extended_list/main.c | 12 +- level_3/fss_read/c/extended_list/print.c | 6 +- level_3/fss_read/c/main/common.c | 44 +++---- level_3/fss_read/c/main/common/define.h | 101 ++++++++++++++- level_3/fss_read/c/main/common/enumeration.h | 99 --------------- level_3/fss_read/c/main/common/type.h | 2 +- level_3/fss_read/c/main/fss_read.c | 10 +- level_3/fss_read/c/main/main.c | 152 +++++++++++------------ level_3/fss_read/c/main/print/data.c | 30 ++--- level_3/fss_read/c/main/process_normal.c | 86 ++++++------- level_3/fss_read/c/payload/fss_read.c | 24 ++-- level_3/fss_read/c/payload/main.c | 12 +- level_3/fss_read/c/payload/print.c | 4 +- level_3/fss_write/c/basic/fss_write.c | 16 +-- level_3/fss_write/c/basic/main.c | 10 +- level_3/fss_write/c/basic_list/fss_write.c | 18 +-- level_3/fss_write/c/basic_list/main.c | 10 +- level_3/fss_write/c/embedded_list/fss_write.c | 16 +-- level_3/fss_write/c/embedded_list/main.c | 14 +-- level_3/fss_write/c/extended/fss_write.c | 18 +-- level_3/fss_write/c/extended/main.c | 12 +- level_3/fss_write/c/extended_list/fss_write.c | 16 +-- level_3/fss_write/c/extended_list/main.c | 12 +- level_3/fss_write/c/main/common.c | 54 ++++---- level_3/fss_write/c/main/common/define.h | 64 ++++++++++ level_3/fss_write/c/main/common/enumeration.h | 68 ---------- level_3/fss_write/c/main/common/type.h | 2 +- level_3/fss_write/c/main/fss_write.c | 24 ++-- level_3/fss_write/c/main/main.c | 36 +++--- level_3/fss_write/c/payload/fss_write.c | 26 ++-- level_3/fss_write/c/payload/main.c | 10 +- level_3/iki_read/c/main/common.c | 36 +++--- level_3/iki_read/c/main/common/define.h | 71 ++++++++++- level_3/iki_read/c/main/common/enumeration.h | 71 ----------- level_3/iki_read/c/main/common/type.h | 2 +- level_3/iki_read/c/main/identify.c | 2 +- level_3/iki_read/c/main/iki_read.c | 10 +- level_3/iki_read/c/main/main.c | 10 +- level_3/iki_read/c/main/print/data.c | 16 +-- level_3/iki_read/c/main/process.c | 12 +- level_3/iki_write/c/main/common.c | 20 +-- level_3/iki_write/c/main/common/define.h | 51 ++++++++ level_3/iki_write/c/main/common/enumeration.h | 55 -------- level_3/iki_write/c/main/common/type.h | 2 +- level_3/iki_write/c/main/iki_write.c | 10 +- level_3/iki_write/c/main/main.c | 10 +- level_3/iki_write/c/main/process.c | 2 +- level_3/status_code/c/fss/main.c | 10 +- level_3/status_code/c/main/common.c | 28 ++--- level_3/status_code/c/main/common/define.h | 53 ++++++++ level_3/status_code/c/main/common/enumeration.h | 57 --------- level_3/status_code/c/main/common/type.h | 2 +- level_3/status_code/c/main/main.c | 10 +- level_3/status_code/c/main/process.c | 6 +- level_3/status_code/c/main/status_code.c | 18 +-- level_3/utf8/c/main/bytesequence.c | 2 +- level_3/utf8/c/main/codepoint.c | 4 +- level_3/utf8/c/main/common.c | 34 ++--- level_3/utf8/c/main/common/define.h | 81 ++++++++++++ level_3/utf8/c/main/common/enumeration.h | 87 ------------- level_3/utf8/c/main/common/type.h | 6 +- level_3/utf8/c/main/main.c | 10 +- level_3/utf8/c/main/print/data.c | 34 ++--- level_3/utf8/c/main/print/error.c | 4 +- level_3/utf8/c/main/utf8.c | 26 ++-- 121 files changed, 1520 insertions(+), 1568 deletions(-) diff --git a/level_3/byte_dump/c/main/byte_dump.c b/level_3/byte_dump/c/main/byte_dump.c index 8130703..1a312d4 100644 --- a/level_3/byte_dump/c/main/byte_dump.c +++ b/level_3/byte_dump/c/main/byte_dump.c @@ -11,14 +11,14 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & byte_dump_main_flag_version_copyright_help_e) { - if (main->setting.flag & byte_dump_main_flag_help_e) { + if (main->setting.flag & byte_dump_main_flag_version_copyright_help_d) { + if (main->setting.flag & byte_dump_main_flag_help_d) { byte_dump_print_message_help(&main->program.message); } - else if (main->setting.flag & byte_dump_main_flag_version_e) { + else if (main->setting.flag & byte_dump_main_flag_version_d) { fll_program_print_version(&main->program.message, byte_dump_program_version_s); } - else if (main->setting.flag & byte_dump_main_flag_copyright_e) { + else if (main->setting.flag & byte_dump_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } @@ -28,7 +28,7 @@ extern "C" { if (main->setting.files.used || (main->program.pipe & fll_program_data_pipe_input_e)) { f_file_t file = f_file_t_initialize; - if (main->setting.flag & byte_dump_main_flag_pipe_e) { + if (main->setting.flag & byte_dump_main_flag_pipe_d) { file.id = F_type_descriptor_input_d; file.stream = F_type_input_d; diff --git a/level_3/byte_dump/c/main/common.c b/level_3/byte_dump/c/main/common.c index 211b8c4..95d261d 100644 --- a/level_3/byte_dump/c/main/common.c +++ b/level_3/byte_dump/c/main/common.c @@ -115,28 +115,28 @@ extern "C" { } if (choices.array[choice] == byte_dump_parameter_narrow_e) { - main->setting.flag &= ~byte_dump_main_flag_wide_e; + main->setting.flag &= ~byte_dump_main_flag_wide_d; } else if (choices.array[choice] == byte_dump_parameter_wide_e) { - main->setting.flag |= byte_dump_main_flag_wide_e; + main->setting.flag |= byte_dump_main_flag_wide_d; } } } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_help_e; + main->setting.flag |= byte_dump_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_version_e; + main->setting.flag |= byte_dump_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_copyright_e; + main->setting.flag |= byte_dump_main_flag_copyright_d; return; } @@ -145,10 +145,10 @@ extern "C" { f_number_unsigned_t number = 0; if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= byte_dump_main_flag_pipe_e; + main->setting.flag |= byte_dump_main_flag_pipe_d; } else { - main->setting.flag &= ~byte_dump_main_flag_pipe_e; + main->setting.flag &= ~byte_dump_main_flag_pipe_d; } if (main->program.parameters.array[byte_dump_parameter_width_e].result & f_console_result_value_e) { @@ -189,8 +189,8 @@ extern "C" { }; const uint16_t flags[] = { - byte_dump_main_flag_first_e, - byte_dump_main_flag_last_e, + byte_dump_main_flag_first_d, + byte_dump_main_flag_last_d, }; uint64_t * const values[] = { @@ -231,7 +231,7 @@ extern "C" { } } // for - if ((main->setting.flag & byte_dump_main_flag_first_e) && (main->setting.flag & byte_dump_main_flag_last_e)) { + if ((main->setting.flag & byte_dump_main_flag_first_d) && (main->setting.flag & byte_dump_main_flag_last_d)) { if (main->setting.first > main->setting.last) { main->setting.state.status = F_status_set_error(F_parameter); @@ -246,31 +246,31 @@ extern "C" { } if (main->program.parameters.array[byte_dump_parameter_text_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_text_e; + main->setting.flag |= byte_dump_main_flag_text_d; } else { - main->setting.flag &= ~byte_dump_main_flag_text_e; + main->setting.flag &= ~byte_dump_main_flag_text_d; } if (main->program.parameters.array[byte_dump_parameter_unicode_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_unicode_e; + main->setting.flag |= byte_dump_main_flag_unicode_d; } else { - main->setting.flag &= ~byte_dump_main_flag_unicode_e; + main->setting.flag &= ~byte_dump_main_flag_unicode_d; } if (main->program.parameters.array[byte_dump_parameter_placeholder_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_placeholder_e; + main->setting.flag |= byte_dump_main_flag_placeholder_d; } else { - main->setting.flag &= ~byte_dump_main_flag_placeholder_e; + main->setting.flag &= ~byte_dump_main_flag_placeholder_d; } if (main->program.parameters.array[byte_dump_parameter_classic_e].result & f_console_result_found_e) { - main->setting.flag |= byte_dump_main_flag_classic_e; + main->setting.flag |= byte_dump_main_flag_classic_d; } else { - main->setting.flag &= ~byte_dump_main_flag_classic_e; + main->setting.flag &= ~byte_dump_main_flag_classic_d; } if (main->program.parameters.remaining.used) { diff --git a/level_3/byte_dump/c/main/common/define.h b/level_3/byte_dump/c/main/common/define.h index 374c7db..a74884b 100644 --- a/level_3/byte_dump/c/main/common/define.h +++ b/level_3/byte_dump/c/main/common/define.h @@ -33,6 +33,63 @@ extern "C" { #endif // _di_byte_dump_allocation_d_ /** + * Flags passed to the main function or program. + * + * byte_dump_main_flag_*_d: + * - none: No flags set. + * - classic: Classic is specified. + * - copyright: Print the copyright. + * - first: The first position is specified. + * - help: Print help. + * - last: The last position is specified. + * - placeholder: Placeholder is specified. + * - pipe: Use the input pipe. + * - text: Text is specified. + * - unicode: Unicode is specified. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + * - wide: Wide option is specified for printing wide. + */ +#ifndef _di_byte_dump_main_flag_d_ + #define byte_dump_main_flag_none_d 0x0 + #define byte_dump_main_flag_classic_d 0x1 + #define byte_dump_main_flag_copyright_d 0x2 + #define byte_dump_main_flag_first_d 0x4 + #define byte_dump_main_flag_help_d 0x8 + #define byte_dump_main_flag_last_d 0x10 + #define byte_dump_main_flag_pipe_d 0x20 + #define byte_dump_main_flag_placeholder_d 0x40 + #define byte_dump_main_flag_text_d 0x80 + #define byte_dump_main_flag_unicode_d 0x100 + #define byte_dump_main_flag_version_d 0x200 + #define byte_dump_main_flag_version_copyright_help_d 0x20a + #define byte_dump_main_flag_wide_d 0x400 +#endif // _di_byte_dump_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * byte_dump_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_byte_dump_print_flag_d_ + #define byte_dump_print_flag_none_d 0x0 + #define byte_dump_print_flag_debug_d 0x1 + #define byte_dump_print_flag_error_d 0x2 + #define byte_dump_print_flag_file_d 0x4 + #define byte_dump_print_flag_in_d 0x8 + #define byte_dump_print_flag_out_d 0x10 + #define byte_dump_print_flag_message_d 0x20 + #define byte_dump_print_flag_warning_d 0x40 +#endif // _di_byte_dump_print_flag_d_ + +/** * The program signal defines. * * byte_dump_signal_*_d: diff --git a/level_3/byte_dump/c/main/common/enumeration.h b/level_3/byte_dump/c/main/common/enumeration.h index fc34ee7..f5f3185 100644 --- a/level_3/byte_dump/c/main/common/enumeration.h +++ b/level_3/byte_dump/c/main/common/enumeration.h @@ -57,42 +57,6 @@ extern "C" { #endif // _di_byte_dump_presentations_e_ /** - * Flags passed to the main function or program. - * - * byte_dump_main_flag_*_e: - * - none: No flags set. - * - classic: Classic is specified. - * - copyright: Print the copyright. - * - first: The first position is specified. - * - help: Print help. - * - last: The last position is specified. - * - placeholder: Placeholder is specified. - * - pipe: Use the input pipe. - * - text: Text is specified. - * - unicode: Unicode is specified. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - wide: Wide option is specified for printing wide. - */ -#ifndef _di_byte_dump_main_flag_e_ - enum { - byte_dump_main_flag_none_e = 0x0, - byte_dump_main_flag_classic_e = 0x1, - byte_dump_main_flag_copyright_e = 0x2, - byte_dump_main_flag_first_e = 0x4, - byte_dump_main_flag_help_e = 0x8, - byte_dump_main_flag_last_e = 0x10, - byte_dump_main_flag_pipe_e = 0x20, - byte_dump_main_flag_placeholder_e = 0x40, - byte_dump_main_flag_text_e = 0x80, - byte_dump_main_flag_unicode_e = 0x100, - byte_dump_main_flag_version_e = 0x200, - byte_dump_main_flag_version_copyright_help_e = 0x20a, - byte_dump_main_flag_wide_e = 0x400, - }; // enum -#endif // _di_byte_dump_main_flag_e_ - -/** * The program parameters. * * byte_dump_parameter_*_e: @@ -167,31 +131,6 @@ extern "C" { #define byte_dump_parameter_total_d (f_console_parameter_state_type_total_d + 16) #endif // _di_byte_dump_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * byte_dump_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_byte_dump_print_flag_e_ - enum { - byte_dump_print_flag_none_e = 0x0, - byte_dump_print_flag_debug_e = 0x1, - byte_dump_print_flag_error_e = 0x2, - byte_dump_print_flag_file_e = 0x4, - byte_dump_print_flag_in_e = 0x8, - byte_dump_print_flag_out_e = 0x10, - byte_dump_print_flag_message_e = 0x20, - byte_dump_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_byte_dump_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/byte_dump/c/main/common/type.h b/level_3/byte_dump/c/main/common/type.h index 072b0ba..a11da68 100644 --- a/level_3/byte_dump/c/main/common/type.h +++ b/level_3/byte_dump/c/main/common/type.h @@ -99,7 +99,7 @@ extern "C" { #define byte_dump_setting_t_initialize \ { \ - byte_dump_main_flag_none_e, \ + byte_dump_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ 0, \ diff --git a/level_3/byte_dump/c/main/main.c b/level_3/byte_dump/c/main/main.c index d82f9ff..2e59733 100644 --- a/level_3/byte_dump/c/main/main.c +++ b/level_3/byte_dump/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { byte_dump_main_t data = byte_dump_main_t_initialize; - data.program.debug.flag |= byte_dump_print_flag_debug_e | byte_dump_print_flag_out_e; - data.program.error.flag |= byte_dump_print_flag_error_e | byte_dump_print_flag_out_e; - data.program.output.flag |= byte_dump_print_flag_out_e; - data.program.message.flag |= byte_dump_print_flag_message_e | byte_dump_print_flag_out_e; - data.program.warning.flag |= byte_dump_print_flag_warning_e | byte_dump_print_flag_out_e; + data.program.debug.flag |= byte_dump_print_flag_debug_d | byte_dump_print_flag_out_d; + data.program.error.flag |= byte_dump_print_flag_error_d | byte_dump_print_flag_out_d; + data.program.output.flag |= byte_dump_print_flag_out_d; + data.program.message.flag |= byte_dump_print_flag_message_d | byte_dump_print_flag_out_d; + data.program.warning.flag |= byte_dump_print_flag_warning_d | byte_dump_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/byte_dump/c/main/print/data.c b/level_3/byte_dump/c/main/print/data.c index 90a37b0..8f7f764 100644 --- a/level_3/byte_dump/c/main/print/data.c +++ b/level_3/byte_dump/c/main/print/data.c @@ -38,13 +38,13 @@ extern "C" { // Pad the buffer with spaces to hide any skipped bytes (skipped via --first). while (offset_to_print && cell->column < main->setting.width) { - f_print_dynamic_raw(byte_dump_padding_s[(main->setting.flag & byte_dump_main_flag_unicode_e) ? 0 : main->setting.mode], print->to); + f_print_dynamic_raw(byte_dump_padding_s[(main->setting.flag & byte_dump_main_flag_unicode_d) ? 0 : main->setting.mode], print->to); --offset_to_print; ++cell->column; if (cell->column < main->setting.width) { - if ((main->setting.flag & byte_dump_main_flag_unicode_e) || main->setting.mode == byte_dump_mode_binary_e) { + if ((main->setting.flag & byte_dump_main_flag_unicode_d) || main->setting.mode == byte_dump_mode_binary_e) { if (!(cell->column % 4)) { f_print_dynamic_raw(f_string_space_s, print->to); } @@ -65,7 +65,7 @@ extern "C" { } if (cell->column < main->setting.width) { - if ((main->setting.flag & byte_dump_main_flag_unicode_e) && !invalid[current]) { + if ((main->setting.flag & byte_dump_main_flag_unicode_d) && !invalid[current]) { if (byte_current == 1) { uint32_t unicode = 0; @@ -111,7 +111,7 @@ extern "C" { } else { if (main->setting.mode == byte_dump_mode_hexidecimal_e) { - if (main->setting.flag & byte_dump_main_flag_unicode_e) { + if (main->setting.flag & byte_dump_main_flag_unicode_d) { f_print_dynamic_raw(byte_dump_padding_6_s, print->to); } @@ -123,7 +123,7 @@ extern "C" { } } else if (main->setting.mode == byte_dump_mode_duodecimal_e) { - if (main->setting.flag & byte_dump_main_flag_unicode_e) { + if (main->setting.flag & byte_dump_main_flag_unicode_d) { f_print_dynamic_raw(byte_dump_padding_5_s, print->to); } @@ -135,7 +135,7 @@ extern "C" { } } else if (main->setting.mode == byte_dump_mode_octal_e) { - if (main->setting.flag & byte_dump_main_flag_unicode_e) { + if (main->setting.flag & byte_dump_main_flag_unicode_d) { f_print_dynamic_raw(byte_dump_padding_5_s, print->to); } @@ -155,7 +155,7 @@ extern "C" { } } else if (main->setting.mode == byte_dump_mode_decimal_e) { - if (main->setting.flag & byte_dump_main_flag_unicode_e) { + if (main->setting.flag & byte_dump_main_flag_unicode_d) { f_print_dynamic_raw(byte_dump_padding_5_s, print->to); } @@ -180,7 +180,7 @@ extern "C" { reset = F_true; - if (main->setting.flag & byte_dump_main_flag_text_e) { + if (main->setting.flag & byte_dump_main_flag_text_d) { byte_dump_print_text(print, sequence, invalid, previous, offset); } else { @@ -200,7 +200,7 @@ extern "C" { } } else { - if ((main->setting.flag & byte_dump_main_flag_unicode_e) || main->setting.mode == byte_dump_mode_binary_e) { + if ((main->setting.flag & byte_dump_main_flag_unicode_d) || main->setting.mode == byte_dump_mode_binary_e) { if (!(cell->column % 4)) { f_print_dynamic_raw(f_string_space_s, print->to); } @@ -239,12 +239,12 @@ extern "C" { fl_print_format(" %[%r%] ", print->to, print->set->notable, byte_dump_character_wall_s, print->set->notable); if (*offset) { - if (main->setting.flag & byte_dump_main_flag_classic_e) { + if (main->setting.flag & byte_dump_main_flag_classic_d) { while (*offset && at < main->setting.width) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } @@ -253,12 +253,12 @@ extern "C" { } // while } else { - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { for (; *offset && at < main->setting.width; --(*offset), ++at) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->warning, byte_dump_character_placeholder_s, print->set->warning); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_space_s, print->to); } } // for @@ -268,7 +268,7 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_space_s, print->to); } } // for @@ -285,20 +285,20 @@ extern "C" { } if (previous->bytes) { - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { for (; at < previous->bytes && at < main->setting.width; ++at) { if (previous->invalid) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_placeholder_s, print->set->error); } - else if (main->setting.flag & byte_dump_main_flag_classic_e) { + else if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->warning, byte_dump_character_placeholder_s, print->set->warning); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } // for @@ -308,7 +308,7 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_space_s, print->to); } } // for @@ -332,7 +332,7 @@ extern "C" { if (invalid[i]) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_incomplete_s, print->set->error); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } @@ -372,7 +372,7 @@ extern "C" { fl_print_format("%]%]", print->to, print->set->warning, print->set->notable); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { if (f_utf_character_is_wide(sequence.string[i]) != F_true) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } @@ -410,20 +410,20 @@ extern "C" { } } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } } else if (f_utf_character_is_whitespace(sequence.string[i], F_true) == F_true) { - if (main->setting.flag & byte_dump_main_flag_classic_e) { + if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { fl_print_format(f_string_format_r_double_s.string, print->to, print->set->notable, print->set->warning, f_print_sequence_space_s, print->set->warning, print->set->notable); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } @@ -431,14 +431,14 @@ extern "C" { if (main->setting.presentation == byte_dump_presentation_classic_e) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } - else if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + else if (main->setting.flag & byte_dump_main_flag_placeholder_d) { fl_print_format(f_string_format_r_double_s.string, print->to, print->set->notable, print->set->warning, byte_dump_character_placeholder_s, print->set->warning, print->set->notable); } else { f_print_dynamic_raw(f_string_space_s, print->to); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } @@ -517,14 +517,14 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { if (width_utf == 1 || f_utf_character_is_wide(sequence.string[i]) != F_true) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } } else { - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } @@ -532,18 +532,18 @@ extern "C" { else { f_print_character(c, print->to); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } // Print placeholders when using UTF-8 sequence to simulate the spaces bytes used for the character. if (width_utf > 1 && at + 1 < main->setting.width) { - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { if (invalid[i]) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_placeholder_s, print->set->error); } - else if (main->setting.flag & byte_dump_main_flag_classic_e) { + else if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { @@ -554,18 +554,18 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } ++at; if (width_utf > 2 && at + 1 < main->setting.width) { - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { if (invalid[i]) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_placeholder_s, print->set->error); } - else if (main->setting.flag & byte_dump_main_flag_classic_e) { + else if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { @@ -576,18 +576,18 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } ++at; if (width_utf > 3 && at + 1 < main->setting.width) { - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { if (invalid[i]) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_placeholder_s, print->set->error); } - else if (main->setting.flag & byte_dump_main_flag_classic_e) { + else if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { @@ -598,7 +598,7 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } @@ -609,20 +609,20 @@ extern "C" { } // for // Print placeholder for the remaining parts of the line. - if (main->setting.flag & byte_dump_main_flag_placeholder_e) { + if (main->setting.flag & byte_dump_main_flag_placeholder_d) { for (; at < main->setting.width; ++at) { if (invalid[at]) { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->error, byte_dump_character_placeholder_s, print->set->error); } - else if (main->setting.flag & byte_dump_main_flag_classic_e) { + else if (main->setting.flag & byte_dump_main_flag_classic_d) { f_print_dynamic_raw(f_string_ascii_period_s, print->to); } else { fl_print_format(f_string_format_r_single_s.string, print->to, print->set->warning, byte_dump_character_placeholder_s, print->set->warning); } - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_ascii_space_s, print->to); } } // for @@ -632,7 +632,7 @@ extern "C" { f_print_dynamic_raw(f_string_space_s, print->to); - if (main->setting.flag & byte_dump_main_flag_wide_e) { + if (main->setting.flag & byte_dump_main_flag_wide_d) { f_print_dynamic_raw(f_string_space_s, print->to); } } // for diff --git a/level_3/byte_dump/c/main/process.c b/level_3/byte_dump/c/main/process.c index 083a1df..cb9366d 100644 --- a/level_3/byte_dump/c/main/process.c +++ b/level_3/byte_dump/c/main/process.c @@ -241,12 +241,12 @@ extern "C" { if (cell.column && cell.column < main->setting.width) { while (cell.column < main->setting.width) { - f_print_dynamic_raw(byte_dump_padding_s[(main->setting.flag & byte_dump_main_flag_unicode_e) ? 0 : main->setting.mode], main->program.output.to); + f_print_dynamic_raw(byte_dump_padding_s[(main->setting.flag & byte_dump_main_flag_unicode_d) ? 0 : main->setting.mode], main->program.output.to); ++cell.column; if (cell.column < main->setting.width) { - if ((main->setting.flag & byte_dump_main_flag_unicode_e) || main->setting.mode == byte_dump_mode_binary_e) { + if ((main->setting.flag & byte_dump_main_flag_unicode_d) || main->setting.mode == byte_dump_mode_binary_e) { if (!(cell.column % 4)) { f_print_dynamic_raw(f_string_space_s, main->program.output.to); } @@ -264,7 +264,7 @@ extern "C" { } } // while - if (main->setting.flag & byte_dump_main_flag_text_e) { + if (main->setting.flag & byte_dump_main_flag_text_d) { byte_dump_print_text(&main->program.output, sequence, invalid, &previous, &offset); } else { diff --git a/level_3/example/c/main/common.c b/level_3/example/c/main/common.c index 5855876..f2c9313 100644 --- a/level_3/example/c/main/common.c +++ b/level_3/example/c/main/common.c @@ -38,28 +38,28 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= example_main_flag_help_e; + main->setting.flag |= example_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= example_main_flag_version_e; + main->setting.flag |= example_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= example_main_flag_copyright_e; + main->setting.flag |= example_main_flag_copyright_d; return; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= example_main_flag_pipe_e; + main->setting.flag |= example_main_flag_pipe_d; } else { - main->setting.flag &= ~example_main_flag_pipe_e; + main->setting.flag &= ~example_main_flag_pipe_d; } } #endif // _di_example_setting_load_ diff --git a/level_3/example/c/main/common/define.h b/level_3/example/c/main/common/define.h index 87e15d1..1ead0dc 100644 --- a/level_3/example/c/main/common/define.h +++ b/level_3/example/c/main/common/define.h @@ -33,6 +33,57 @@ extern "C" { #endif // _di_example_allocation_d_ /** + * Flags passed to the main function or program. + * + * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode). + * + * example_main_flag_*_d: + * - none: No flags set. + * - copyright: Print copyright. + * - error: Check if status is "error". + * - fine: Check if status is "fine". + * - help: Print help. + * - pipe: Use the input pipe. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + * - warning: Check if status is "warning". + */ +#ifndef _di_example_main_flag_d_ + #define example_main_flag_none_d 0x0 + #define example_main_flag_copyright_d 0x1 + #define example_main_flag_error_d 0x2 + #define example_main_flag_fine_d 0x4 + #define example_main_flag_help_d 0x8 + #define example_main_flag_pipe_d 0x10 + #define example_main_flag_version_d 0x20 + #define example_main_flag_version_copyright_help_d 0x29 + #define example_main_flag_warning_d 0x40 +#endif // _di_example_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * example_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_example_print_flag_d_ + #define example_print_flag_none_d 0x0 + #define example_print_flag_debug_d 0x1 + #define example_print_flag_error_d 0x2 + #define example_print_flag_file_d 0x4 + #define example_print_flag_in_d 0x8 + #define example_print_flag_out_d 0x10 + #define example_print_flag_message_d 0x20 + #define example_print_flag_warning_d 0x40 +#endif // _di_example_print_flag_d_ + +/** * The program signal defines. * * example_signal_*_d: diff --git a/level_3/example/c/main/common/enumeration.h b/level_3/example/c/main/common/enumeration.h index b081409..8882b5f 100644 --- a/level_3/example/c/main/common/enumeration.h +++ b/level_3/example/c/main/common/enumeration.h @@ -17,36 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode). - * - * example_main_flag_*_e: - * - none: No flags set. - * - copyright: Print copyright. - * - error: Check if status is "error". - * - fine: Check if status is "fine". - * - help: Print help. - * - pipe: Use the input pipe. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - warning: Check if status is "warning". - */ -#ifndef _di_example_main_flag_e_ - enum { - example_main_flag_none_e = 0x0, - example_main_flag_copyright_e = 0x1, - example_main_flag_error_e = 0x2, - example_main_flag_fine_e = 0x4, - example_main_flag_help_e = 0x8, - example_main_flag_pipe_e = 0x10, - example_main_flag_version_e = 0x20, - example_main_flag_version_copyright_help_e = 0x29, - example_main_flag_warning_e = 0x40, - }; // enum -#endif // _di_example_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_example_parameter_e_ @@ -64,31 +34,6 @@ extern "C" { #define example_parameter_total_d (f_console_parameter_state_type_total_d + 1) #endif // _di_example_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * example_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_example_print_flag_e_ - enum { - example_print_flag_none_e = 0x0, - example_print_flag_debug_e = 0x1, - example_print_flag_error_e = 0x2, - example_print_flag_file_e = 0x4, - example_print_flag_in_e = 0x8, - example_print_flag_out_e = 0x10, - example_print_flag_message_e = 0x20, - example_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_example_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/example/c/main/common/type.h b/level_3/example/c/main/common/type.h index dde2a81..162c28f 100644 --- a/level_3/example/c/main/common/type.h +++ b/level_3/example/c/main/common/type.h @@ -56,7 +56,7 @@ extern "C" { #define example_setting_t_initialize \ { \ - example_main_flag_none_e, \ + example_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ 0, \ diff --git a/level_3/example/c/main/example.c b/level_3/example/c/main/example.c index d5e0afb..ee4994d 100644 --- a/level_3/example/c/main/example.c +++ b/level_3/example/c/main/example.c @@ -11,14 +11,14 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & example_main_flag_version_copyright_help_e) { - if (main->setting.flag & example_main_flag_help_e) { + if (main->setting.flag & example_main_flag_version_copyright_help_d) { + if (main->setting.flag & example_main_flag_help_d) { example_print_message_help(&main->program.message); } - else if (main->setting.flag & example_main_flag_version_e) { + else if (main->setting.flag & example_main_flag_version_d) { fll_program_print_version(&main->program.message, example_program_version_s); } - else if (main->setting.flag & example_main_flag_copyright_e) { + else if (main->setting.flag & example_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } diff --git a/level_3/example/c/main/main.c b/level_3/example/c/main/main.c index 48bbe86..b3d41d2 100644 --- a/level_3/example/c/main/main.c +++ b/level_3/example/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { example_main_t data = example_main_t_initialize; - data.program.debug.flag |= example_print_flag_debug_e | example_print_flag_out_e; - data.program.error.flag |= example_print_flag_error_e | example_print_flag_out_e; - data.program.output.flag |= example_print_flag_out_e; - data.program.message.flag |= example_print_flag_message_e | example_print_flag_out_e; - data.program.warning.flag |= example_print_flag_warning_e | example_print_flag_out_e; + data.program.debug.flag |= example_print_flag_debug_d | example_print_flag_out_d; + data.program.error.flag |= example_print_flag_error_d | example_print_flag_out_d; + data.program.output.flag |= example_print_flag_out_d; + data.program.message.flag |= example_print_flag_message_d | example_print_flag_out_d; + data.program.warning.flag |= example_print_flag_warning_d | example_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 1f7b893..a1f87b3 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -162,7 +162,7 @@ extern "C" { main->cache_recurse_do.action = &fake_do_copy_action; main->cache_recurse_do.handle = &fake_do_copy_handle; main->cache_recurse_do.state.custom = (void *) &local; - main->cache_recurse_do.state.code = fake_state_code_local_e; + main->cache_recurse_do.state.code = fake_state_code_local_d; main->cache_recurse_do.flag = f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_before_e | f_directory_recurse_do_flag_after_e; main->cache_recurse_do.mode = mode; diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index d5aed39..f2cac68 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -97,7 +97,7 @@ extern "C" { if (build_arguments && build_arguments->used) { path_file.used = data->path_data_build.used + build_arguments->array[0].used; } - else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { + else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_d)) { path_file.used = data->file_data_build_settings.used; } else { @@ -112,7 +112,7 @@ extern "C" { memcpy(path_file_string, data->path_data_build.string, sizeof(f_char_t) * data->path_data_build.used); memcpy(path_file_string + data->path_data_build.used, build_arguments->array[0].string, sizeof(f_char_t) * build_arguments->array[0].used); } - else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { + else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_d)) { memcpy(path_file_string, data->file_data_build_settings.string, sizeof(f_char_t) * data->file_data_build_settings.used); } else { @@ -136,7 +136,7 @@ extern "C" { } if (F_status_is_error_not(main->setting.state.status)) { - if (build_arguments && build_arguments->used || !process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { + if (build_arguments && build_arguments->used || !process_pipe || (main->setting.flag & fake_main_flag_operation_d)) { fake_file_buffer(data, path_file, process_pipe ? F_false : F_true, &buffer); } } diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 107ba3a..4008f78 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -48,19 +48,19 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= fake_main_flag_help_e; + main->setting.flag |= fake_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= fake_main_flag_version_e; + main->setting.flag |= fake_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= fake_main_flag_copyright_e; + main->setting.flag |= fake_main_flag_copyright_d; return; } @@ -69,10 +69,10 @@ extern "C" { f_number_unsigned_t index = 0; if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= fake_main_flag_pipe_e; + main->setting.flag |= fake_main_flag_pipe_d; } else { - main->setting.flag &= ~fake_main_flag_pipe_e; + main->setting.flag &= ~fake_main_flag_pipe_d; } { @@ -92,9 +92,9 @@ extern "C" { }; const uint16_t flags[] = { - fake_main_flag_enable_documents_e, - fake_main_flag_enable_shared_e, - fake_main_flag_enable_static_e, + fake_main_flag_enable_documents_d, + fake_main_flag_enable_shared_d, + fake_main_flag_enable_static_d, }; for (; i < 3; ++i) { @@ -373,11 +373,11 @@ extern "C" { } if (main->setting.operations.used) { - main->setting.flag |= fake_main_flag_operation_e; + main->setting.flag |= fake_main_flag_operation_d; } else { - main->setting.flag |= fake_main_flag_operation_make_e; - main->setting.flag &= ~fake_main_flag_operation_e; + main->setting.flag |= fake_main_flag_operation_make_d; + main->setting.flag &= ~fake_main_flag_operation_d; main->setting.state.status = f_memory_array_increase_by(1, sizeof(uint8_t), (void **) &main->setting.operations.array, &main->setting.operations.used, &main->setting.operations.size); @@ -418,25 +418,25 @@ extern "C" { switch (parameter_state->at) { case fake_parameter_operation_build_e: data->main->setting.operations.array[data->main->setting.operations.used++] = fake_operation_build_e; - data->main->setting.flag |= fake_main_flag_operation_build_e; + data->main->setting.flag |= fake_main_flag_operation_build_d; break; case fake_parameter_operation_clean_e: data->main->setting.operations.array[data->main->setting.operations.used++] = fake_operation_clean_e; - data->main->setting.flag |= fake_main_flag_operation_clean_e; + data->main->setting.flag |= fake_main_flag_operation_clean_d; break; case fake_parameter_operation_make_e: data->main->setting.operations.array[data->main->setting.operations.used++] = fake_operation_make_e; - data->main->setting.flag |= fake_main_flag_operation_make_e; + data->main->setting.flag |= fake_main_flag_operation_make_d; break; case fake_parameter_operation_skeleton_e: data->main->setting.operations.array[data->main->setting.operations.used++] = fake_operation_skeleton_e; - data->main->setting.flag |= fake_main_flag_operation_skeleton_e; + data->main->setting.flag |= fake_main_flag_operation_skeleton_d; break; diff --git a/level_3/fake/c/main/common/define.h b/level_3/fake/c/main/common/define.h index 4f2b7d2..deb1608 100644 --- a/level_3/fake/c/main/common/define.h +++ b/level_3/fake/c/main/common/define.h @@ -33,20 +33,48 @@ extern "C" { #endif // _di_fake_allocation_d_ /** - * The program signal defines. + * Flags passed to the main function or program. * - * fake_signal_*_d: - * - check: Number of iterations before performing signal check in non-threaded signal handling. - * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). - * - check_tiny: The tiny check. - * - check_short: The short signal check. + * fake_main_flag_*_d: + * - none: No flags set. + * - copyright: Print copyright. + * - enable_documents: Enable documents, as in --enable-doc (not specifying means --disable-doc). + * - enable_shared: Enable shared, as in --enable-shared (not specifying means --disable-shared). + * - enable_static: Enable static, as in --enable-static (not specifying means --disable-static). + * - header: Enable printing of headers. + * - help: Print help. + * - operation: Designate that an operation is explicitly passed. + * - operation_build: The build operation is designated. + * - operation_clean: The clean operation is designated. + * - operation_make: The make operation is designated (or enabled as default). + * - operation_skeleton: The skeleton operation is designated. + * - pipe: Use the input pipe. + * - separate: Enable printing of separators. + * - strip_invalid: Using strip invalid character mode. + * - verify: Using verify mode. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. */ -#ifndef _di_fake_signal_d_ - #define fake_signal_check_d 500000 - #define fake_signal_check_failsafe_d 20000 - #define fake_signal_check_tiny_d 4 - #define fake_signal_check_short_d 16 -#endif // _di_fake_signal_d_ +#ifndef _di_fake_main_flag_d_ + #define fake_main_flag_none_d 0x0 + #define fake_main_flag_copyright_d 0x1 + #define fake_main_flag_enable_documents_d 0x2 + #define fake_main_flag_enable_shared_d 0x4 + #define fake_main_flag_enable_static_d 0x8 + #define fake_main_flag_header_d 0x10 + #define fake_main_flag_help_d 0x20 + #define fake_main_flag_operation_d 0x40 + #define fake_main_flag_operation_build_d 0x80 + #define fake_main_flag_operation_clean_d 0x100 + #define fake_main_flag_operation_make_d 0x200 + #define fake_main_flag_operation_skeleton_d 0x400 + #define fake_main_flag_pipe_d 0x800 + #define fake_main_flag_separate_d 0x1000 + #define fake_main_flag_strip_invalid_d 0x2000 + #define fake_main_flag_verify_d 0x4000 + #define fake_main_flag_version_d 0x8000 + #define fake_main_flag_version_copyright_help_d 0x8021 +#endif // _di_fake_main_flag_d_ /** * Provide common/generic definitions. @@ -68,6 +96,59 @@ extern "C" { #define fake_max_stack_d 8192 #endif // _di_fake_max_d_ +/** + * Flags for fine-tuned print control. + * + * fake_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_fake_print_flag_d_ + #define fake_print_flag_none_d 0x0 + #define fake_print_flag_debug_d 0x1 + #define fake_print_flag_error_d 0x2 + #define fake_print_flag_file_d 0x4 + #define fake_print_flag_in_d 0x8 + #define fake_print_flag_out_d 0x10 + #define fake_print_flag_message_d 0x20 + #define fake_print_flag_warning_d 0x40 +#endif // _di_fake_print_flag_d_ + +/** + * The program signal defines. + * + * fake_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_fake_signal_d_ + #define fake_signal_check_d 500000 + #define fake_signal_check_failsafe_d 20000 + #define fake_signal_check_tiny_d 4 + #define fake_signal_check_short_d 16 +#endif // _di_fake_signal_d_ + +/** + * Flags for the code property in the f_state_t structure. + * + * fake_state_code_*_d: + * - none: No flags set. + * - clone: Designate that the operation is a clone operation (as opposed to a copy operation). + * - local: Designate that the state.custom is in fake_local_t rather than fake_main_t. + */ +#ifndef _di_fake_state_code_d_ + #define fake_state_code_none_d 0x0 + #define fake_state_code_clone_d 0x1 + #define fake_state_code_local_d 0x2 +#endif // _di_fake_state_code_d_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/common/enumeration.h b/level_3/fake/c/main/common/enumeration.h index b9029a9..4cddfb1 100644 --- a/level_3/fake/c/main/common/enumeration.h +++ b/level_3/fake/c/main/common/enumeration.h @@ -81,52 +81,6 @@ extern "C" { #endif // _di_fake_parameter_e_ /** - * Flags passed to the main function or program. - * - * fake_main_flag_*_e: - * - none: No flags set. - * - copyright: Print copyright. - * - enable_documents: Enable documents, as in --enable-doc (not specifying means --disable-doc). - * - enable_shared: Enable shared, as in --enable-shared (not specifying means --disable-shared). - * - enable_static: Enable static, as in --enable-static (not specifying means --disable-static). - * - header: Enable printing of headers. - * - help: Print help. - * - operation: Designate that an operation is explicitly passed. - * - operation_build: The build operation is designated. - * - operation_clean: The clean operation is designated. - * - operation_make: The make operation is designated (or enabled as default). - * - operation_skeleton: The skeleton operation is designated. - * - pipe: Use the input pipe. - * - separate: Enable printing of separators. - * - strip_invalid: Using strip invalid character mode. - * - verify: Using verify mode. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_fake_main_flag_e_ - enum { - fake_main_flag_none_e = 0x0, - fake_main_flag_copyright_e = 0x1, - fake_main_flag_enable_documents_e = 0x2, - fake_main_flag_enable_shared_e = 0x4, - fake_main_flag_enable_static_e = 0x8, - fake_main_flag_header_e = 0x10, - fake_main_flag_help_e = 0x20, - fake_main_flag_operation_e = 0x40, - fake_main_flag_operation_build_e = 0x80, - fake_main_flag_operation_clean_e = 0x100, - fake_main_flag_operation_make_e = 0x200, - fake_main_flag_operation_skeleton_e = 0x400, - fake_main_flag_pipe_e = 0x800, - fake_main_flag_separate_e = 0x1000, - fake_main_flag_strip_invalid_e = 0x2000, - fake_main_flag_verify_e = 0x4000, - fake_main_flag_version_e = 0x8000, - fake_main_flag_version_copyright_help_e = 0x8021, - }; // enum -#endif // _di_fake_main_flag_e_ - -/** * The program operation enumerations. * * fake_operation_*_e: @@ -344,47 +298,6 @@ extern "C" { }; // enum #endif // _di_fake_condition_result_e_ -/** - * Flags for fine-tuned print control. - * - * fake_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_fake_print_flag_e_ - enum { - fake_print_flag_none_e = 0x0, - fake_print_flag_debug_e = 0x1, - fake_print_flag_error_e = 0x2, - fake_print_flag_file_e = 0x4, - fake_print_flag_in_e = 0x8, - fake_print_flag_out_e = 0x10, - fake_print_flag_message_e = 0x20, - fake_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_fake_print_flag_e_ - -/** - * Flags for the code property in the f_state_t structure. - * - * fake_state_code_*_e: - * - none: No flags set. - * - clone: Designate that the operation is a clone operation (as opposed to a copy operation). - * - local: Designate that the state.custom is in fake_local_t rather than fake_main_t. - */ -#ifndef _di_fake_state_code_e_ - enum { - fake_state_code_none_e = 0x0, - fake_state_code_clone_e = 0x1, - fake_state_code_local_e = 0x2, - }; // enum -#endif // _di_fake_state_code_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index fb848b9..c2355b0 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -11,21 +11,21 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & fake_main_flag_version_copyright_help_e) { - if (main->setting.flag & fake_main_flag_help_e) { + if (main->setting.flag & fake_main_flag_version_copyright_help_d) { + if (main->setting.flag & fake_main_flag_help_d) { fake_print_message_help(&main->program.message); } - else if (main->setting.flag & fake_main_flag_version_e) { + else if (main->setting.flag & fake_main_flag_version_d) { fll_program_print_version(&main->program.message, fake_program_version_s); } - else if (main->setting.flag & fake_main_flag_copyright_e) { + else if (main->setting.flag & fake_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if ((main->setting.flag & fake_main_flag_operation_build_e) && (main->setting.flag & fake_main_flag_operation_make_e)) { + if ((main->setting.flag & fake_main_flag_operation_build_d) && (main->setting.flag & fake_main_flag_operation_make_d)) { main->setting.state.status = F_status_set_error(F_parameter); fake_print_error_parameter_operation_not_with(&main->program.error, fake_other_operation_build_s, fake_other_operation_make_s); @@ -44,7 +44,7 @@ extern "C" { return; } - if ((main->program.pipe & fll_program_data_pipe_input_e) && !(main->setting.flag & fake_main_flag_operation_e)) { + if ((main->program.pipe & fll_program_data_pipe_input_e) && !(main->setting.flag & fake_main_flag_operation_d)) { data.file_data_build_fakefile.used = 0; main->setting.state.status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile); diff --git a/level_3/fake/c/main/fake/do.c b/level_3/fake/c/main/fake/do.c index d63fd38..efbc860 100644 --- a/level_3/fake/c/main/fake/do.c +++ b/level_3/fake/c/main/fake/do.c @@ -25,7 +25,7 @@ extern "C" { if (flag & f_directory_recurse_do_flag_before_e) { if (flag & f_directory_recurse_do_flag_top_e) { - if (recurse->state.code & fake_state_code_clone_e) { + if (recurse->state.code & fake_state_code_clone_d) { fake_print_verbose_cloning(&local->main->program.message, *recurse->path_top, map->key); recurse->state.status = f_file_clone(*recurse->path_top, map->key, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); @@ -39,7 +39,7 @@ extern "C" { if (F_status_is_error(recurse->state.status)) { local->main->setting.state.status = recurse->state.status; - fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_e) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), *recurse->path_top, (recurse->state.code & fake_state_code_clone_e) ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); + fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_d) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), *recurse->path_top, (recurse->state.code & fake_state_code_clone_d) ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); // Save the error status for when the error message is printed. *((f_status_t *) local->custom_2) = recurse->state.status; @@ -83,7 +83,7 @@ extern "C" { if (F_status_is_error(recurse->state.status)) return; - if (recurse->state.code & fake_state_code_clone_e) { + if (recurse->state.code & fake_state_code_clone_d) { fake_print_verbose_cloning(&local->main->program.message, recurse->path, recurse->path_cache); recurse->state.status = f_file_clone(recurse->path, recurse->path_cache, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); @@ -97,7 +97,7 @@ extern "C" { if (F_status_is_error(recurse->state.status)) { local->main->setting.state.status = recurse->state.status; - fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_e) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), recurse->path, (recurse->state.code & fake_state_code_clone_e) ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); + fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_d) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), recurse->path, (recurse->state.code & fake_state_code_clone_d) ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); // Save the error status for when the error message is printed. *((f_status_t *) local->custom_2) = recurse->state.status; @@ -143,7 +143,7 @@ extern "C" { if (F_status_is_error(recurse->state.status)) return; - if (recurse->state.code & fake_state_code_clone_e) { + if (recurse->state.code & fake_state_code_clone_d) { fake_print_verbose_cloning(&local->main->program.message, recurse->path, map->value); recurse->state.status = f_file_clone(recurse->path, map->value, F_file_default_size_write_d, f_file_stat_flag_group_e | f_file_stat_flag_owner_e | (f_directory_recurse_do_flag_dereference_e ? 0 : f_file_stat_flag_reference_e)); @@ -157,7 +157,7 @@ extern "C" { if (F_status_is_error(recurse->state.status)) { local->main->setting.state.status = recurse->state.status; - fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_e) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), map->value, f_file_operation_create_s, (flag & f_directory_recurse_do_flag_directory_e) ? fll_error_file_type_directory_e : fll_error_file_type_file_e); + fake_print_error_file(&local->main->program.error, (recurse->state.code & fake_state_code_clone_d) ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), map->value, f_file_operation_create_s, (flag & f_directory_recurse_do_flag_directory_e) ? fll_error_file_type_directory_e : fll_error_file_type_file_e); // Save the error status for when the error message is printed. *((f_status_t *) local->custom_2) = recurse->state.status; @@ -184,7 +184,7 @@ extern "C" { if (F_status_is_error_not(*((f_status_t *) local->custom_2))) { local->main->setting.state.status = recurse->state.status; - fake_print_error_build_operation_file(&local->main->program.error, macro_fake_f(fl_directory_do), (recurse->state.code & fake_state_code_clone_e) ? f_file_operation_clone_s : f_file_operation_copy_s, *recurse->path_top, recurse->path_cache, f_file_operation_to_s, F_true); + fake_print_error_build_operation_file(&local->main->program.error, macro_fake_f(fl_directory_do), (recurse->state.code & fake_state_code_clone_d) ? f_file_operation_clone_s : f_file_operation_copy_s, *recurse->path_top, recurse->path_cache, f_file_operation_to_s, F_true); *((f_status_t *) local->custom_2) = recurse->state.status; } diff --git a/level_3/fake/c/main/fake/do.h b/level_3/fake/c/main/fake/do.h index d042939..0d8e099 100644 --- a/level_3/fake/c/main/fake/do.h +++ b/level_3/fake/c/main/fake/do.h @@ -26,8 +26,8 @@ extern "C" { * Must be of type f_directory_recurse_do_t. * * The recurse.state.code relevant flags: - * - fake_state_code_clone_e: Designate that this is a clone instead of copy. - * - fake_state_code_local_e: This is required and assumed to be set. + * - fake_state_code_clone_d: Designate that this is a clone instead of copy. + * - fake_state_code_local_d: This is required and assumed to be set. * * This alters recurse.state.custom.main.setting.state.status and recurse.state.status: * F_okay on success. @@ -66,8 +66,8 @@ extern "C" { * Must be of type f_directory_recurse_do_t. * * The recurse.state.code relevant flags: - * - fake_state_code_clone_e: Designate that this is a clone instead of copy. - * - fake_state_code_local_e: This is required and assumed to be set. + * - fake_state_code_clone_d: Designate that this is a clone instead of copy. + * - fake_state_code_local_d: This is required and assumed to be set. * * This alters recurse.state.custom.main.setting.state.status: * Assigns value from recurse.state.status. diff --git a/level_3/fake/c/main/main.c b/level_3/fake/c/main/main.c index d403121..15bd06d 100644 --- a/level_3/fake/c/main/main.c +++ b/level_3/fake/c/main/main.c @@ -4,24 +4,24 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fake_main_t data = fake_main_t_initialize; - data.program.debug.flag |= fake_print_flag_debug_e | fake_print_flag_out_e; - data.program.error.flag |= fake_print_flag_error_e | fake_print_flag_out_e; - data.program.output.flag |= fake_print_flag_out_e; - data.program.message.flag |= fake_print_flag_message_e | fake_print_flag_out_e; - data.program.warning.flag |= fake_print_flag_warning_e | fake_print_flag_out_e; + data.program.debug.flag |= fake_print_flag_debug_d | fake_print_flag_out_d; + data.program.error.flag |= fake_print_flag_error_d | fake_print_flag_out_d; + data.program.output.flag |= fake_print_flag_out_d; + data.program.message.flag |= fake_print_flag_message_d | fake_print_flag_out_d; + data.program.warning.flag |= fake_print_flag_warning_d | fake_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fake_main_flag_enable_documents_e; - data.setting.flag |= fake_main_flag_enable_shared_e; - data.setting.flag |= fake_main_flag_enable_static_e; + data.setting.flag |= fake_main_flag_enable_documents_d; + data.setting.flag |= fake_main_flag_enable_shared_d; + data.setting.flag |= fake_main_flag_enable_static_d; data.setting.state.step_large = fake_allocation_large_d; data.setting.state.step_small = fake_allocation_small_d; data.setting.state.custom = (void *) &data; - data.setting.state.code = fake_state_code_none_e; + data.setting.state.code = fake_state_code_none_d; data.setting.state.interrupt = &fake_signal_handler_callback; f_console_parameter_t parameters[] = fake_console_parameter_t_initialize; diff --git a/level_3/fake/c/main/make/operate_process_type.c b/level_3/fake/c/main/make/operate_process_type.c index 5b93acb..2242a66 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -216,11 +216,11 @@ extern "C" { main->cache_recurse_do.action = &fake_do_copy_action; main->cache_recurse_do.handle = &fake_do_copy_handle; main->cache_recurse_do.state.custom = (void *) &local; - main->cache_recurse_do.state.code = fake_state_code_local_e; + main->cache_recurse_do.state.code = fake_state_code_local_d; main->cache_recurse_do.flag = f_directory_recurse_do_flag_top_e | f_directory_recurse_do_flag_before_e | f_directory_recurse_do_flag_after_e; if (clone) { - main->cache_recurse_do.state.code |= fake_state_code_clone_e; + main->cache_recurse_do.state.code |= fake_state_code_clone_d; } else { macro_f_mode_t_set_default_umask(main->cache_recurse_do.mode, main->program.umask); diff --git a/level_3/fake/c/main/signal.c b/level_3/fake/c/main/signal.c index f2188d6..d801843 100644 --- a/level_3/fake/c/main/signal.c +++ b/level_3/fake/c/main/signal.c @@ -117,7 +117,7 @@ extern "C" { return; } - fake_main_t * const main = (state->code & fake_state_code_local_e) + fake_main_t * const main = (state->code & fake_state_code_local_d) ? ((fake_local_t *) state->custom)->main : (fake_main_t *) state->custom; diff --git a/level_3/fake/c/main/signal.h b/level_3/fake/c/main/signal.h index 16ec740..0c3b7c4 100644 --- a/level_3/fake/c/main/signal.h +++ b/level_3/fake/c/main/signal.h @@ -85,8 +85,8 @@ extern "C" { * @param state * The f_state_t data. * - * The state.custom must be fake_main_t, except for when the code has the bit fake_state_code_local_e. - * When the fake_state_code_local_e bit is set, then the state.custum must be fake_local_t. + * The state.custom must be fake_main_t, except for when the code has the bit fake_state_code_local_d. + * When the fake_state_code_local_d bit is set, then the state.custum must be fake_local_t. * * This alters state.status: * F_interrupt_not if not interrupted. diff --git a/level_3/firewall/c/main/common.c b/level_3/firewall/c/main/common.c index 787dfc6..1bc476b 100644 --- a/level_3/firewall/c/main/common.c +++ b/level_3/firewall/c/main/common.c @@ -38,19 +38,19 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= firewall_main_flag_help_e; + main->setting.flag |= firewall_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= firewall_main_flag_version_e; + main->setting.flag |= firewall_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= firewall_main_flag_copyright_e; + main->setting.flag |= firewall_main_flag_copyright_d; return; } @@ -58,56 +58,56 @@ extern "C" { f_number_unsigned_t index = 0; if (main->program.parameters.array[firewall_parameter_operation_start_e].result & f_console_result_found_e) { - main->setting.flag &= ~firewall_main_flag_operation_e; - main->setting.flag |= firewall_main_flag_operation_start_e; + main->setting.flag &= ~firewall_main_flag_operation_d; + main->setting.flag |= firewall_main_flag_operation_start_d; index = main->program.parameters.array[firewall_parameter_operation_start_e].location; } if (main->program.parameters.array[firewall_parameter_operation_stop_e].result & f_console_result_found_e) { - if (!(main->setting.flag & firewall_main_flag_operation_e) || main->program.parameters.array[firewall_parameter_operation_stop_e].location > index) { - main->setting.flag &= ~firewall_main_flag_operation_e; - main->setting.flag |= firewall_main_flag_operation_stop_e; + if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_stop_e].location > index) { + main->setting.flag &= ~firewall_main_flag_operation_d; + main->setting.flag |= firewall_main_flag_operation_stop_d; index = main->program.parameters.array[firewall_parameter_operation_stop_e].location; } } if (main->program.parameters.array[firewall_parameter_operation_restart_e].result & f_console_result_found_e) { - if (!(main->setting.flag & firewall_main_flag_operation_e) || main->program.parameters.array[firewall_parameter_operation_restart_e].location > index) { - main->setting.flag &= ~firewall_main_flag_operation_e; - main->setting.flag |= firewall_main_flag_operation_restart_e; + if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_restart_e].location > index) { + main->setting.flag &= ~firewall_main_flag_operation_d; + main->setting.flag |= firewall_main_flag_operation_restart_d; index = main->program.parameters.array[firewall_parameter_operation_restart_e].location; } } if (main->program.parameters.array[firewall_parameter_operation_lock_e].result & f_console_result_found_e) { - if (!(main->setting.flag & firewall_main_flag_operation_e) || main->program.parameters.array[firewall_parameter_operation_lock_e].location > index) { - main->setting.flag &= ~firewall_main_flag_operation_e; - main->setting.flag |= firewall_main_flag_operation_lock_e; + if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_lock_e].location > index) { + main->setting.flag &= ~firewall_main_flag_operation_d; + main->setting.flag |= firewall_main_flag_operation_lock_d; index = main->program.parameters.array[firewall_parameter_operation_lock_e].location; } } if (main->program.parameters.array[firewall_parameter_operation_show_e].result & f_console_result_found_e) { - if (!(main->setting.flag & firewall_main_flag_operation_e) || main->program.parameters.array[firewall_parameter_operation_show_e].location > index) { - main->setting.flag &= ~firewall_main_flag_operation_e; - main->setting.flag |= firewall_main_flag_operation_show_e; + if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_show_e].location > index) { + main->setting.flag &= ~firewall_main_flag_operation_d; + main->setting.flag |= firewall_main_flag_operation_show_d; } } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= firewall_main_flag_pipe_e; + main->setting.flag |= firewall_main_flag_pipe_d; } else { - main->setting.flag &= ~firewall_main_flag_pipe_e; + main->setting.flag &= ~firewall_main_flag_pipe_d; } - if (main->setting.flag & firewall_main_flag_operation_show_e) { + if (main->setting.flag & firewall_main_flag_operation_show_d) { if (main->program.parameters.remaining.used) { - main->setting.flag &= ~firewall_main_flag_operation_show_filter_nat_mangle_e; + main->setting.flag &= ~firewall_main_flag_operation_show_filter_nat_mangle_d; for (f_number_unsigned_t i = 0; i < main->program.parameters.remaining.used; ++i) { @@ -116,13 +116,13 @@ extern "C" { index = main->program.parameters.remaining.array[i]; if (f_compare_dynamic(firewall_show_nat_s, main->program.parameters.arguments.array[index]) == F_equal_to) { - main->setting.flag |= firewall_main_flag_operation_show_nat_e; + main->setting.flag |= firewall_main_flag_operation_show_nat_d; } else if (f_compare_dynamic(firewall_show_mangle_s, main->program.parameters.arguments.array[index]) == F_equal_to) { - main->setting.flag |= firewall_main_flag_operation_show_mangle_e; + main->setting.flag |= firewall_main_flag_operation_show_mangle_d; } else if (f_compare_dynamic(firewall_show_filter_s, main->program.parameters.arguments.array[index]) == F_equal_to) { - main->setting.flag |= firewall_main_flag_operation_show_filter_e; + main->setting.flag |= firewall_main_flag_operation_show_filter_d; } else { firewall_print_warning_show_option_unknown(&main->program.warning, main->program.parameters.arguments.array[index]); @@ -130,7 +130,7 @@ extern "C" { } // for } else { - main->setting.flag |= firewall_main_flag_operation_show_filter_nat_mangle_e; + main->setting.flag |= firewall_main_flag_operation_show_filter_nat_mangle_d; } } } diff --git a/level_3/firewall/c/main/common/define.h b/level_3/firewall/c/main/common/define.h index 9045d04..8782633 100644 --- a/level_3/firewall/c/main/common/define.h +++ b/level_3/firewall/c/main/common/define.h @@ -33,6 +33,72 @@ extern "C" { #endif // _di_firewall_allocation_d_ /** + * Flags representing the current state of the processed rule. + * + * firewall_data_is_*_d: + * - none: No flags set. + * - global: The current processed rule is global. + * - local: The current processed rule is lock. + * - main: The current processed rule is main. + * - stop: The current processed rule is stop. + * - stop_main_lock: Helper flag representing main, stop, and lock being set. + */ +#ifndef _di_firewall_data_is_d_ + #define firewall_data_is_none_d 0x0 + #define firewall_data_is_global_d 0x1 + #define firewall_data_is_lock_d 0x2 + #define firewall_data_is_main_d 0x4 + #define firewall_data_is_stop_d 0x8 + #define firewall_data_is_stop_main_lock_d 0xe +#endif // _di_firewall_data_is_d_ + +/** + * Flags passed to the main function or program. + * + * firewall_main_flag_*_d: + * - none: No flags set. + * - copyright: Print copyright. + * - help: Print help. + * - operation: A helper flag representing every operation flag bit being set. + * - operation_lock: Perform the lock operation. + * - operation_restart: Perform the restart operation. + * - operation_show: Perform the show operation. + * - operation_show_nat: For the show operation, show nat. + * - operation_show_mangle: For the show operation, show mangle. + * - operation_show_filter: For the show operation, show filter. + * - operation_show_filter_nat_mangle: A helper flag representing the show nat, show mangle, and short filter flags set. + * - operation_start: Perform the start operation. + * - operation_start_restart: A helper flag representing both the start and restart operation flag set. + * - operation_stop: Perform the stop operation. + * - operation_stop_restart: A helper flag representing both the stop and restart operation flag set. + * - operation_stop_restart_lock: A helper flag representing both the stop, restart, and lock operation flag set. + * - pipe: Use the input pipe. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + */ +#ifndef _di_firewall_main_flag_d_ + #define firewall_main_flag_none_d 0x0 + #define firewall_main_flag_copyright_d 0x1 + #define firewall_main_flag_help_d 0x2 + #define firewall_main_flag_operation_d 0x31c + #define firewall_main_flag_operation_lock_d 0x4 + #define firewall_main_flag_operation_restart_d 0x8 + #define firewall_main_flag_operation_show_d 0x10 + #define firewall_main_flag_operation_show_nat_d 0x20 + #define firewall_main_flag_operation_show_mangle_d 0x40 + #define firewall_main_flag_operation_show_filter_d 0x80 + #define firewall_main_flag_operation_show_filter_nat_mangle_d 0xe0 + #define firewall_main_flag_operation_start_d 0x100 + #define firewall_main_flag_operation_start_restart_d 0x108 + #define firewall_main_flag_operation_stop_d 0x200 + #define firewall_main_flag_operation_stop_restart_d 0x208 + #define firewall_main_flag_operation_stop_restart_lock_d 0x20c + #define firewall_main_flag_pipe_d 0x400 + #define firewall_main_flag_version_d 0x800 + #define firewall_main_flag_version_copyright_help_d 0x803 +#endif // _di_firewall_main_flag_d_ + +/** * The program signal defines. * * firewall_signal_*_d: diff --git a/level_3/firewall/c/main/common/enumeration.h b/level_3/firewall/c/main/common/enumeration.h index 1303a87..8ae581c 100644 --- a/level_3/firewall/c/main/common/enumeration.h +++ b/level_3/firewall/c/main/common/enumeration.h @@ -17,54 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * firewall_main_flag_*_e: - * - none: No flags set. - * - copyright: Print copyright. - * - help: Print help. - * - operation: A helper flag representing every operation flag bit being set. - * - operation_lock: Perform the lock operation. - * - operation_restart: Perform the restart operation. - * - operation_show: Perform the show operation. - * - operation_show_nat: For the show operation, show nat. - * - operation_show_mangle: For the show operation, show mangle. - * - operation_show_filter: For the show operation, show filter. - * - operation_show_filter_nat_mangle: A helper flag representing the show nat, show mangle, and short filter flags set. - * - operation_start: Perform the start operation. - * - operation_start_restart: A helper flag representing both the start and restart operation flag set. - * - operation_stop: Perform the stop operation. - * - operation_stop_restart: A helper flag representing both the stop and restart operation flag set. - * - operation_stop_restart_lock: A helper flag representing both the stop, restart, and lock operation flag set. - * - pipe: Use the input pipe. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_firewall_main_flag_e_ - enum { - firewall_main_flag_none_e = 0x0, - firewall_main_flag_copyright_e = 0x1, - firewall_main_flag_help_e = 0x2, - firewall_main_flag_operation_e = 0x31c, - firewall_main_flag_operation_lock_e = 0x4, - firewall_main_flag_operation_restart_e = 0x8, - firewall_main_flag_operation_show_e = 0x10, - firewall_main_flag_operation_show_nat_e = 0x20, - firewall_main_flag_operation_show_mangle_e = 0x40, - firewall_main_flag_operation_show_filter_e = 0x80, - firewall_main_flag_operation_show_filter_nat_mangle_e = 0xe0, - firewall_main_flag_operation_start_e = 0x100, - firewall_main_flag_operation_start_restart_e = 0x108, - firewall_main_flag_operation_stop_e = 0x200, - firewall_main_flag_operation_stop_restart_e = 0x208, - firewall_main_flag_operation_stop_restart_lock_e = 0x20c, - firewall_main_flag_pipe_e = 0x400, - firewall_main_flag_version_e = 0x800, - firewall_main_flag_version_copyright_help_e = 0x803, - }; // enum -#endif // _di_firewall_main_flag_e_ - -/** * The firewall action. * * firewall_action_*_e: @@ -107,28 +59,6 @@ extern "C" { #endif // _di_firewall_action_e_ /** - * Flags representing the current state of the processed rule. - * - * firewall_data_is_*_e: - * - none: No flags set. - * - global: The current processed rule is global. - * - local: The current processed rule is lock. - * - main: The current processed rule is main. - * - stop: The current processed rule is stop. - * - stop_main_lock: Helper flag representing main, stop, and lock being set. - */ -#ifndef _di_firewall_data_is_e_ - enum { - firewall_data_is_none_e = 0x0, - firewall_data_is_global_e = 0x1, - firewall_data_is_lock_e = 0x2, - firewall_data_is_main_e = 0x4, - firewall_data_is_stop_e = 0x8, - firewall_data_is_stop_main_lock_e = 0xe, - }; // enum -#endif // _di_firewall_data_is_e_ - -/** * Flags representing the existence of reserved sets. * * firewall_data_has_*_e: diff --git a/level_3/firewall/c/main/common/type.h b/level_3/firewall/c/main/common/type.h index b51a7f4..6b1c6b6 100644 --- a/level_3/firewall/c/main/common/type.h +++ b/level_3/firewall/c/main/common/type.h @@ -119,7 +119,7 @@ extern "C" { #define firewall_data_t_initialize \ { \ - firewall_data_is_none_e, \ + firewall_data_is_none_d, \ firewall_data_has_none_e, \ 0, \ 0, \ @@ -166,7 +166,7 @@ extern "C" { #define firewall_setting_t_initialize \ { \ - firewall_main_flag_none_e, \ + firewall_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ f_string_dynamics_t_initialize, \ diff --git a/level_3/firewall/c/main/firewall.c b/level_3/firewall/c/main/firewall.c index 7237dde..dd84c03 100644 --- a/level_3/firewall/c/main/firewall.c +++ b/level_3/firewall/c/main/firewall.c @@ -11,21 +11,21 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & firewall_main_flag_version_copyright_help_e) { - if (main->setting.flag & firewall_main_flag_help_e) { + if (main->setting.flag & firewall_main_flag_version_copyright_help_d) { + if (main->setting.flag & firewall_main_flag_help_d) { firewall_print_message_help(&main->program.message); } - else if (main->setting.flag & firewall_main_flag_version_e) { + else if (main->setting.flag & firewall_main_flag_version_d) { fll_program_print_version(&main->program.message, firewall_program_version_s); } - else if (main->setting.flag & firewall_main_flag_copyright_e) { + else if (main->setting.flag & firewall_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if (main->setting.flag & firewall_main_flag_operation_e) { + if (main->setting.flag & firewall_main_flag_operation_d) { firewall_operate(main); } else { diff --git a/level_3/firewall/c/main/operate.c b/level_3/firewall/c/main/operate.c index 606e634..7497fd7 100644 --- a/level_3/firewall/c/main/operate.c +++ b/level_3/firewall/c/main/operate.c @@ -9,9 +9,9 @@ extern "C" { if (!main) return; - main->data.is = firewall_data_is_global_e; + main->data.is = firewall_data_is_global_d; - if (main->setting.flag & firewall_main_flag_operation_show_e) { + if (main->setting.flag & firewall_main_flag_operation_show_d) { firewall_operate_show(main); return; @@ -54,7 +54,7 @@ extern "C" { main->data.file.string = 0; main->data.file.used = 0; - if (main->setting.flag & firewall_main_flag_operation_stop_restart_lock_e) { + if (main->setting.flag & firewall_main_flag_operation_stop_restart_lock_d) { main->data.file.used = firewall_network_path_s.used + firewall_file_other_s.used; f_char_t path_file_other[main->data.file.used + 1]; @@ -81,7 +81,7 @@ extern "C" { } } // for - if (main->setting.flag & firewall_main_flag_operation_lock_e) { + if (main->setting.flag & firewall_main_flag_operation_lock_d) { if (main->data.has & firewall_data_has_lock_e) { firewall_operate_delete_chains(main); @@ -90,7 +90,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) return; main->data.chain = main->data.lock; - main->data.is = firewall_data_is_lock_e; + main->data.is = firewall_data_is_lock_d; main->data.range.start = main->data.chain_contents.array[main->data.lock].array[0].start; main->data.range.stop = main->data.chain_contents.array[main->data.lock].array[0].stop; @@ -107,7 +107,7 @@ extern "C" { return; } - if (main->setting.flag & firewall_main_flag_operation_stop_restart_e) { + if (main->setting.flag & firewall_main_flag_operation_stop_restart_d) { if (main->data.has & firewall_data_has_stop_e) { firewall_operate_delete_chains(main); @@ -116,7 +116,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) return; main->data.chain = main->data.stop; - main->data.is = firewall_data_is_global_e | firewall_data_is_stop_e; + main->data.is = firewall_data_is_global_d | firewall_data_is_stop_d; main->data.range.start = main->data.chain_contents.array[main->data.stop].array[0].start; main->data.range.stop = main->data.chain_contents.array[main->data.stop].array[0].stop; @@ -124,7 +124,7 @@ extern "C" { firewall_operate_rules(main); - if (F_status_is_error(main->setting.state.status) || (main->data.has & firewall_main_flag_operation_stop_e) || main->setting.state.status == F_child) return; + if (F_status_is_error(main->setting.state.status) || (main->data.has & firewall_main_flag_operation_stop_d) || main->setting.state.status == F_child) return; } else { main->setting.state.status = F_status_set_error(F_data); @@ -139,7 +139,7 @@ extern "C" { main->data.file.used = 0; } - if (main->setting.flag & firewall_main_flag_operation_start_restart_e) { + if (main->setting.flag & firewall_main_flag_operation_start_restart_d) { main->data.file.used = firewall_network_path_s.used + firewall_file_first_s.used; f_char_t path_file_first[main->data.file.used + 1]; @@ -151,7 +151,7 @@ extern "C" { firewall_operate_buffer_chain(main, main->data.file, F_false); - if (main->setting.flag & firewall_main_flag_operation_start_e) { + if (main->setting.flag & firewall_main_flag_operation_start_d) { firewall_operate_delete_chains(main); firewall_operate_default_lock(main); @@ -159,11 +159,11 @@ extern "C" { firewall_operate_create_custom_chains(main); - main->data.is = firewall_data_is_global_e; + main->data.is = firewall_data_is_global_d; firewall_operate_chains(main); - if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child || (main->setting.flag & firewall_main_flag_operation_stop_e)) return; + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child || (main->setting.flag & firewall_main_flag_operation_stop_d)) return; for (f_number_unsigned_t j = 0; j < main->setting.devices.used; ++j) { @@ -205,7 +205,7 @@ extern "C" { main->data.is = 0; firewall_operate_chains(main); - if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child || (main->setting.flag & firewall_main_flag_operation_stop_e)) return; + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child || (main->setting.flag & firewall_main_flag_operation_stop_d)) return; } // for main->cache.path_file.used = 0; @@ -228,7 +228,7 @@ extern "C" { firewall_operate_create_custom_chains(main); - main->data.is = firewall_data_is_global_e; + main->data.is = firewall_data_is_global_d; firewall_operate_chains(main); if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) return; diff --git a/level_3/firewall/c/main/operate/chains.c b/level_3/firewall/c/main/operate/chains.c index cc50f31..e920aba 100644 --- a/level_3/firewall/c/main/operate/chains.c +++ b/level_3/firewall/c/main/operate/chains.c @@ -14,10 +14,10 @@ extern "C" { main->data.range = main->data.chain_contents.array[i].array[0]; if ((main->data.has & firewall_data_has_main_e) && i == main->data.main) { - main->data.is |= firewall_data_is_main_e; + main->data.is |= firewall_data_is_main_d; } else { - main->data.is &= ~firewall_data_is_main_e; + main->data.is &= ~firewall_data_is_main_d; } main->data.chain = i; @@ -26,7 +26,7 @@ extern "C" { firewall_operate_rules(main); - if (F_status_is_error(main->setting.state.status) || (main->setting.flag & firewall_main_flag_operation_stop_e) || main->setting.state.status == F_child) return; + if (F_status_is_error(main->setting.state.status) || (main->setting.flag & firewall_main_flag_operation_stop_d) || main->setting.state.status == F_child) return; } // for main->setting.state.status = F_okay; diff --git a/level_3/firewall/c/main/operate/process.c b/level_3/firewall/c/main/operate/process.c index 7bc65b6..b7a028c 100644 --- a/level_3/firewall/c/main/operate/process.c +++ b/level_3/firewall/c/main/operate/process.c @@ -27,7 +27,7 @@ extern "C" { f_ranges_t * const rule_objects = &main->data.rule_objects; f_rangess_t * const rule_contents = &main->data.rule_contents; - if (!(main->data.is & firewall_data_is_global_e)) { + if (!(main->data.is & firewall_data_is_global_d)) { if (main->setting.devices.array[main->data.device].used) { main->cache.device.used = 0; @@ -37,7 +37,7 @@ extern "C" { } // For custom chains, the chain command may not be specified. - if (!(main->data.is & firewall_data_is_stop_main_lock_e)) { + if (!(main->data.is & firewall_data_is_stop_main_lock_d)) { chain = firewall_chain_custom_e; } diff --git a/level_3/firewall/c/main/operate/show.c b/level_3/firewall/c/main/operate/show.c index e347049..f20b63f 100644 --- a/level_3/firewall/c/main/operate/show.c +++ b/level_3/firewall/c/main/operate/show.c @@ -70,9 +70,9 @@ extern "C" { }; const uint16_t show_flags[] = { - firewall_main_flag_operation_show_nat_e, - firewall_main_flag_operation_show_mangle_e, - firewall_main_flag_operation_show_filter_e, + firewall_main_flag_operation_show_nat_d, + firewall_main_flag_operation_show_mangle_d, + firewall_main_flag_operation_show_filter_d, }; for (uint8_t i = 0; i < 3; ++i) { diff --git a/level_3/fss_identify/c/main/common.c b/level_3/fss_identify/c/main/common.c index 7885ef3..67fd430 100644 --- a/level_3/fss_identify/c/main/common.c +++ b/level_3/fss_identify/c/main/common.c @@ -38,19 +38,19 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_help_e; + main->setting.flag |= fss_identify_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_version_e; + main->setting.flag |= fss_identify_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_copyright_e; + main->setting.flag |= fss_identify_main_flag_copyright_d; return; } @@ -58,24 +58,24 @@ extern "C" { f_number_unsigned_t index = 0; if (main->program.parameters.array[fss_identify_parameter_content_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_content_e; + main->setting.flag |= fss_identify_main_flag_content_d; } else { - main->setting.flag &= ~fss_identify_main_flag_content_e; + main->setting.flag &= ~fss_identify_main_flag_content_d; } if (main->program.parameters.array[fss_identify_parameter_object_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_object_e; + main->setting.flag |= fss_identify_main_flag_object_d; } else { - main->setting.flag &= ~fss_identify_main_flag_object_e; + main->setting.flag &= ~fss_identify_main_flag_object_d; } if (main->program.parameters.array[fss_identify_parameter_total_e].result & f_console_result_found_e) { - main->setting.flag |= fss_identify_main_flag_total_e; + main->setting.flag |= fss_identify_main_flag_total_d; } else { - main->setting.flag &= ~fss_identify_main_flag_total_e; + main->setting.flag &= ~fss_identify_main_flag_total_d; } if (main->program.parameters.array[fss_identify_parameter_line_e].result & f_console_result_value_e) { @@ -94,7 +94,7 @@ extern "C" { return; } - main->setting.flag |= fss_identify_main_flag_line_e; + main->setting.flag |= fss_identify_main_flag_line_d; } else if (main->program.parameters.array[fss_identify_parameter_line_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -104,7 +104,7 @@ extern "C" { return; } else { - main->setting.flag &= ~fss_identify_main_flag_line_e; + main->setting.flag &= ~fss_identify_main_flag_line_d; } if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_value_e) { @@ -182,7 +182,7 @@ extern "C" { return; } - main->setting.flag |= fss_identify_main_flag_name_e; + main->setting.flag |= fss_identify_main_flag_name_d; } else if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -218,20 +218,20 @@ extern "C" { main->setting.files.array[main->setting.files.used++].size = 0; } // for - main->setting.flag |= fss_identify_main_flag_file_from_e; + main->setting.flag |= fss_identify_main_flag_file_from_d; } else { - main->setting.flag &= ~fss_identify_main_flag_file_from_e; + main->setting.flag &= ~fss_identify_main_flag_file_from_d; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= fss_identify_main_flag_pipe_e; + main->setting.flag |= fss_identify_main_flag_pipe_d; } else { - main->setting.flag &= ~fss_identify_main_flag_pipe_e; + main->setting.flag &= ~fss_identify_main_flag_pipe_d; } - if (!(main->setting.flag & fss_identify_main_flag_pipe_e | fss_identify_main_flag_file_from_e)) { + if (!(main->setting.flag & fss_identify_main_flag_pipe_d | fss_identify_main_flag_file_from_d)) { main->setting.state.status = F_status_set_error(F_parameter); fss_identify_print_error_no_from(&main->program.error); @@ -240,17 +240,17 @@ extern "C" { } // Default to both Object and Content when neither are specified. - if (!(main->setting.flag & (fss_identify_main_flag_object_e | fss_identify_main_flag_content_e | fss_identify_main_flag_total_e))) { - main->setting.flag |= fss_identify_main_flag_object_e; - main->setting.flag |= fss_identify_main_flag_content_e; + if (!(main->setting.flag & (fss_identify_main_flag_object_d | fss_identify_main_flag_content_d | fss_identify_main_flag_total_d))) { + main->setting.flag |= fss_identify_main_flag_object_d; + main->setting.flag |= fss_identify_main_flag_content_d; } - if (main->setting.flag & fss_identify_main_flag_total_e) { - if (main->setting.flag & (fss_identify_main_flag_content_e | fss_identify_main_flag_object_e)) { + if (main->setting.flag & fss_identify_main_flag_total_d) { + if (main->setting.flag & (fss_identify_main_flag_content_d | fss_identify_main_flag_object_d)) { main->setting.state.status = F_status_set_error(F_parameter); if (main->program.error.verbosity > f_console_verbosity_quiet_e) { - fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, main->setting.flag & fss_identify_main_flag_content_e ? fss_identify_long_content_s : fss_identify_long_object_s, fss_identify_long_total_s); + fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, main->setting.flag & fss_identify_main_flag_content_d ? fss_identify_long_content_s : fss_identify_long_object_s, fss_identify_long_total_s); } } } diff --git a/level_3/fss_identify/c/main/common/define.h b/level_3/fss_identify/c/main/common/define.h index b8973e7..54bf538 100644 --- a/level_3/fss_identify/c/main/common/define.h +++ b/level_3/fss_identify/c/main/common/define.h @@ -34,6 +34,65 @@ extern "C" { #endif // _di_fss_identify_allocation_d_ /** + * Flags passed to the main function or program. + * + * fss_identify_main_flag_*_d: + * - none: No flags set. + * - content: Use the content (The "0000" part of "FSS-0000"). + * - copyright: Print copyright. + * - file_from: Using a specified source file. + * - file_to: Using a specified destination file. (Not used at this time.) + * - header: Enable printing of headers. + * - help: Print help. + * - line: Print only the identifier at a given line. + * - name: Select using this full or partial type name or code. + * - object: Use the object (The "FSS" part of "FSS-0000"). + * - pipe: Use the input pipe. + * - total: Print the total Identifiers found. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + */ +#ifndef _di_fss_identify_main_flag_d_ + #define fss_identify_main_flag_none_d 0x0 + #define fss_identify_main_flag_content_d 0x1 + #define fss_identify_main_flag_copyright_d 0x2 + #define fss_identify_main_flag_file_from_d 0x4 + #define fss_identify_main_flag_file_to_d 0x8 + #define fss_identify_main_flag_header_d 0x10 + #define fss_identify_main_flag_help_d 0x20 + #define fss_identify_main_flag_line_d 0x40 + #define fss_identify_main_flag_name_d 0x80 + #define fss_identify_main_flag_object_d 0x100 + #define fss_identify_main_flag_pipe_d 0x200 + #define fss_identify_main_flag_total_d 0x400 + #define fss_identify_main_flag_version_d 0x800 + #define fss_identify_main_flag_version_copyright_help_d 0x822 +#endif // _di_fss_identify_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * fss_identify_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_fss_identify_print_flag_d_ + #define fss_identify_print_flag_none_d 0x0 + #define fss_identify_print_flag_debug_d 0x1 + #define fss_identify_print_flag_error_d 0x2 + #define fss_identify_print_flag_file_d 0x4 + #define fss_identify_print_flag_in_d 0x8 + #define fss_identify_print_flag_out_d 0x10 + #define fss_identify_print_flag_message_d 0x20 + #define fss_identify_print_flag_warning_d 0x40 +#endif // _di_fss_identify_print_flag_d_ + +/** * The program signal defines. * * fss_identify_signal_*_d: diff --git a/level_3/fss_identify/c/main/common/enumeration.h b/level_3/fss_identify/c/main/common/enumeration.h index 8cf2a86..93d08e6 100644 --- a/level_3/fss_identify/c/main/common/enumeration.h +++ b/level_3/fss_identify/c/main/common/enumeration.h @@ -17,44 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * fss_identify_main_flag_*_e: - * - none: No flags set. - * - content: Use the content (The "0000" part of "FSS-0000"). - * - copyright: Print copyright. - * - file_from: Using a specified source file. - * - file_to: Using a specified destination file. (Not used at this time.) - * - header: Enable printing of headers. - * - help: Print help. - * - line: Print only the identifier at a given line. - * - name: Select using this full or partial type name or code. - * - object: Use the object (The "FSS" part of "FSS-0000"). - * - pipe: Use the input pipe. - * - total: Print the total Identifiers found. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_fss_identify_main_flag_e_ - enum { - fss_identify_main_flag_none_e = 0x0, - fss_identify_main_flag_content_e = 0x1, - fss_identify_main_flag_copyright_e = 0x2, - fss_identify_main_flag_file_from_e = 0x4, - fss_identify_main_flag_file_to_e = 0x8, - fss_identify_main_flag_header_e = 0x10, - fss_identify_main_flag_help_e = 0x20, - fss_identify_main_flag_line_e = 0x40, - fss_identify_main_flag_name_e = 0x80, - fss_identify_main_flag_object_e = 0x100, - fss_identify_main_flag_pipe_e = 0x200, - fss_identify_main_flag_total_e = 0x400, - fss_identify_main_flag_version_e = 0x800, - fss_identify_main_flag_version_copyright_help_e = 0x822, - }; // enum -#endif // _di_fss_identify_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_fss_identify_parameter_e_ @@ -80,31 +42,6 @@ extern "C" { #define fss_identify_parameter_total_d (f_console_parameter_state_type_total_d + 5) #endif // _di_fss_identify_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * fss_identify_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_fss_identify_print_flag_e_ - enum { - fss_identify_print_flag_none_e = 0x0, - fss_identify_print_flag_debug_e = 0x1, - fss_identify_print_flag_error_e = 0x2, - fss_identify_print_flag_file_e = 0x4, - fss_identify_print_flag_in_e = 0x8, - fss_identify_print_flag_out_e = 0x10, - fss_identify_print_flag_message_e = 0x20, - fss_identify_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_fss_identify_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_identify/c/main/common/type.h b/level_3/fss_identify/c/main/common/type.h index 8b6db31..39fff47 100644 --- a/level_3/fss_identify/c/main/common/type.h +++ b/level_3/fss_identify/c/main/common/type.h @@ -62,7 +62,7 @@ extern "C" { #define fss_identify_setting_t_initialize \ { \ - fss_identify_main_flag_none_e, \ + fss_identify_main_flag_none_d, \ 0, \ 0, \ 0, \ diff --git a/level_3/fss_identify/c/main/fss_identify.c b/level_3/fss_identify/c/main/fss_identify.c index 59965c8..cb57051 100644 --- a/level_3/fss_identify/c/main/fss_identify.c +++ b/level_3/fss_identify/c/main/fss_identify.c @@ -11,21 +11,21 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & fss_identify_main_flag_version_copyright_help_e) { - if (main->setting.flag & fss_identify_main_flag_help_e) { + if (main->setting.flag & fss_identify_main_flag_version_copyright_help_d) { + if (main->setting.flag & fss_identify_main_flag_help_d) { fss_identify_print_message_help(&main->program.message); } - else if (main->setting.flag & fss_identify_main_flag_version_e) { + else if (main->setting.flag & fss_identify_main_flag_version_d) { fll_program_print_version(&main->program.message, fss_identify_program_version_s); } - else if (main->setting.flag & fss_identify_main_flag_copyright_e) { + else if (main->setting.flag & fss_identify_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if (F_status_is_error_not(main->setting.state.status) && (main->setting.flag & fss_identify_main_flag_pipe_e)) { + if (F_status_is_error_not(main->setting.state.status) && (main->setting.flag & fss_identify_main_flag_pipe_d)) { main->setting.file.id = F_type_descriptor_input_d; main->setting.file.stream = F_type_input_d; main->setting.file.size_read = 512; @@ -40,7 +40,7 @@ extern "C" { for (f_number_unsigned_t i = 0; F_status_is_error_not(main->setting.state.status) && i < main->setting.files.used; ++i) { if (fss_identify_signal_check(main)) break; - if ((main->setting.flag & fss_identify_main_flag_line_e) && main->setting.current > main->setting.line) break; + if ((main->setting.flag & fss_identify_main_flag_line_d) && main->setting.current > main->setting.line) break; macro_f_file_t_reset(main->setting.file); @@ -64,7 +64,7 @@ extern "C" { } // for if (F_status_is_error_not(main->setting.state.status)) { - if (main->setting.flag & fss_identify_main_flag_total_e) { + if (main->setting.flag & fss_identify_main_flag_total_d) { fss_identify_print_data_total(&main->program.message); } } diff --git a/level_3/fss_identify/c/main/main.c b/level_3/fss_identify/c/main/main.c index 593c3c2..fd3a5b5 100644 --- a/level_3/fss_identify/c/main/main.c +++ b/level_3/fss_identify/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_identify_main_t data = fss_identify_main_t_initialize; - data.program.debug.flag |= fss_identify_print_flag_debug_e | fss_identify_print_flag_out_e; - data.program.error.flag |= fss_identify_print_flag_error_e | fss_identify_print_flag_out_e; - data.program.output.flag |= fss_identify_print_flag_out_e; - data.program.message.flag |= fss_identify_print_flag_message_e | fss_identify_print_flag_out_e; - data.program.warning.flag |= fss_identify_print_flag_warning_e | fss_identify_print_flag_out_e; + data.program.debug.flag |= fss_identify_print_flag_debug_d | fss_identify_print_flag_out_d; + data.program.error.flag |= fss_identify_print_flag_error_d | fss_identify_print_flag_out_d; + data.program.output.flag |= fss_identify_print_flag_out_d; + data.program.message.flag |= fss_identify_print_flag_message_d | fss_identify_print_flag_out_d; + data.program.warning.flag |= fss_identify_print_flag_warning_d | fss_identify_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/fss_identify/c/main/print/data.c b/level_3/fss_identify/c/main/print/data.c index d3cd3db..3470c69 100644 --- a/level_3/fss_identify/c/main/print/data.c +++ b/level_3/fss_identify/c/main/print/data.c @@ -13,15 +13,15 @@ extern "C" { f_file_stream_lock(print->to); - if (main->setting.flag & fss_identify_main_flag_object_e) { + if (main->setting.flag & fss_identify_main_flag_object_d) { f_print((const f_string_t) id.name, id.used, print->to); - if (main->setting.flag & fss_identify_main_flag_content_e) { + if (main->setting.flag & fss_identify_main_flag_content_d) { f_print_dynamic_raw(f_fss_type_header_part5_s, print->to); } } - if (main->setting.flag & fss_identify_main_flag_content_e) { + if (main->setting.flag & fss_identify_main_flag_content_d) { fl_print_format("%04_ui", print->to, id.type); } diff --git a/level_3/fss_identify/c/main/process.c b/level_3/fss_identify/c/main/process.c index eca32d6..25fa345 100644 --- a/level_3/fss_identify/c/main/process.c +++ b/level_3/fss_identify/c/main/process.c @@ -43,7 +43,7 @@ extern "C" { } // for } - if (main->setting.flag & fss_identify_main_flag_line_e) { + if (main->setting.flag & fss_identify_main_flag_line_d) { for (i = 0; i < main->setting.ids.used; ++i, ++main->setting.current) { if (main->setting.current == main->setting.line) { @@ -51,7 +51,7 @@ extern "C" { if (fss_identify_process_name_compare(main, main->setting.ids.array[i], modes) != F_equal_to) continue; } - if (main->setting.flag & fss_identify_main_flag_total_e) { + if (main->setting.flag & fss_identify_main_flag_total_d) { ++main->setting.total; } else { @@ -64,7 +64,7 @@ extern "C" { } } // for } - else if (main->setting.flag & fss_identify_main_flag_total_e) { + else if (main->setting.flag & fss_identify_main_flag_total_d) { if (main->setting.names.used) { for (i = 0; i < main->setting.ids.used; ++i, ++main->setting.current) { diff --git a/level_3/fss_read/c/basic/fss_read.c b/level_3/fss_read/c/basic/fss_read.c index bf351a1..5e52879 100644 --- a/level_3/fss_read/c/basic/fss_read.c +++ b/level_3/fss_read/c/basic/fss_read.c @@ -40,7 +40,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; diff --git a/level_3/fss_read/c/basic/main.c b/level_3/fss_read/c/basic/main.c index 04dc1b3..31802f3 100644 --- a/level_3/fss_read/c/basic/main.c +++ b/level_3/fss_read/c/basic/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,8 +17,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_line_single_e; - data.setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e; + data.setting.flag |= fss_read_main_flag_line_single_d; + data.setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_basic_standard_s; diff --git a/level_3/fss_read/c/basic/print.c b/level_3/fss_read/c/basic/print.c index 83a5a82..51cdd75 100644 --- a/level_3/fss_read/c/basic/print.c +++ b/level_3/fss_read/c/basic/print.c @@ -11,8 +11,8 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->setting.flag & fss_read_main_flag_content_e) { - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { diff --git a/level_3/fss_read/c/basic_list/fss_read.c b/level_3/fss_read/c/basic_list/fss_read.c index 74dac22..8a710d4 100644 --- a/level_3/fss_read/c/basic_list/fss_read.c +++ b/level_3/fss_read/c/basic_list/fss_read.c @@ -40,7 +40,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; diff --git a/level_3/fss_read/c/basic_list/main.c b/level_3/fss_read/c/basic_list/main.c index d928aa8..f30ce67 100644 --- a/level_3/fss_read/c/basic_list/main.c +++ b/level_3/fss_read/c/basic_list/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; + data.setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_basic_list_standard_s; diff --git a/level_3/fss_read/c/basic_list/print.c b/level_3/fss_read/c/basic_list/print.c index 9d55d95..2ed28ee 100644 --- a/level_3/fss_read/c/basic_list/print.c +++ b/level_3/fss_read/c/basic_list/print.c @@ -13,11 +13,11 @@ extern "C" { f_file_stream_lock(print->to); - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_basic_list_open_s, print->to); f_print_dynamic_raw(f_fss_basic_list_open_end_s, print->to); } diff --git a/level_3/fss_read/c/embedded_list/fss_read.c b/level_3/fss_read/c/embedded_list/fss_read.c index 34a8d86..ec65d66 100644 --- a/level_3/fss_read/c/embedded_list/fss_read.c +++ b/level_3/fss_read/c/embedded_list/fss_read.c @@ -40,7 +40,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; diff --git a/level_3/fss_read/c/embedded_list/main.c b/level_3/fss_read/c/embedded_list/main.c index c1ff6f2..f806c90 100644 --- a/level_3/fss_read/c/embedded_list/main.c +++ b/level_3/fss_read/c/embedded_list/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,8 +17,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_content_has_close_e | fss_read_main_flag_object_trim_e; - data.setting.flag |= fss_read_main_flag_depth_multiple_e; + data.setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_content_has_close_d | fss_read_main_flag_object_trim_d; + data.setting.flag |= fss_read_main_flag_depth_multiple_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_embedded_list_standard_s; diff --git a/level_3/fss_read/c/embedded_list/print.c b/level_3/fss_read/c/embedded_list/print.c index 3e1f7a8..ae2b29f 100644 --- a/level_3/fss_read/c/embedded_list/print.c +++ b/level_3/fss_read/c/embedded_list/print.c @@ -13,11 +13,11 @@ extern "C" { f_file_stream_lock(print->to); - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_embedded_list_open_s, print->to); f_print_dynamic_raw(f_fss_embedded_list_open_end_s, print->to); } @@ -39,7 +39,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if ((main->setting.flag & fss_read_main_flag_object_e) && main->setting.flag & fss_read_main_flag_content_e) { + if ((main->setting.flag & fss_read_main_flag_object_d) && main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_embedded_list_close_s, print->to); f_print_dynamic_raw(f_fss_embedded_list_close_end_s, print->to); } diff --git a/level_3/fss_read/c/extended/fss_read.c b/level_3/fss_read/c/extended/fss_read.c index f78ef74..89e8136 100644 --- a/level_3/fss_read/c/extended/fss_read.c +++ b/level_3/fss_read/c/extended/fss_read.c @@ -40,7 +40,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; diff --git a/level_3/fss_read/c/extended/main.c b/level_3/fss_read/c/extended/main.c index 44940b5..b68e61d 100644 --- a/level_3/fss_read/c/extended/main.c +++ b/level_3/fss_read/c/extended/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,8 +17,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_line_single_e | fss_read_main_flag_content_multiple_e; - data.setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e; + data.setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d; + data.setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_extended_standard_s; diff --git a/level_3/fss_read/c/extended/print.c b/level_3/fss_read/c/extended/print.c index 5236b9c..234021c 100644 --- a/level_3/fss_read/c/extended/print.c +++ b/level_3/fss_read/c/extended/print.c @@ -11,8 +11,8 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->setting.flag & fss_read_main_flag_content_e) { - fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_e) ? fss_read_pipe_content_start_s : f_fss_extended_next_s, print->to); + if (main->setting.flag & fss_read_main_flag_content_d) { + fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_start_s : f_fss_extended_next_s, print->to); } return F_okay; @@ -26,8 +26,8 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->setting.flag & fss_read_main_flag_content_e) { - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { fll_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { diff --git a/level_3/fss_read/c/extended_list/fss_read.c b/level_3/fss_read/c/extended_list/fss_read.c index 825187c..18dafb7 100644 --- a/level_3/fss_read/c/extended_list/fss_read.c +++ b/level_3/fss_read/c/extended_list/fss_read.c @@ -40,7 +40,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; diff --git a/level_3/fss_read/c/extended_list/main.c b/level_3/fss_read/c/extended_list/main.c index eafebe0..e2e4487 100644 --- a/level_3/fss_read/c/extended_list/main.c +++ b/level_3/fss_read/c/extended_list/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_content_has_close_e | fss_read_main_flag_object_trim_e; + data.setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_content_has_close_d | fss_read_main_flag_object_trim_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_extended_list_standard_s; diff --git a/level_3/fss_read/c/extended_list/print.c b/level_3/fss_read/c/extended_list/print.c index ccf2afd..3dd8c64 100644 --- a/level_3/fss_read/c/extended_list/print.c +++ b/level_3/fss_read/c/extended_list/print.c @@ -13,11 +13,11 @@ extern "C" { f_file_stream_lock(print->to); - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_extended_list_open_s, print->to); f_print_dynamic_raw(f_fss_extended_list_open_end_s, print->to); } @@ -39,7 +39,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if ((main->setting.flag & fss_read_main_flag_object_e) && main->setting.flag & fss_read_main_flag_content_e) { + if ((main->setting.flag & fss_read_main_flag_object_d) && main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_extended_list_close_s, print->to); f_print_dynamic_raw(f_fss_extended_list_close_end_s, print->to); } diff --git a/level_3/fss_read/c/main/common.c b/level_3/fss_read/c/main/common.c index f89d3c3..7ee8a8c 100644 --- a/level_3/fss_read/c/main/common.c +++ b/level_3/fss_read/c/main/common.c @@ -80,15 +80,15 @@ extern "C" { main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_help_e; + main->setting.flag |= fss_read_main_flag_help_d; } if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_version_e; + main->setting.flag |= fss_read_main_flag_version_d; } if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_copyright_e; + main->setting.flag |= fss_read_main_flag_copyright_d; } if (callback) { @@ -109,10 +109,10 @@ extern "C" { f_number_unsigned_t index = 0; if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= fss_read_main_flag_pipe_e; + main->setting.flag |= fss_read_main_flag_pipe_d; } else { - main->setting.flag &= ~fss_read_main_flag_pipe_e; + main->setting.flag &= ~fss_read_main_flag_pipe_d; } { @@ -148,12 +148,12 @@ extern "C" { }; const uint32_t parameter_flag[] = { - fss_read_main_flag_at_e, - fss_read_main_flag_depth_e, - fss_read_main_flag_line_e, - fss_read_main_flag_select_e, - fss_read_main_flag_name_e, - fss_read_main_flag_delimit_e, + fss_read_main_flag_at_d, + fss_read_main_flag_depth_d, + fss_read_main_flag_line_d, + fss_read_main_flag_select_d, + fss_read_main_flag_name_d, + fss_read_main_flag_delimit_d, }; f_number_unsigned_t * const parameter_value_digit[] = { @@ -230,7 +230,7 @@ extern "C" { } } // for - main->setting.flag |= fss_read_main_flag_columns_e; + main->setting.flag |= fss_read_main_flag_columns_d; } if (parameters->array[fss_read_parameter_pipe_e].result & f_console_result_found_e) { @@ -391,45 +391,45 @@ extern "C" { if (parameters->array[fss_read_parameter_content_e].result & f_console_result_found_e) { if (parameters->array[fss_read_parameter_object_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_object_e; + main->setting.flag |= fss_read_main_flag_object_d; } - main->setting.flag |= fss_read_main_flag_content_e; + main->setting.flag |= fss_read_main_flag_content_d; } else if (parameters->array[fss_read_parameter_object_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_object_e; + main->setting.flag |= fss_read_main_flag_object_d; } else { // Fallback to Content as the default. - main->setting.flag |= fss_read_main_flag_content_e; + main->setting.flag |= fss_read_main_flag_content_d; } if (parameters->array[fss_read_parameter_empty_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_empty_e; + main->setting.flag |= fss_read_main_flag_empty_d; } if (parameters->array[fss_read_parameter_original_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_original_e; + main->setting.flag |= fss_read_main_flag_original_d; } if (parameters->array[fss_read_parameter_pipe_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_pipe_format_e; + main->setting.flag |= fss_read_main_flag_pipe_format_d; } if (parameters->array[fss_read_parameter_total_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_total_e; + main->setting.flag |= fss_read_main_flag_total_d; } if (parameters->array[fss_read_parameter_trim_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_trim_e; + main->setting.flag |= fss_read_main_flag_trim_d; } fss_read_setting_load_depth(arguments, main, parameters); if (F_status_is_error(main->setting.state.status)) return; if (parameters->array[fss_read_parameter_trim_e].result & f_console_result_found_e) { - main->setting.flag |= fss_read_main_flag_trim_e; + main->setting.flag |= fss_read_main_flag_trim_d; } f_file_t file = f_file_t_initialize; diff --git a/level_3/fss_read/c/main/common/define.h b/level_3/fss_read/c/main/common/define.h index ecdbeb9..56cbbc7 100644 --- a/level_3/fss_read/c/main/common/define.h +++ b/level_3/fss_read/c/main/common/define.h @@ -35,16 +35,111 @@ extern "C" { /** * The program allocation block defines. * - * fss_payload_read_block_*: + * fss_payload_read_block_*_d: * - max: The max block read size before checking for interrupt. * - read_small: The block read size for small files. * - read_large: The block read size for large files. */ -#ifndef _di_fss_read_allocation_d_ +#ifndef _di_fss_read_allocation_block_d_ #define fss_read_allocation_block_max_d 16777216 #define fss_read_allocation_block_read_small_d 8192 #define fss_read_allocation_block_read_large_d 65536 -#endif // _di_fss_read_allocation_d_ +#endif // _di_fss_read_allocation_block_d_ + +/** + * Flags passed to the main function or program. + * + * fss_read_main_flag_*_d: + * - none: No flags set. + * - at: The object at the given position is being selected (Think of this as select a row for some Object). + * - columns: The total columns found and selected is printed instead of the Content. + * - content: The Content is to be printed. + * - content_has_close: The Content has a closing character which needs to be counted and handled when processing both Object and Content, but is otherwise not processed or printed. + * - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object. + * - copyright: Print copyright. + * - delimit: How delimits are to be handled is designated. + * - depth: The depth is specified at least once. + * - depth_multiple: Designate that multiple depths are allowed within Content rather than being single depth Content. + * - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed). + * - help: Print help. + * - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content). + * - line_single: Designate that only a single line for Content is allowed for an Object for this standard rather than allowing multiple lines per Content per Object. + * - name: A specific Object name has been requested. + * - object: The Object is to be printed. + * - object_as_line: The Object is counted as its own line for the purpose of -l/--line or any other similar behavior. + * - object_trim: Empty space before an after Objects are ignored while processing without affecting printing behavior. + * - original: Enable original printing, where the quotes are printed and no delimits are applied. + * - payload_create: Create the payload Object with empty Content if the payload Object is missing (when using FSS Payload and related). + * - payload_error: Treat missing or invalid payload as an error (when using FSS Payload and related). + * - payload_warn: Treat missing or invalid payload as a warning (when using FSS Payload and related). + * - pipe: Use the input pipe. + * - pipe_format: Print using the special pipe format. + * - quote_content: Designate that the standard supports quotes on Content. + * - quote_object: Designate that the standard supports quotes on Objects. + * - select: A specific Content at a given position is to be selected (Think of this as select a column for some Content). + * - total: The total lines found and selected is printed instead of the Content. + * - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed). + * - trim_object: Empty space before and after Objects (but not Content) will not be printed (They will be trimmed). + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + */ +#ifndef _di_fss_read_main_flag_d_ + #define fss_read_main_flag_none_d 0x0 + #define fss_read_main_flag_at_d 0x1 + #define fss_read_main_flag_columns_d 0x2 + #define fss_read_main_flag_content_d 0x4 + #define fss_read_main_flag_content_has_close_d 0x8 + #define fss_read_main_flag_content_multiple_d 0x10 + #define fss_read_main_flag_copyright_d 0x20 + #define fss_read_main_flag_delimit_d 0x40 + #define fss_read_main_flag_depth_d 0x80 + #define fss_read_main_flag_depth_multiple_d 0x100 + #define fss_read_main_flag_empty_d 0x200 + #define fss_read_main_flag_help_d 0x400 + #define fss_read_main_flag_line_d 0x800 + #define fss_read_main_flag_line_single_d 0x1000 + #define fss_read_main_flag_name_d 0x2000 + #define fss_read_main_flag_object_d 0x4000 + #define fss_read_main_flag_object_as_line_d 0x8000 + #define fss_read_main_flag_object_trim_d 0x10000 + #define fss_read_main_flag_original_d 0x20000 + #define fss_read_main_flag_payload_create_d 0x40000 + #define fss_read_main_flag_payload_error_d 0x80000 + #define fss_read_main_flag_payload_warn_d 0x100000 + #define fss_read_main_flag_pipe_d 0x200000 + #define fss_read_main_flag_pipe_format_d 0x400000 + #define fss_read_main_flag_quote_content_d 0x800000 + #define fss_read_main_flag_quote_object_d 0x1000000 + #define fss_read_main_flag_select_d 0x2000000 + #define fss_read_main_flag_total_d 0x4000000 + #define fss_read_main_flag_trim_d 0x8000000 + #define fss_read_main_flag_trim_object_d 0x10000000 + #define fss_read_main_flag_version_d 0x20000000 + #define fss_read_main_flag_version_copyright_help_d 0x20000420 +#endif // _di_fss_read_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * fss_read_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_fss_read_print_flag_d_ + #define fss_read_print_flag_none_d 0x0 + #define fss_read_print_flag_debug_d 0x1 + #define fss_read_print_flag_error_d 0x2 + #define fss_read_print_flag_file_d 0x4 + #define fss_read_print_flag_in_d 0x8 + #define fss_read_print_flag_out_d 0x10 + #define fss_read_print_flag_message_d 0x20 + #define fss_read_print_flag_warning_d 0x40 +#endif // _di_fss_read_print_flag_d_ /** * The program signal defines. diff --git a/level_3/fss_read/c/main/common/enumeration.h b/level_3/fss_read/c/main/common/enumeration.h index e2aa1c0..00e9178 100644 --- a/level_3/fss_read/c/main/common/enumeration.h +++ b/level_3/fss_read/c/main/common/enumeration.h @@ -17,80 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * fss_read_main_flag_*_e: - * - none: No flags set. - * - at: The object at the given position is being selected (Think of this as select a row for some Object). - * - columns: The total columns found and selected is printed instead of the Content. - * - content: The Content is to be printed. - * - content_has_close: The Content has a closing character which needs to be counted and handled when processing both Object and Content, but is otherwise not processed or printed. - * - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object. - * - copyright: Print copyright. - * - delimit: How delimits are to be handled is designated. - * - depth: The depth is specified at least once. - * - depth_multiple: Designate that multiple depths are allowed within Content rather than being single depth Content. - * - empty: Empty Content will be printed (Objects that have no Content will have their empty Content printed). - * - help: Print help. - * - line: A specific Content at a given line is to be selected (Think of this as select a row for some Content). - * - line_single: Designate that only a single line for Content is allowed for an Object for this standard rather than allowing multiple lines per Content per Object. - * - name: A specific Object name has been requested. - * - object: The Object is to be printed. - * - object_as_line: The Object is counted as its own line for the purpose of -l/--line or any other similar behavior. - * - object_trim: Empty space before an after Objects are ignored while processing without affecting printing behavior. - * - original: Enable original printing, where the quotes are printed and no delimits are applied. - * - payload_create: Create the payload Object with empty Content if the payload Object is missing (when using FSS Payload and related). - * - payload_error: Treat missing or invalid payload as an error (when using FSS Payload and related). - * - payload_warn: Treat missing or invalid payload as a warning (when using FSS Payload and related). - * - pipe: Use the input pipe. - * - pipe_format: Print using the special pipe format. - * - quote_content: Designate that the standard supports quotes on Content. - * - quote_object: Designate that the standard supports quotes on Objects. - * - select: A specific Content at a given position is to be selected (Think of this as select a column for some Content). - * - total: The total lines found and selected is printed instead of the Content. - * - trim: Empty space before and after Objects and Content will not be printed (They will be trimmed). - * - trim_object: Empty space before and after Objects (but not Content) will not be printed (They will be trimmed). - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_fss_read_main_flag_e_ - enum { - fss_read_main_flag_none_e = 0x0, - fss_read_main_flag_at_e = 0x1, - fss_read_main_flag_columns_e = 0x2, - fss_read_main_flag_content_e = 0x4, - fss_read_main_flag_content_has_close_e = 0x8, - fss_read_main_flag_content_multiple_e = 0x10, - fss_read_main_flag_copyright_e = 0x20, - fss_read_main_flag_delimit_e = 0x40, - fss_read_main_flag_depth_e = 0x80, - fss_read_main_flag_depth_multiple_e = 0x100, - fss_read_main_flag_empty_e = 0x200, - fss_read_main_flag_help_e = 0x400, - fss_read_main_flag_line_e = 0x800, - fss_read_main_flag_line_single_e = 0x1000, - fss_read_main_flag_name_e = 0x2000, - fss_read_main_flag_object_e = 0x4000, - fss_read_main_flag_object_as_line_e = 0x8000, - fss_read_main_flag_object_trim_e = 0x10000, - fss_read_main_flag_original_e = 0x20000, - fss_read_main_flag_payload_create_e = 0x40000, - fss_read_main_flag_payload_error_e = 0x80000, - fss_read_main_flag_payload_warn_e = 0x100000, - fss_read_main_flag_pipe_e = 0x200000, - fss_read_main_flag_pipe_format_e = 0x400000, - fss_read_main_flag_quote_content_e = 0x800000, - fss_read_main_flag_quote_object_e = 0x1000000, - fss_read_main_flag_select_e = 0x2000000, - fss_read_main_flag_total_e = 0x4000000, - fss_read_main_flag_trim_e = 0x8000000, - fss_read_main_flag_trim_object_e = 0x10000000, - fss_read_main_flag_version_e = 0x20000000, - fss_read_main_flag_version_copyright_help_e = 0x20000420, - }; // enum -#endif // _di_fss_read_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_fss_read_parameter_e_ @@ -139,31 +65,6 @@ extern "C" { #endif // _di_fss_read_parameter_e_ /** - * Flags for fine-tuned print control. - * - * fss_read_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_fss_read_print_flag_e_ - enum { - fss_read_print_flag_none_e = 0x0, - fss_read_print_flag_debug_e = 0x1, - fss_read_print_flag_error_e = 0x2, - fss_read_print_flag_file_e = 0x4, - fss_read_print_flag_in_e = 0x8, - fss_read_print_flag_out_e = 0x10, - fss_read_print_flag_message_e = 0x20, - fss_read_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_fss_read_print_flag_e_ - -/** * FSS Delimit Parameter enumerations. * * fss_read_delimit_mode_*_e: diff --git a/level_3/fss_read/c/main/common/type.h b/level_3/fss_read/c/main/common/type.h index 580c90b..1d70548 100644 --- a/level_3/fss_read/c/main/common/type.h +++ b/level_3/fss_read/c/main/common/type.h @@ -252,7 +252,7 @@ extern "C" { #define fss_read_setting_t_initialize \ { \ - fss_read_main_flag_none_e, \ + fss_read_main_flag_none_d, \ fss_read_delimit_mode_all_e, \ F_okay, \ macro_f_state_t_initialize_1(fss_read_allocation_large_d, fss_read_allocation_small_d, F_okay, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \ diff --git a/level_3/fss_read/c/main/fss_read.c b/level_3/fss_read/c/main/fss_read.c index 765279b..ed81862 100644 --- a/level_3/fss_read/c/main/fss_read.c +++ b/level_3/fss_read/c/main/fss_read.c @@ -56,8 +56,8 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & fss_read_main_flag_version_copyright_help_e) { - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_version_copyright_help_d) { + if (main->setting.flag & fss_read_main_flag_help_d) { if (main->callback.process_help) { main->callback.process_help(void_main); } @@ -65,17 +65,17 @@ extern "C" { fss_read_print_message_help(&main->program.message); } } - else if (main->setting.flag & fss_read_main_flag_version_e) { + else if (main->setting.flag & fss_read_main_flag_version_d) { fll_program_print_version(&main->program.message, fss_read_program_version_s); } - else if (main->setting.flag & fss_read_main_flag_copyright_e) { + else if (main->setting.flag & fss_read_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if (main->setting.flag & (fss_read_main_flag_object_e | fss_read_main_flag_content_e)) { + if (main->setting.flag & (fss_read_main_flag_object_d | fss_read_main_flag_content_d)) { if (main->callback.process_normal) { main->callback.process_normal(void_main); } diff --git a/level_3/fss_read/c/main/main.c b/level_3/fss_read/c/main/main.c index ce7fece..6b8caee 100644 --- a/level_3/fss_read/c/main/main.c +++ b/level_3/fss_read/c/main/main.c @@ -12,11 +12,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -95,7 +95,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { #ifndef _di_fss_read_main_setting_load_as_ void fss_read_main_setting_load_as(const f_console_arguments_t arguments, fss_read_main_t * const main) { - if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_read_main_flag_version_e)) return; + if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_read_main_flag_version_d)) return; // Use the default standard of: FSS-0000 (Basic) main->callback.process_help = &fss_read_main_process_help; @@ -121,17 +121,17 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_basic_standard_s; - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_content_multiple_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_object_as_line_e; - main->setting.flag &= ~fss_read_main_flag_object_trim_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_trim_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_content_multiple_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_object_as_line_d; + main->setting.flag &= ~fss_read_main_flag_object_trim_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_trim_object_d; - main->setting.flag |= fss_read_main_flag_line_single_e; - main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e; + main->setting.flag |= fss_read_main_flag_line_single_d; + main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d; if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_value_e && main->program.parameters.array[fss_read_parameter_as_e].values.used) { const f_number_unsigned_t index = main->program.parameters.array[fss_read_parameter_as_e].values.array[main->program.parameters.array[fss_read_parameter_as_e].values.used - 1]; @@ -145,17 +145,17 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_basic_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_content_multiple_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_object_as_line_e; - main->setting.flag &= ~fss_read_main_flag_object_trim_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_trim_object_e; - - main->setting.flag |= fss_read_main_flag_line_single_e; - main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_content_multiple_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_object_as_line_d; + main->setting.flag &= ~fss_read_main_flag_object_trim_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_trim_object_d; + + main->setting.flag |= fss_read_main_flag_line_single_d; + main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d; main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e; @@ -180,16 +180,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_extended_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_object_as_line_e; - main->setting.flag &= ~fss_read_main_flag_object_trim_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_trim_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_object_as_line_d; + main->setting.flag &= ~fss_read_main_flag_object_trim_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_trim_object_d; - main->setting.flag |= fss_read_main_flag_line_single_e | fss_read_main_flag_content_multiple_e; - main->setting.flag |= fss_read_main_flag_quote_content_e | fss_read_main_flag_quote_object_e; + main->setting.flag |= fss_read_main_flag_line_single_d | fss_read_main_flag_content_multiple_d; + main->setting.flag |= fss_read_main_flag_quote_content_d | fss_read_main_flag_quote_object_d; main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e; @@ -211,16 +211,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_basic_list_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_content_multiple_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_line_single_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_quote_content_e; - main->setting.flag &= ~fss_read_main_flag_quote_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_content_multiple_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_line_single_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_quote_content_d; + main->setting.flag &= ~fss_read_main_flag_quote_object_d; - main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; + main->setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e; @@ -242,16 +242,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_extended_list_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_line_single_e; - main->setting.flag &= ~fss_read_main_flag_content_multiple_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_quote_content_e; - main->setting.flag &= ~fss_read_main_flag_quote_object_e; + main->setting.flag &= ~fss_read_main_flag_line_single_d; + main->setting.flag &= ~fss_read_main_flag_content_multiple_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_quote_content_d; + main->setting.flag &= ~fss_read_main_flag_quote_object_d; - main->setting.flag |= fss_read_main_flag_content_has_close_e; - main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; + main->setting.flag |= fss_read_main_flag_content_has_close_d; + main->setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e; @@ -273,16 +273,16 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_embedded_list_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_line_single_e; - main->setting.flag &= ~fss_read_main_flag_payload_error_e; - main->setting.flag &= ~fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~fss_read_main_flag_quote_content_e; - main->setting.flag &= ~fss_read_main_flag_quote_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_line_single_d; + main->setting.flag &= ~fss_read_main_flag_payload_error_d; + main->setting.flag &= ~fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~fss_read_main_flag_quote_content_d; + main->setting.flag &= ~fss_read_main_flag_quote_object_d; - main->setting.flag |= fss_read_main_flag_content_has_close_e | fss_read_main_flag_content_multiple_e; - main->setting.flag |= fss_read_main_flag_depth_multiple_e; - main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; + main->setting.flag |= fss_read_main_flag_content_has_close_d | fss_read_main_flag_content_multiple_d; + main->setting.flag |= fss_read_main_flag_depth_multiple_d; + main->setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e; @@ -304,15 +304,15 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_read_payload_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_read_main_flag_content_has_close_e; - main->setting.flag &= ~fss_read_main_flag_content_multiple_e; - main->setting.flag &= ~fss_read_main_flag_depth_multiple_e; - main->setting.flag &= ~fss_read_main_flag_line_single_e; - main->setting.flag &= ~fss_read_main_flag_quote_content_e; - main->setting.flag &= ~fss_read_main_flag_quote_object_e; + main->setting.flag &= ~fss_read_main_flag_content_has_close_d; + main->setting.flag &= ~fss_read_main_flag_content_multiple_d; + main->setting.flag &= ~fss_read_main_flag_depth_multiple_d; + main->setting.flag &= ~fss_read_main_flag_line_single_d; + main->setting.flag &= ~fss_read_main_flag_quote_content_d; + main->setting.flag &= ~fss_read_main_flag_quote_object_d; - main->setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; - main->setting.flag |= fss_read_main_flag_payload_error_e; + main->setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; + main->setting.flag |= fss_read_main_flag_payload_error_d; main->program.parameters.array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e; @@ -329,7 +329,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { else { main->setting.state.status = F_status_set_error(F_parameter); - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_help_d) { fss_read_main_process_help((void *) main); } else { @@ -344,7 +344,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.state.status = f_console_parameter_reset(&main->program.parameters); if (F_status_is_error(main->setting.state.status)) { - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_help_d) { fss_read_main_process_help((void *) main); } else { @@ -357,7 +357,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0); if (F_status_is_error(main->setting.state.status)) { - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_help_d) { fss_read_main_process_help((void *) main); } else { @@ -376,7 +376,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { if (f_compare_dynamic(as, main->program.parameters.arguments.array[index_new]) != F_equal_to) { main->setting.state.status = F_status_set_error(F_parameter); - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_help_d) { fss_read_main_process_help((void *) main); } else { @@ -390,7 +390,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { else if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); - if (main->setting.flag & fss_read_main_flag_help_e) { + if (main->setting.flag & fss_read_main_flag_help_d) { fss_read_main_process_help((void *) main); return; diff --git a/level_3/fss_read/c/main/print/data.c b/level_3/fss_read/c/main/print/data.c index 4927641..bea80aa 100644 --- a/level_3/fss_read/c/main/print/data.c +++ b/level_3/fss_read/c/main/print/data.c @@ -15,8 +15,8 @@ extern "C" { bool print_set_end = F_false; - if ((main->setting.flag & fss_read_main_flag_object_e) || (main->setting.flag & fss_read_main_flag_content_e) && (main->setting.contents.array[at].used || (main->setting.flag & fss_read_main_flag_empty_e))) { - if (main->setting.flag & fss_read_main_flag_object_e) { + if ((main->setting.flag & fss_read_main_flag_object_d) || (main->setting.flag & fss_read_main_flag_content_d) && (main->setting.contents.array[at].used || (main->setting.flag & fss_read_main_flag_empty_d))) { + if (main->setting.flag & fss_read_main_flag_object_d) { if (main->callback.print_object) { main->callback.print_object(&main->program.output, at, delimits_object); } @@ -28,8 +28,8 @@ extern "C" { print_set_end = F_true; } - if (main->setting.flag & fss_read_main_flag_content_e) { - if (main->setting.flag & fss_read_main_flag_select_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { + if (main->setting.flag & fss_read_main_flag_select_d) { if (main->setting.contents.array[at].used) { if (main->setting.select < main->setting.contents.array[at].used) { if (main->setting.contents.array[at].array[main->setting.select].start <= main->setting.contents.array[at].array[main->setting.select].stop) { @@ -87,16 +87,16 @@ extern "C" { main->callback.print_content_ignore(&main->program.output); } - if (main->setting.flag & fss_read_main_flag_original_e) { - if (main->setting.flag & fss_read_main_flag_quote_content_e) { + if (main->setting.flag & fss_read_main_flag_original_d) { + if (main->setting.flag & fss_read_main_flag_quote_content_d) { fss_read_print_quote(&main->program.output, quote); } } fll_print_except_in_dynamic_partial(main->setting.buffer, range, delimits, main->setting.comments, print->to); - if (main->setting.flag & fss_read_main_flag_original_e) { - if (main->setting.flag & fss_read_main_flag_quote_content_e) { + if (main->setting.flag & fss_read_main_flag_original_d) { + if (main->setting.flag & fss_read_main_flag_quote_content_d) { fss_read_print_quote(&main->program.output, quote); } } @@ -116,7 +116,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->callback.print_set_end && (main->setting.flag & fss_read_main_flag_empty_e)) { + if (main->callback.print_set_end && (main->setting.flag & fss_read_main_flag_empty_d)) { main->callback.print_set_end(print); } @@ -131,7 +131,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { fll_print_dynamic_raw(fss_read_pipe_content_ignore_s, print->to); } @@ -159,8 +159,8 @@ extern "C" { if (at >= main->setting.objects.used) return F_output_not; - if (main->setting.flag & (fss_read_main_flag_trim_e | fss_read_main_flag_trim_object_e)) { - if (main->setting.flag & fss_read_main_flag_original_e) { + if (main->setting.flag & (fss_read_main_flag_trim_d | fss_read_main_flag_trim_object_d)) { + if (main->setting.flag & fss_read_main_flag_original_d) { if (main->setting.quotes_object.array[at]) { fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]); } @@ -176,7 +176,7 @@ extern "C" { } } else { - if (main->setting.flag & fss_read_main_flag_original_e) { + if (main->setting.flag & fss_read_main_flag_original_d) { if (main->setting.quotes_object.array[at]) { fss_read_print_quote(&main->program.output, main->setting.quotes_object.array[at]); } @@ -223,7 +223,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_e) ? fss_read_pipe_content_end_s : f_string_eol_s, print->to); + fll_print_dynamic_raw((main->setting.flag & fss_read_main_flag_pipe_format_d) ? fss_read_pipe_content_end_s : f_string_eol_s, print->to); return F_okay; } @@ -236,7 +236,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) print->custom; - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { fll_print_dynamic_raw(fss_read_pipe_content_end_s, print->to); } diff --git a/level_3/fss_read/c/main/process_normal.c b/level_3/fss_read/c/main/process_normal.c index 32c31ca..be9a5a6 100644 --- a/level_3/fss_read/c/main/process_normal.c +++ b/level_3/fss_read/c/main/process_normal.c @@ -16,8 +16,8 @@ extern "C" { // For depth, most standards do not support nesting, so any depth greater than 0 can be predicted without processing the buffer. // For select, most standards do not support multiple select, so any select greater than 0 can be predicted without processing the buffer. - if (!(main->setting.flag & fss_read_main_flag_depth_multiple_e) && main->setting.depths.array[0].depth || !(main->setting.flag & fss_read_main_flag_content_multiple_e) && ((main->setting.flag & fss_read_main_flag_select_e) && main->setting.select)) { - if (main->setting.flag & fss_read_main_flag_total_e) { + if (!(main->setting.flag & fss_read_main_flag_depth_multiple_d) && main->setting.depths.array[0].depth || !(main->setting.flag & fss_read_main_flag_content_multiple_d) && ((main->setting.flag & fss_read_main_flag_select_d) && main->setting.select)) { + if (main->setting.flag & fss_read_main_flag_total_d) { fss_read_print_number(&main->program.output, 0); } @@ -50,8 +50,8 @@ extern "C" { main->callback.process_load(main); if (F_status_is_error(main->setting.state.status)) return; - const f_number_unsigneds_t * const delimits_object = !(main->setting.flag & fss_read_main_flag_original_e) && fss_read_delimit_object_is(main, 0) ? &main->setting.delimits_object : &fss_read_except_none_c; - const f_number_unsigneds_t * const delimits_content = !(main->setting.flag & fss_read_main_flag_original_e) && fss_read_delimit_content_is(main, 0) ? &main->setting.delimits_content : &fss_read_except_none_c; + const f_number_unsigneds_t * const delimits_object = !(main->setting.flag & fss_read_main_flag_original_d) && fss_read_delimit_object_is(main, 0) ? &main->setting.delimits_object : &fss_read_except_none_c; + const f_number_unsigneds_t * const delimits_content = !(main->setting.flag & fss_read_main_flag_original_d) && fss_read_delimit_content_is(main, 0) ? &main->setting.delimits_content : &fss_read_except_none_c; bool names[main->setting.objects.used]; @@ -65,17 +65,17 @@ extern "C" { memset(names, F_true, sizeof(bool) * main->setting.objects.used); } - if (main->setting.flag & fss_read_main_flag_total_e) { + if (main->setting.flag & fss_read_main_flag_total_d) { if (main->callback.process_total) { main->callback.process_total(main, names); } } - else if (main->setting.flag & fss_read_main_flag_at_e) { + else if (main->setting.flag & fss_read_main_flag_at_d) { if (main->callback.process_at) { main->callback.process_at(main, names, *delimits_object, *delimits_content); } } - else if (main->setting.flag & fss_read_main_flag_columns_e) { + else if (main->setting.flag & fss_read_main_flag_columns_d) { if (main->callback.process_columns) { main->callback.process_columns(main, names); } @@ -83,7 +83,7 @@ extern "C" { else { f_number_unsigned_t i = 0; - if (main->setting.flag & fss_read_main_flag_line_e) { + if (main->setting.flag & fss_read_main_flag_line_d) { if (main->callback.process_at_line) { f_number_unsigned_t line = 0; @@ -122,7 +122,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) void_main; if (main->setting.depths.array[0].value_at >= main->setting.objects.used) { - if (main->setting.flag & (fss_read_main_flag_columns_e | fss_read_main_flag_total_e)) { + if (main->setting.flag & (fss_read_main_flag_columns_d | fss_read_main_flag_total_d)) { fss_read_print_number(&main->program.output, 0); } @@ -132,7 +132,7 @@ extern "C" { } // If the standard only has one line per Content, then any line value greater than 0 equates to no line to print. - if ((main->setting.flag & fss_read_main_flag_line_e) && (main->setting.flag & fss_read_main_flag_line_single_e)) { + if ((main->setting.flag & fss_read_main_flag_line_d) && (main->setting.flag & fss_read_main_flag_line_single_d)) { if (main->setting.line) { main->setting.state.status = F_okay; @@ -149,10 +149,10 @@ extern "C" { if (fss_read_signal_check(main)) return; if (at == main->setting.depths.array[0].value_at) { - if (main->setting.flag & fss_read_main_flag_line_e) { + if (main->setting.flag & fss_read_main_flag_line_d) { // If using "--at" for standards that only support one line per Object, then the only valid line is line 0. - if ((main->setting.flag & fss_read_main_flag_line_single_e) && !at) break; + if ((main->setting.flag & fss_read_main_flag_line_single_d) && !at) break; if (main->callback.process_at_line) { f_number_unsigned_t line = 0; @@ -160,7 +160,7 @@ extern "C" { main->callback.process_at_line(void_main, i, delimits_object, delimits_content, &line); } } - else if (main->setting.flag & fss_read_main_flag_columns_e) { + else if (main->setting.flag & fss_read_main_flag_columns_d) { fss_read_print_number(&main->program.output, main->setting.contents.array[i].used); } else if (main->callback.print_at) { @@ -179,7 +179,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) return; - if (main->setting.flag & fss_read_main_flag_total_e) { + if (main->setting.flag & fss_read_main_flag_total_d) { fss_read_print_number(&main->program.output, 0); } @@ -194,7 +194,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) void_main; - if (main->setting.flag & fss_read_main_flag_object_e) { + if (main->setting.flag & fss_read_main_flag_object_d) { if (*line == main->setting.line) { if (main->callback.print_object) { main->callback.print_object(&main->program.output, at, delimits_object); @@ -204,8 +204,8 @@ extern "C" { main->callback.print_object_end(&main->program.output); } - if (!(main->setting.flag & fss_read_main_flag_content_e)) { - if (!(main->setting.flag & fss_read_main_flag_object_as_line_e)) { + if (!(main->setting.flag & fss_read_main_flag_content_d)) { + if (!(main->setting.flag & fss_read_main_flag_object_as_line_d)) { if (main->callback.print_set_end) { main->callback.print_set_end(&main->program.output); } @@ -217,18 +217,18 @@ extern "C" { } } - if ((main->setting.flag & fss_read_main_flag_object_as_line_e) || !(main->setting.flag & fss_read_main_flag_content_e)) { + if ((main->setting.flag & fss_read_main_flag_object_as_line_d) || !(main->setting.flag & fss_read_main_flag_content_d)) { ++(*line); } } - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { if (!main->setting.contents.array[at].used) { // Must process/count line when both Object and Content share the same line but Content is empty for single line Content. - if ((main->setting.flag & fss_read_main_flag_line_single_e)) { - if (main->setting.flag & fss_read_main_flag_object_e) { - if (!(main->setting.flag & fss_read_main_flag_object_as_line_e)) { + if ((main->setting.flag & fss_read_main_flag_line_single_d)) { + if (main->setting.flag & fss_read_main_flag_object_d) { + if (!(main->setting.flag & fss_read_main_flag_object_as_line_d)) { if (*line == main->setting.line) { if (main->callback.print_set_end) { main->callback.print_set_end(&main->program.output); @@ -242,7 +242,7 @@ extern "C" { ++(*line); } } - else if (main->setting.flag & fss_read_main_flag_empty_e) { + else if (main->setting.flag & fss_read_main_flag_empty_d) { if (*line == main->setting.line) { if (main->callback.print_content_empty_set) { main->callback.print_content_empty_set(&main->program.output); @@ -277,7 +277,7 @@ extern "C" { f_number_unsigned_t i = 0; - if (main->setting.flag & fss_read_main_flag_line_single_e) { + if (main->setting.flag & fss_read_main_flag_line_single_d) { if (*line == main->setting.line) { while (main->setting.contents.array[at].used) { @@ -353,7 +353,7 @@ extern "C" { // @fixme The fll_fss_*_read functions do not have a store of the set closing ranges but should. // Simulate the ending by printing, but the original range should ideally be used (add new features to accomplish this). - if ((main->setting.flag & fss_read_main_flag_object_e) && (main->setting.flag & fss_read_main_flag_content_has_close_e)) { + if ((main->setting.flag & fss_read_main_flag_object_d) && (main->setting.flag & fss_read_main_flag_content_has_close_d)) { if (*line == main->setting.line) { if (main->callback.print_set_end) { main->callback.print_set_end(&main->program.output); @@ -379,7 +379,7 @@ extern "C" { fss_read_main_t * const main = (fss_read_main_t *) void_main; - if (!(main->setting.flag & fss_read_main_flag_content_e)) { + if (!(main->setting.flag & fss_read_main_flag_content_d)) { fss_read_print_number(&main->program.output, 0); main->setting.state.status = F_okay; @@ -389,7 +389,7 @@ extern "C" { f_number_unsigned_t max = 0; - if (main->setting.flag & fss_read_main_flag_content_multiple_e) { + if (main->setting.flag & fss_read_main_flag_content_multiple_d) { uint8_t has_at = F_false; for (f_number_unsigned_t at = 0; at < main->setting.contents.used; ++at) { @@ -404,7 +404,7 @@ extern "C" { } } // for - if (!max && has_at && (main->setting.flag & fss_read_main_flag_empty_e)) { + if (!max && has_at && (main->setting.flag & fss_read_main_flag_empty_d)) { max = 1; } } @@ -439,7 +439,7 @@ extern "C" { memset(names, F_false, sizeof(bool) * main->setting.objects.used); - if (main->setting.flag & (fss_read_main_flag_trim_e | fss_read_main_flag_trim_object_e | fss_read_main_flag_object_trim_e)) { + if (main->setting.flag & (fss_read_main_flag_trim_d | fss_read_main_flag_trim_object_d | fss_read_main_flag_object_trim_d)) { for (i = 0; i < main->setting.objects.used; ++i) { if (fss_read_signal_check(main)) return; @@ -478,24 +478,24 @@ extern "C" { f_number_unsigned_t total = 0; f_number_unsigned_t i = 0; - if (main->setting.flag & fss_read_main_flag_select_e) { + if (main->setting.flag & fss_read_main_flag_select_d) { for (; i < main->setting.contents.used; ++i) { if (!names[i]) continue; if (fss_read_signal_check(main)) return; - if (main->setting.flag & fss_read_main_flag_at_e) { + if (main->setting.flag & fss_read_main_flag_at_d) { if (main->setting.depths.array[0].value_at != i) continue; } if (main->setting.contents.array[i].used) { if (main->setting.select < main->setting.contents.array[i].used) { - if ((main->setting.flag & fss_read_main_flag_empty_e) || main->setting.contents.array[i].array[main->setting.select].start <= main->setting.contents.array[i].array[main->setting.select].stop) { + if ((main->setting.flag & fss_read_main_flag_empty_d) || main->setting.contents.array[i].array[main->setting.select].start <= main->setting.contents.array[i].array[main->setting.select].stop) { ++total; } } } - else if (!main->setting.select && (main->setting.flag & fss_read_main_flag_empty_e)) { + else if (!main->setting.select && (main->setting.flag & fss_read_main_flag_empty_d)) { ++total; } } // for @@ -506,12 +506,12 @@ extern "C" { if (!names[i]) continue; if (fss_read_signal_check(main)) return; - if (main->setting.flag & fss_read_main_flag_at_e) { + if (main->setting.flag & fss_read_main_flag_at_d) { if (main->setting.depths.array[0].value_at != i) continue; } - if (!(main->setting.flag & fss_read_main_flag_object_e) && (main->setting.flag & fss_read_main_flag_content_e)) { - if (!(main->setting.contents.array[i].used || (main->setting.flag & fss_read_main_flag_empty_e))) continue; + if (!(main->setting.flag & fss_read_main_flag_object_d) && (main->setting.flag & fss_read_main_flag_content_d)) { + if (!(main->setting.contents.array[i].used || (main->setting.flag & fss_read_main_flag_empty_d))) continue; } ++total; @@ -520,7 +520,7 @@ extern "C" { fss_read_print_number( &main->program.output, - main->setting.flag & fss_read_main_flag_line_e + main->setting.flag & fss_read_main_flag_line_d ? main->setting.line < total ? 1 : 0 : total ); @@ -547,15 +547,15 @@ extern "C" { if (!names[at]) continue; if (fss_read_signal_check(main)) return; - if (main->setting.flag & fss_read_main_flag_at_e) { + if (main->setting.flag & fss_read_main_flag_at_d) { if (main->setting.depths.array[0].value_at != at) continue; } - if (main->setting.flag & fss_read_main_flag_object_e) { + if (main->setting.flag & fss_read_main_flag_object_d) { ++total; } - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { if (!main->setting.contents.array[at].used) continue; for (i = 0; i < main->setting.contents.array[at].used; ++i) { @@ -583,13 +583,13 @@ extern "C" { } // for // If Content does not end with a newline, it still must be treated as the last line. - if ((main->setting.flag & fss_read_main_flag_line_single_e) && i) { + if ((main->setting.flag & fss_read_main_flag_line_single_d) && i) { j = main->setting.contents.array[at].array[i - 1].stop; if (main->setting.buffer.string[j] != f_string_eol_s.string[0]) ++total; } - if ((main->setting.flag & fss_read_main_flag_object_e) && (main->setting.flag & fss_read_main_flag_content_has_close_e)) { + if ((main->setting.flag & fss_read_main_flag_object_d) && (main->setting.flag & fss_read_main_flag_content_has_close_d)) { ++total; } } @@ -597,7 +597,7 @@ extern "C" { fss_read_print_number( &main->program.output, - main->setting.flag & fss_read_main_flag_line_e + main->setting.flag & fss_read_main_flag_line_d ? main->setting.line < total ? 1 : 0 : total ); diff --git a/level_3/fss_read/c/payload/fss_read.c b/level_3/fss_read/c/payload/fss_read.c index b5bbb0b..0b461ac 100644 --- a/level_3/fss_read/c/payload/fss_read.c +++ b/level_3/fss_read/c/payload/fss_read.c @@ -45,20 +45,20 @@ extern "C" { if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; if (main->setting.state.status == F_status_set_error(F_okay_stop) || main->setting.state.status == F_status_set_error(F_okay_eos)) { - if (main->setting.flag & fss_read_main_flag_payload_error_e) { + if (main->setting.flag & fss_read_main_flag_payload_error_d) { fss_read_payload_print_problem_payload_missing(&main->program.error); return; } - if (main->setting.flag & (fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e)) { + if (main->setting.flag & (fss_read_main_flag_payload_error_d | fss_read_main_flag_payload_warn_d)) { if (main->program.warning.verbosity > f_console_verbosity_normal_e) { fss_read_payload_print_problem_payload_missing(&main->program.warning); } main->setting.state.status = F_okay; } - else if (main->setting.flag & fss_read_main_flag_payload_create_e) { + else if (main->setting.flag & fss_read_main_flag_payload_create_d) { main->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { @@ -117,7 +117,7 @@ extern "C" { } if (main->setting.state.status == F_data_not_stop || main->setting.state.status == F_data_not_eos) { - if (!(main->setting.flag & fss_read_main_flag_total_e)) { + if (!(main->setting.flag & fss_read_main_flag_total_d)) { main->setting.state.status = F_status_set_warning(main->setting.state.status); return; @@ -158,20 +158,20 @@ extern "C" { f_string_static_t * const argv = main->program.parameters.arguments.array; if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_create_s) == F_equal_to) { - main->setting.flag |= fss_read_main_flag_payload_create_e; - main->setting.flag &= ~(fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e); + main->setting.flag |= fss_read_main_flag_payload_create_d; + main->setting.flag &= ~(fss_read_main_flag_payload_error_d | fss_read_main_flag_payload_warn_d); } else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_none_s) == F_equal_to) { - main->setting.flag |= fss_read_main_flag_payload_error_e; - main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_error_e | fss_read_main_flag_payload_warn_e); + main->setting.flag |= fss_read_main_flag_payload_error_d; + main->setting.flag &= ~(fss_read_main_flag_payload_create_d | fss_read_main_flag_payload_error_d | fss_read_main_flag_payload_warn_d); } else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_error_s) == F_equal_to) { - main->setting.flag |= fss_read_main_flag_payload_error_e; - main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_warn_e); + main->setting.flag |= fss_read_main_flag_payload_error_d; + main->setting.flag &= ~(fss_read_main_flag_payload_create_d | fss_read_main_flag_payload_warn_d); } else if (f_compare_dynamic(argv[values->array[values->used - 1]], fss_read_string_warn_s) == F_equal_to) { - main->setting.flag |= fss_read_main_flag_payload_warn_e; - main->setting.flag &= ~(fss_read_main_flag_payload_create_e | fss_read_main_flag_payload_error_e); + main->setting.flag |= fss_read_main_flag_payload_warn_d; + main->setting.flag &= ~(fss_read_main_flag_payload_create_d | fss_read_main_flag_payload_error_d); } else { main->setting.state.status = F_status_set_error(F_parameter); diff --git a/level_3/fss_read/c/payload/main.c b/level_3/fss_read/c/payload/main.c index e73ca61..8be3501 100644 --- a/level_3/fss_read/c/payload/main.c +++ b/level_3/fss_read/c/payload/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_read_main_t data = fss_read_main_t_initialize; - data.program.debug.flag |= fss_read_print_flag_debug_e | fss_read_print_flag_out_e; - data.program.error.flag |= fss_read_print_flag_error_e | fss_read_print_flag_out_e; - data.program.output.flag |= fss_read_print_flag_out_e; - data.program.message.flag |= fss_read_print_flag_message_e | fss_read_print_flag_out_e; - data.program.warning.flag |= fss_read_print_flag_warning_e | fss_read_print_flag_out_e; + data.program.debug.flag |= fss_read_print_flag_debug_d | fss_read_print_flag_out_d; + data.program.error.flag |= fss_read_print_flag_error_d | fss_read_print_flag_out_d; + data.program.output.flag |= fss_read_print_flag_out_d; + data.program.message.flag |= fss_read_print_flag_message_d | fss_read_print_flag_out_d; + data.program.warning.flag |= fss_read_print_flag_warning_d | fss_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -17,7 +17,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_read_main_flag_object_as_line_e | fss_read_main_flag_object_trim_e; + data.setting.flag |= fss_read_main_flag_object_as_line_d | fss_read_main_flag_object_trim_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_read_payload_standard_s; diff --git a/level_3/fss_read/c/payload/print.c b/level_3/fss_read/c/payload/print.c index 3685c89..91a39ac 100644 --- a/level_3/fss_read/c/payload/print.c +++ b/level_3/fss_read/c/payload/print.c @@ -13,11 +13,11 @@ extern "C" { f_file_stream_lock(print->to); - if (main->setting.flag & fss_read_main_flag_pipe_format_e) { + if (main->setting.flag & fss_read_main_flag_pipe_format_d) { f_print_dynamic_raw(fss_read_pipe_content_start_s, print->to); } else { - if (main->setting.flag & fss_read_main_flag_content_e) { + if (main->setting.flag & fss_read_main_flag_content_d) { f_print_dynamic_raw(f_fss_payload_list_open_s, print->to); f_print_dynamic_raw(f_fss_payload_list_open_end_s, print->to); } diff --git a/level_3/fss_write/c/basic/fss_write.c b/level_3/fss_write/c/basic/fss_write.c index 5c1d503..9876d08 100644 --- a/level_3/fss_write/c/basic/fss_write.c +++ b/level_3/fss_write/c/basic/fss_write.c @@ -15,7 +15,7 @@ extern "C" { if (main->setting.content) { fl_fss_basic_content_write( *main->setting.content, - (main->setting.flag & fss_write_main_flag_partial_e) + (main->setting.flag & fss_write_main_flag_partial_d) ? f_fss_complete_partial_e : f_fss_complete_full_e, &main->setting.range, @@ -38,8 +38,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_close_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { @@ -72,11 +72,11 @@ extern "C" { main->setting.quote.used ? main->setting.quote.string[0] : f_fss_quote_double_s.string[0], - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -99,8 +99,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_open_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { diff --git a/level_3/fss_write/c/basic/main.c b/level_3/fss_write/c/basic/main.c index a43fad0..2284eaf 100644 --- a/level_3/fss_write/c/basic/main.c +++ b/level_3/fss_write/c/basic/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/fss_write/c/basic_list/fss_write.c b/level_3/fss_write/c/basic_list/fss_write.c index 8eda6b7..076fdd4 100644 --- a/level_3/fss_write/c/basic_list/fss_write.c +++ b/level_3/fss_write/c/basic_list/fss_write.c @@ -15,9 +15,9 @@ extern "C" { if (main->setting.content) { fl_fss_basic_list_content_write( *main->setting.content, - (main->setting.flag & fss_write_main_flag_partial_e) + (main->setting.flag & fss_write_main_flag_partial_d) ? f_fss_complete_partial_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.prepend, @@ -41,8 +41,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { @@ -72,11 +72,11 @@ extern "C" { if (main->setting.object) { fl_fss_basic_list_object_write( *main->setting.object, - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -99,8 +99,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { diff --git a/level_3/fss_write/c/basic_list/main.c b/level_3/fss_write/c/basic_list/main.c index a1bf033..cd197e7 100644 --- a/level_3/fss_write/c/basic_list/main.c +++ b/level_3/fss_write/c/basic_list/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/fss_write/c/embedded_list/fss_write.c b/level_3/fss_write/c/embedded_list/fss_write.c index d2ab259..db551aa 100644 --- a/level_3/fss_write/c/embedded_list/fss_write.c +++ b/level_3/fss_write/c/embedded_list/fss_write.c @@ -15,7 +15,7 @@ extern "C" { if (main->setting.content) { fl_fss_embedded_list_content_write( *main->setting.content, - (main->setting.flag & fss_write_main_flag_partial_e) + (main->setting.flag & fss_write_main_flag_partial_d) ? f_fss_complete_partial_e : last ? f_fss_complete_end_e @@ -42,8 +42,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_embedded_list_close_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { @@ -77,11 +77,11 @@ extern "C" { if (main->setting.object) { fl_fss_embedded_list_object_write( *main->setting.object, - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -104,8 +104,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_embedded_list_open_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { diff --git a/level_3/fss_write/c/embedded_list/main.c b/level_3/fss_write/c/embedded_list/main.c index 6e39759..70a0fd7 100644 --- a/level_3/fss_write/c/embedded_list/main.c +++ b/level_3/fss_write/c/embedded_list/main.c @@ -5,19 +5,19 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_write_main_flag_ignore_e; - data.setting.flag |= fss_write_main_flag_content_multiple_e; + data.setting.flag |= fss_write_main_flag_ignore_d; + data.setting.flag |= fss_write_main_flag_content_multiple_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_embedded_list_standard_s; diff --git a/level_3/fss_write/c/extended/fss_write.c b/level_3/fss_write/c/extended/fss_write.c index 356060c..b1599f8 100644 --- a/level_3/fss_write/c/extended/fss_write.c +++ b/level_3/fss_write/c/extended/fss_write.c @@ -18,7 +18,7 @@ extern "C" { main->setting.quote.used ? main->setting.quote.string[0] : f_fss_quote_double_s.string[0], - (main->setting.flag & fss_write_main_flag_partial_e) + (main->setting.flag & fss_write_main_flag_partial_d) ? f_fss_complete_partial_e : last ? f_fss_complete_end_e @@ -43,15 +43,15 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_extended_close_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_append)); } } - else if (main->setting.flag & fss_write_main_flag_content_next_e) { + else if (main->setting.flag & fss_write_main_flag_content_next_d) { main->setting.state.status = f_string_dynamic_append(f_fss_extended_next_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { @@ -84,11 +84,11 @@ extern "C" { main->setting.quote.used ? main->setting.quote.string[0] : f_fss_quote_double_s.string[0], - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -111,8 +111,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_extended_open_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_append)); diff --git a/level_3/fss_write/c/extended/main.c b/level_3/fss_write/c/extended/main.c index 0cbd532..d26773d 100644 --- a/level_3/fss_write/c/extended/main.c +++ b/level_3/fss_write/c/extended/main.c @@ -5,18 +5,18 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; data.program.output.custom = (void *) &data; data.program.warning.custom = (void *) &data; - data.setting.flag |= fss_write_main_flag_content_multiple_e; + data.setting.flag |= fss_write_main_flag_content_multiple_d; data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_extended_standard_s; diff --git a/level_3/fss_write/c/extended_list/fss_write.c b/level_3/fss_write/c/extended_list/fss_write.c index 3a25a63..1bbbf38 100644 --- a/level_3/fss_write/c/extended_list/fss_write.c +++ b/level_3/fss_write/c/extended_list/fss_write.c @@ -15,7 +15,7 @@ extern "C" { if (main->setting.content) { fl_fss_extended_list_content_write( *main->setting.content, - (main->setting.flag & fss_write_main_flag_partial_e) + (main->setting.flag & fss_write_main_flag_partial_d) ? last ? f_fss_complete_none_e : f_fss_complete_partial_e @@ -42,8 +42,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_extended_list_close_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { @@ -77,11 +77,11 @@ extern "C" { if (main->setting.object) { fl_fss_extended_list_object_write( *main->setting.object, - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -104,8 +104,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_extended_list_open_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { diff --git a/level_3/fss_write/c/extended_list/main.c b/level_3/fss_write/c/extended_list/main.c index 1bf5bde..4e39132 100644 --- a/level_3/fss_write/c/extended_list/main.c +++ b/level_3/fss_write/c/extended_list/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; @@ -19,7 +19,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { data.setting.state.custom = (void *) &data; data.setting.standard = fss_write_extended_list_standard_s; - data.setting.flag |= fss_write_main_flag_ignore_e; + data.setting.flag |= fss_write_main_flag_ignore_d; data.callback.process_content = &fss_write_extended_list_process_content; data.callback.process_help = &fss_write_extended_list_process_help; diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index cf9877f..605d12e 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -42,22 +42,22 @@ extern "C" { main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= fss_write_main_flag_help_e; + main->setting.flag |= fss_write_main_flag_help_d; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= fss_write_main_flag_version_e; + main->setting.flag |= fss_write_main_flag_version_d; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= fss_write_main_flag_copyright_e; + main->setting.flag |= fss_write_main_flag_copyright_d; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= fss_write_main_flag_pipe_e; + main->setting.flag |= fss_write_main_flag_pipe_d; } else { - main->setting.flag &= ~fss_write_main_flag_pipe_e; + main->setting.flag &= ~fss_write_main_flag_pipe_d; } if (callback) { @@ -96,7 +96,7 @@ extern "C" { return; } - main->setting.flag |= fss_write_main_flag_file_to_e; + main->setting.flag |= fss_write_main_flag_file_to_d; } else if (main->program.parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -129,7 +129,7 @@ extern "C" { main->setting.objects.array[main->setting.objects.used++].size = 0; } // for - main->setting.flag |= fss_write_main_flag_object_e; + main->setting.flag |= fss_write_main_flag_object_d; } else if (main->program.parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -141,8 +141,8 @@ extern "C" { if ((main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_content_e].values.used) { - if (main->setting.flag & fss_write_main_flag_object_e) { - if (!(main->setting.flag & fss_write_main_flag_content_multiple_e)) { + if (main->setting.flag & fss_write_main_flag_object_d) { + if (!(main->setting.flag & fss_write_main_flag_content_multiple_d)) { if (main->program.parameters.array[fss_write_parameter_content_e].values.used > main->program.parameters.array[fss_write_parameter_object_e].values.used) { main->setting.state.status = F_status_set_error(F_support_not); @@ -216,7 +216,7 @@ extern "C" { ++main->setting.contentss.used; } - main->setting.flag |= fss_write_main_flag_content_e; + main->setting.flag |= fss_write_main_flag_content_d; } else if (main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -259,7 +259,7 @@ extern "C" { } // for } - main->setting.flag |= fss_write_main_flag_prepend_e; + main->setting.flag |= fss_write_main_flag_prepend_d; } else if (main->program.parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -279,7 +279,7 @@ extern "C" { } // Only process if the standard designates that the ingore is supported. - if (main->setting.flag & fss_write_main_flag_ignore_e) { + if (main->setting.flag & fss_write_main_flag_ignore_d) { f_number_unsigned_t stub_data_array[1] = { 0 }; f_number_unsigneds_t stub_data = macro_f_number_unsigneds_t_initialize_1(stub_data_array, 0, 1); @@ -430,11 +430,11 @@ extern "C" { else { // There is no Object or Content, so remove ignores if set. - main->setting.flag &= ~fss_write_main_flag_ignore_e; + main->setting.flag &= ~fss_write_main_flag_ignore_d; } if (main->program.parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) { - main->setting.flag |= fss_write_main_flag_partial_e; + main->setting.flag |= fss_write_main_flag_partial_d; } { @@ -445,9 +445,9 @@ extern "C" { }; const uint16_t has_flag[] = { - fss_write_main_flag_content_end_e, - fss_write_main_flag_content_next_e, - fss_write_main_flag_object_open_e, + fss_write_main_flag_content_end_d, + fss_write_main_flag_content_next_d, + fss_write_main_flag_object_open_d, }; const f_string_static_t has_string[] = { @@ -471,8 +471,8 @@ extern "C" { for (uint8_t i = 0; i < 3; ++i) { if (main->program.parameters.array[has[i]].result & f_console_result_found_e) { - if (main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) { - if (!(main->setting.flag & fss_write_main_flag_partial_e)) { + if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d)) { + if (!(main->setting.flag & fss_write_main_flag_partial_d)) { main->setting.state.status = F_status_set_error(F_parameter); if (main->program.error.verbosity > f_console_verbosity_quiet_e) { @@ -485,7 +485,7 @@ extern "C" { f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], - (main->setting.flag & fss_write_main_flag_object_e) + (main->setting.flag & fss_write_main_flag_object_d) ? fss_write_long_object_s : fss_write_long_content_s, fss_write_long_partial_s @@ -516,10 +516,10 @@ extern "C" { } // for } - if (main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e)) { - if (main->setting.flag & fss_write_main_flag_object_e) { - if (main->setting.flag & fss_write_main_flag_content_multiple_e) { - if (main->program.parameters.array[fss_write_parameter_object_e].locations_sub.used > main->program.parameters.array[fss_write_parameter_content_e].locations_sub.used && !(main->setting.flag & fss_write_main_flag_partial_e)) { + if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d)) { + if (main->setting.flag & fss_write_main_flag_object_d) { + if (main->setting.flag & fss_write_main_flag_content_multiple_d) { + if (main->program.parameters.array[fss_write_parameter_object_e].locations_sub.used > main->program.parameters.array[fss_write_parameter_content_e].locations_sub.used && !(main->setting.flag & fss_write_main_flag_partial_d)) { main->setting.state.status = F_status_set_error(F_parameter); fss_write_print_error_parameter_same_times_at_least(&main->program.error); @@ -528,7 +528,7 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_content_e) && (main->setting.flag & fss_write_main_flag_partial_e)) { + if ((main->setting.flag & fss_write_main_flag_content_d) && (main->setting.flag & fss_write_main_flag_partial_d)) { if (main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -579,10 +579,10 @@ extern "C" { } if (main->program.parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) { - main->setting.flag |= fss_write_main_flag_trim_e; + main->setting.flag |= fss_write_main_flag_trim_d; } - if (!(main->setting.flag & (fll_program_data_pipe_input_e | fss_write_main_flag_content_e | fss_write_parameter_object_e))) { + if (!(main->setting.flag & (fll_program_data_pipe_input_e | fss_write_main_flag_content_d | fss_write_parameter_object_e))) { main->setting.state.status = F_data_not; } } diff --git a/level_3/fss_write/c/main/common/define.h b/level_3/fss_write/c/main/common/define.h index f91dcca..d5e7ffc 100644 --- a/level_3/fss_write/c/main/common/define.h +++ b/level_3/fss_write/c/main/common/define.h @@ -33,6 +33,70 @@ extern "C" { #endif // _di_fss_write_allocation_d_ /** + * Flags passed to the main function or program. + * + * fss_write_main_flag_*_d: + * - none: No flags set. + * - content: The Content being written is specified. + * - content_end: The Content end characters are to be printed. + * - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object. + * - content_next: The Content next characters are to be printed. + * - copyright: Print copyright. + * - file_to: Using a specified destination file. + * - help: Print help. + * - ignore: Ignore a given range within a Content (specify flag before setting loading to designate ignores is supported by standard). + * - object: The Object being written is specified. + * - object_open: The Object open characters are to be printed. + * - partial: Do not write end of Object/Content character. + * - pipe: Use the input pipe. + * - trim: Trim Object names. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + */ +#ifndef _di_fss_write_main_flag_d_ + #define fss_write_main_flag_none_d 0x0 + #define fss_write_main_flag_content_d 0x1 + #define fss_write_main_flag_content_end_d 0x2 + #define fss_write_main_flag_content_multiple_d 0x4 + #define fss_write_main_flag_content_next_d 0x8 + #define fss_write_main_flag_copyright_d 0x10 + #define fss_write_main_flag_file_to_d 0x20 + #define fss_write_main_flag_help_d 0x40 + #define fss_write_main_flag_ignore_d 0x80 + #define fss_write_main_flag_object_d 0x100 + #define fss_write_main_flag_object_open_d 0x200 + #define fss_write_main_flag_partial_d 0x400 + #define fss_write_main_flag_pipe_d 0x800 + #define fss_write_main_flag_prepend_d 0x1000 + #define fss_write_main_flag_trim_d 0x2000 + #define fss_write_main_flag_version_d 0x4000 + #define fss_write_main_flag_version_copyright_help_d 0x4050 +#endif // _di_fss_write_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * fss_write_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_fss_write_print_flag_d_ + #define fss_write_print_flag_none_d 0x0 + #define fss_write_print_flag_debug_d 0x1 + #define fss_write_print_flag_error_d 0x2 + #define fss_write_print_flag_file_d 0x4 + #define fss_write_print_flag_in_d 0x8 + #define fss_write_print_flag_out_d 0x10 + #define fss_write_print_flag_message_d 0x20 + #define fss_write_print_flag_warning_d 0x40 +#endif // _di_fss_write_print_flag_d_ + +/** * The program signal defines. * * fss_write_signal_*_d: diff --git a/level_3/fss_write/c/main/common/enumeration.h b/level_3/fss_write/c/main/common/enumeration.h index 9d7c570..3b46c04 100644 --- a/level_3/fss_write/c/main/common/enumeration.h +++ b/level_3/fss_write/c/main/common/enumeration.h @@ -17,49 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * fss_write_main_flag_*_e: - * - none: No flags set. - * - content: The Content being written is specified. - * - content_end: The Content end characters are to be printed. - * - content_multiple: Designate that multiple Content is allowed for an Object for this standard rather than a single Content per Object. - * - content_next: The Content next characters are to be printed. - * - copyright: Print copyright. - * - file_to: Using a specified destination file. - * - help: Print help. - * - ignore: Ignore a given range within a Content (specify flag before setting loading to designate ignores is supported by standard). - * - object: The Object being written is specified. - * - object_open: The Object open characters are to be printed. - * - partial: Do not write end of Object/Content character. - * - pipe: Use the input pipe. - * - trim: Trim Object names. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_fss_write_main_flag_e_ - enum { - fss_write_main_flag_none_e = 0x0, - fss_write_main_flag_content_e = 0x1, - fss_write_main_flag_content_end_e = 0x2, - fss_write_main_flag_content_multiple_e = 0x4, - fss_write_main_flag_content_next_e = 0x8, - fss_write_main_flag_copyright_e = 0x10, - fss_write_main_flag_file_to_e = 0x20, - fss_write_main_flag_help_e = 0x40, - fss_write_main_flag_ignore_e = 0x80, - fss_write_main_flag_object_e = 0x100, - fss_write_main_flag_object_open_e = 0x200, - fss_write_main_flag_partial_e = 0x400, - fss_write_main_flag_pipe_e = 0x800, - fss_write_main_flag_prepend_e = 0x1000, - fss_write_main_flag_trim_e = 0x2000, - fss_write_main_flag_version_e = 0x4000, - fss_write_main_flag_version_copyright_help_e = 0x4050, - }; // enum -#endif // _di_fss_write_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_fss_write_parameter_e_ @@ -103,31 +60,6 @@ extern "C" { #define fss_write_parameter_total_d (f_console_parameter_state_type_total_d + 14) #endif // _di_fss_write_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * fss_write_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_fss_write_print_flag_e_ - enum { - fss_write_print_flag_none_e = 0x0, - fss_write_print_flag_debug_e = 0x1, - fss_write_print_flag_error_e = 0x2, - fss_write_print_flag_file_e = 0x4, - fss_write_print_flag_in_e = 0x8, - fss_write_print_flag_out_e = 0x10, - fss_write_print_flag_message_e = 0x20, - fss_write_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_fss_write_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_write/c/main/common/type.h b/level_3/fss_write/c/main/common/type.h index 26fd8d2..b8a9055 100644 --- a/level_3/fss_write/c/main/common/type.h +++ b/level_3/fss_write/c/main/common/type.h @@ -107,7 +107,7 @@ extern "C" { #define fss_write_setting_t_initialize \ { \ - fss_write_main_flag_none_e, \ + fss_write_main_flag_none_d, \ F_okay, \ macro_f_state_t_initialize_1(fss_write_allocation_large_d, fss_write_allocation_small_d, F_okay, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0, 0), \ f_range_t_initialize, \ diff --git a/level_3/fss_write/c/main/fss_write.c b/level_3/fss_write/c/main/fss_write.c index 8c93517..5370ac4 100644 --- a/level_3/fss_write/c/main/fss_write.c +++ b/level_3/fss_write/c/main/fss_write.c @@ -15,8 +15,8 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & fss_write_main_flag_version_copyright_help_e) { - if (main->setting.flag & fss_write_main_flag_help_e) { + if (main->setting.flag & fss_write_main_flag_version_copyright_help_d) { + if (main->setting.flag & fss_write_main_flag_help_d) { if (main->callback.process_help) { main->callback.process_help(void_main); } @@ -24,24 +24,24 @@ extern "C" { fss_write_print_message_help(&main->program.message); } } - else if (main->setting.flag & fss_write_main_flag_version_e) { + else if (main->setting.flag & fss_write_main_flag_version_d) { fll_program_print_version(&main->program.message, fss_write_program_version_s); } - else if (main->setting.flag & fss_write_main_flag_copyright_e) { + else if (main->setting.flag & fss_write_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if (main->setting.flag & fss_write_main_flag_pipe_e) { + if (main->setting.flag & fss_write_main_flag_pipe_d) { if (main->callback.process_pipe) { main->callback.process_pipe(void_main); } } if (F_status_is_error_not(main->setting.state.status)) { - if (main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e | fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) { + if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d | fss_write_main_flag_object_open_d | fss_write_main_flag_content_next_d | fss_write_main_flag_content_end_d)) { if (main->callback.process_normal) { main->callback.process_normal(void_main); } @@ -57,7 +57,7 @@ extern "C" { fss_write_process_normal_data( (fss_write_main_t *) void_main, - (((fss_write_main_t *) void_main)->setting.flag & fss_write_main_flag_object_e) + (((fss_write_main_t *) void_main)->setting.flag & fss_write_main_flag_object_d) ? ((fss_write_main_t *) void_main)->setting.objects.used : ((fss_write_main_t *) void_main)->setting.contentss.used ); @@ -107,7 +107,7 @@ extern "C" { } // for } else { - if (main->setting.flag & (fss_write_main_flag_object_open_e | fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e)) { + if (main->setting.flag & (fss_write_main_flag_object_open_d | fss_write_main_flag_content_next_d | fss_write_main_flag_content_end_d)) { main->setting.object = 0; main->setting.contents = 0; main->setting.ignores = 0; @@ -299,7 +299,7 @@ extern "C" { // Check to see if the Content supports multiple Content per Object. if (flag & 0x4) { - if (!(main->setting.flag & fss_write_main_flag_content_multiple_e)) { + if (!(main->setting.flag & fss_write_main_flag_content_multiple_d)) { main->setting.state.status = F_status_set_error(F_support_not); fss_write_print_error_one_content_only(&main->program.error); @@ -337,7 +337,7 @@ extern "C" { // Do not handle start/end while inside an ignore set. if (!(flag & 0x2)) { if (main->setting.block.string[range.start] == fss_write_pipe_content_start_s.string[0]) { - if (!(main->setting.flag & fss_write_main_flag_content_multiple_e)) { + if (!(main->setting.flag & fss_write_main_flag_content_multiple_d)) { main->setting.state.status = F_status_set_error(F_support_not); fss_write_print_error_one_content_only(&main->program.error); @@ -439,7 +439,7 @@ extern "C" { main->setting.buffer.used = 0; - if ((!(main->setting.flag & fss_write_main_flag_partial_e) || (main->setting.flag & fss_write_main_flag_partial_e) && (main->setting.flag & fss_write_main_flag_object_e)) && main->setting.object || (main->setting.flag & fss_write_main_flag_object_open_e)) { + if ((!(main->setting.flag & fss_write_main_flag_partial_d) || (main->setting.flag & fss_write_main_flag_partial_d) && (main->setting.flag & fss_write_main_flag_object_d)) && main->setting.object || (main->setting.flag & fss_write_main_flag_object_open_d)) { if (main->setting.object) { if (main->setting.object->used) { @@ -458,7 +458,7 @@ extern "C" { } } - if ((!(main->setting.flag & fss_write_main_flag_partial_e) || (main->setting.flag & fss_write_main_flag_partial_e) && (main->setting.flag & fss_write_main_flag_content_e)) && main->setting.contents || (main->setting.flag & (fss_write_main_flag_content_next_e | fss_write_main_flag_content_end_e))) { + if ((!(main->setting.flag & fss_write_main_flag_partial_d) || (main->setting.flag & fss_write_main_flag_partial_d) && (main->setting.flag & fss_write_main_flag_content_d)) && main->setting.contents || (main->setting.flag & (fss_write_main_flag_content_next_d | fss_write_main_flag_content_end_d))) { if (main->callback.process_content) { if (main->setting.contents && main->setting.contents->used) { diff --git a/level_3/fss_write/c/main/main.c b/level_3/fss_write/c/main/main.c index b5638c1..b59c018 100644 --- a/level_3/fss_write/c/main/main.c +++ b/level_3/fss_write/c/main/main.c @@ -12,11 +12,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; @@ -94,7 +94,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { #ifndef _di_fss_write_main_setting_load_as_ void fss_write_main_setting_load_as(const f_console_arguments_t arguments, fss_write_main_t * const main) { - if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_write_main_flag_version_e)) return; + if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_write_main_flag_version_d)) return; main->setting.standard = fss_write_basic_standard_s; @@ -122,7 +122,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_basic_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e); + main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d); main->callback.process_content = &fss_write_basic_process_content; main->callback.process_help = &fss_write_basic_process_help; @@ -139,8 +139,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_extended_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_write_main_flag_ignore_e; - main->setting.flag |= fss_write_main_flag_content_multiple_e; + main->setting.flag &= ~fss_write_main_flag_ignore_d; + main->setting.flag |= fss_write_main_flag_content_multiple_d; main->callback.process_content = &fss_write_extended_process_content; main->callback.process_help = &fss_write_extended_process_help; @@ -157,7 +157,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_basic_list_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e); + main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d); main->callback.process_content = &fss_write_basic_list_process_content; main->callback.process_help = &fss_write_basic_list_process_help; @@ -174,8 +174,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_extended_list_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~fss_write_main_flag_content_multiple_e; - main->setting.flag |= fss_write_main_flag_ignore_e; + main->setting.flag &= ~fss_write_main_flag_content_multiple_d; + main->setting.flag |= fss_write_main_flag_ignore_d; main->callback.process_content = &fss_write_extended_list_process_content; main->callback.process_help = &fss_write_extended_list_process_help; @@ -191,8 +191,8 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_embedded_list_standard_s; - main->setting.flag |= fss_write_main_flag_ignore_e; - main->setting.flag |= fss_write_main_flag_content_multiple_e; + main->setting.flag |= fss_write_main_flag_ignore_d; + main->setting.flag |= fss_write_main_flag_content_multiple_d; main->callback.process_content = &fss_write_embedded_list_process_content; main->callback.process_help = &fss_write_embedded_list_process_help; @@ -209,7 +209,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->setting.standard = fss_write_payload_standard_s; // Remove flags not supported for this standard. - main->setting.flag &= ~(fss_write_main_flag_ignore_e | fss_write_main_flag_content_multiple_e); + main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d); main->callback.process_content = 0; main->callback.process_help = &fss_write_payload_process_help; @@ -219,7 +219,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { main->callback.process_set = &fss_write_payload_process_set; } else { - if (main->setting.flag & fss_write_main_flag_help_e) { + if (main->setting.flag & fss_write_main_flag_help_d) { main->setting.state.status = F_status_set_error(F_parameter); break; @@ -232,7 +232,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { } // for if (F_status_is_error(main->setting.state.status)) { - if (main->setting.flag & fss_write_main_flag_help_e) { + if (main->setting.flag & fss_write_main_flag_help_d) { fss_write_main_process_help((void *) main); } @@ -242,7 +242,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { else if (main->program.parameters.array[fss_write_parameter_as_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); - if (main->setting.flag & fss_write_main_flag_help_e) { + if (main->setting.flag & fss_write_main_flag_help_d) { fss_write_main_process_help((void *) main); return; diff --git a/level_3/fss_write/c/payload/fss_write.c b/level_3/fss_write/c/payload/fss_write.c index 4a4f907..cbb6389 100644 --- a/level_3/fss_write/c/payload/fss_write.c +++ b/level_3/fss_write/c/payload/fss_write.c @@ -190,7 +190,7 @@ extern "C" { // Check to see if the Content supports multiple Content per Object. if (flag & 0x4) { - if (!(main->setting.flag & fss_write_main_flag_content_multiple_e)) { + if (!(main->setting.flag & fss_write_main_flag_content_multiple_d)) { main->setting.state.status = F_status_set_error(F_support_not); fss_write_print_error_one_content_only(&main->program.error); @@ -385,8 +385,8 @@ extern "C" { fss_write_main_t * const main = (fss_write_main_t *) void_main; - if ((!(main->setting.flag & fss_write_main_flag_partial_e) || (main->setting.flag & fss_write_main_flag_partial_e) && (main->setting.flag & fss_write_main_flag_object_e))) { - if (main->setting.object && !(main->setting.flag & fss_write_main_flag_partial_e) && main->setting.contents && main->setting.contents->used) { + if ((!(main->setting.flag & fss_write_main_flag_partial_d) || (main->setting.flag & fss_write_main_flag_partial_d) && (main->setting.flag & fss_write_main_flag_object_d))) { + if (main->setting.object && !(main->setting.flag & fss_write_main_flag_partial_d) && main->setting.contents && main->setting.contents->used) { if (main->setting.object->used) { main->setting.range.start = 0; main->setting.range.stop = main->setting.object->used - 1; @@ -399,8 +399,8 @@ extern "C" { fll_fss_payload_write( *main->setting.object, main->setting.contents->array[0], - (main->setting.flag & fss_write_main_flag_trim_e), - (main->setting.flag & fss_write_main_flag_prepend_e) + (main->setting.flag & fss_write_main_flag_trim_d), + (main->setting.flag & fss_write_main_flag_prepend_d) ? &main->setting.prepend : 0, &main->setting.buffer, @@ -434,11 +434,11 @@ extern "C" { fl_fss_basic_list_object_write( *main->setting.object, - (main->setting.flag & fss_write_main_flag_partial_e) - ? (main->setting.flag & fss_write_main_flag_trim_e) + (main->setting.flag & fss_write_main_flag_partial_d) + ? (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_trim_e : f_fss_complete_none_e - : (main->setting.flag & fss_write_main_flag_trim_e) + : (main->setting.flag & fss_write_main_flag_trim_d) ? f_fss_complete_full_trim_e : f_fss_complete_full_e, &main->setting.range, @@ -461,8 +461,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_content_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_object_open_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_content_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_object_open_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_open_s, &main->setting.buffer); if (F_status_is_error_not(main->setting.state.status)) { @@ -485,7 +485,7 @@ extern "C" { const f_string_static_t *prepend = 0; - if (main->setting.flag & fss_write_main_flag_prepend_e) { + if (main->setting.flag & fss_write_main_flag_prepend_d) { const f_number_unsigned_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].values.used - 1]; prepend = &main->program.parameters.arguments.array[index]; @@ -509,8 +509,8 @@ extern "C" { } } - if ((main->setting.flag & fss_write_main_flag_partial_e) && !(main->setting.flag & fss_write_main_flag_object_e) || !(main->setting.flag & (fss_write_main_flag_object_e | fss_write_main_flag_content_e))) { - if (main->setting.flag & fss_write_main_flag_content_end_e) { + if ((main->setting.flag & fss_write_main_flag_partial_d) && !(main->setting.flag & fss_write_main_flag_object_d) || !(main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d))) { + if (main->setting.flag & fss_write_main_flag_content_end_d) { main->setting.state.status = f_string_dynamic_append(f_fss_basic_list_close_s, &main->setting.buffer); if (F_status_is_error(main->setting.state.status)) { diff --git a/level_3/fss_write/c/payload/main.c b/level_3/fss_write/c/payload/main.c index 7bf3a6c..f9ae3f5 100644 --- a/level_3/fss_write/c/payload/main.c +++ b/level_3/fss_write/c/payload/main.c @@ -5,11 +5,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fss_write_main_t data = fss_write_main_t_initialize; - data.program.debug.flag |= fss_write_print_flag_debug_e | fss_write_print_flag_out_e; - data.program.error.flag |= fss_write_print_flag_error_e | fss_write_print_flag_out_e; - data.program.output.flag |= fss_write_print_flag_out_e; - data.program.message.flag |= fss_write_print_flag_message_e | fss_write_print_flag_out_e; - data.program.warning.flag |= fss_write_print_flag_warning_e | fss_write_print_flag_out_e; + data.program.debug.flag |= fss_write_print_flag_debug_d | fss_write_print_flag_out_d; + data.program.error.flag |= fss_write_print_flag_error_d | fss_write_print_flag_out_d; + data.program.output.flag |= fss_write_print_flag_out_d; + data.program.message.flag |= fss_write_print_flag_message_d | fss_write_print_flag_out_d; + data.program.warning.flag |= fss_write_print_flag_warning_d | fss_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 67eb536..5d409ff 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -38,28 +38,28 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= iki_read_main_flag_help_e; + main->setting.flag |= iki_read_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= iki_read_main_flag_version_e; + main->setting.flag |= iki_read_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= iki_read_main_flag_copyright_e; + main->setting.flag |= iki_read_main_flag_copyright_d; return; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= iki_read_main_flag_pipe_e; + main->setting.flag |= iki_read_main_flag_pipe_d; } else { - main->setting.flag &= ~iki_read_main_flag_pipe_e; + main->setting.flag &= ~iki_read_main_flag_pipe_d; } if (!(main->program.parameters.remaining.used || (main->program.pipe & fll_program_data_pipe_input_e))) { @@ -98,7 +98,7 @@ extern "C" { return; } - main->setting.flag |= iki_read_main_flag_at_e; + main->setting.flag |= iki_read_main_flag_at_d; } else if (main->program.parameters.array[iki_read_parameter_at_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -128,7 +128,7 @@ extern "C" { return; } - main->setting.flag |= iki_read_main_flag_line_e; + main->setting.flag |= iki_read_main_flag_line_d; } else if (main->program.parameters.array[iki_read_parameter_line_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -180,7 +180,7 @@ extern "C" { return; } - main->setting.flag |= iki_read_main_flag_name_e; + main->setting.flag |= iki_read_main_flag_name_d; } else if (main->program.parameters.array[iki_read_parameter_name_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -258,17 +258,17 @@ extern "C" { } } // for - main->setting.flag |= iki_read_main_flag_replace_e; + main->setting.flag |= iki_read_main_flag_replace_d; } if (iki_read_setting_load_parameter_substitution(main, main->program.parameters.array[iki_read_parameter_reassign_e], iki_read_long_reassign_s, &main->setting.reassign)) { - main->setting.flag |= iki_read_main_flag_reassign_e; + main->setting.flag |= iki_read_main_flag_reassign_d; } if (F_status_is_error(main->setting.state.status)) return; if (iki_read_setting_load_parameter_substitution(main, main->program.parameters.array[iki_read_parameter_substitute_e], iki_read_long_substitute_s, &main->setting.substitute)) { - main->setting.flag |= iki_read_main_flag_substitute_e; + main->setting.flag |= iki_read_main_flag_substitute_d; } if (F_status_is_error(main->setting.state.status)) return; @@ -351,7 +351,7 @@ extern "C" { } } // for - main->setting.flag |= iki_read_main_flag_wrap_e; + main->setting.flag |= iki_read_main_flag_wrap_d; } if (main->program.parameters.array[iki_read_parameter_literal_e].result & f_console_result_found_e) { @@ -378,7 +378,7 @@ extern "C" { } } // for - main->setting.flag |= iki_read_main_flag_literal_e; + main->setting.flag |= iki_read_main_flag_literal_d; } else if (main->program.parameters.array[iki_read_parameter_object_e].result & f_console_result_found_e) { const uint8_t ids[2] = { @@ -402,7 +402,7 @@ extern "C" { } } // for - main->setting.flag |= iki_read_main_flag_object_e; + main->setting.flag |= iki_read_main_flag_object_d; } else if (main->program.parameters.array[iki_read_parameter_content_e].result & f_console_result_found_e) { if (main->program.parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) { @@ -413,7 +413,7 @@ extern "C" { return; } - main->setting.flag |= iki_read_main_flag_content_e; + main->setting.flag |= iki_read_main_flag_content_d; } else if (main->program.parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) { if (main->program.parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) { @@ -424,16 +424,16 @@ extern "C" { return; } - main->setting.flag |= iki_read_main_flag_total_e; + main->setting.flag |= iki_read_main_flag_total_d; } else { // This is the default behavior. - main->setting.flag |= iki_read_main_flag_content_e; + main->setting.flag |= iki_read_main_flag_content_d; } if (main->program.parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) { - main->setting.flag |= iki_read_main_flag_whole_e; + main->setting.flag |= iki_read_main_flag_whole_d; } if (main->program.parameters.remaining.used) { diff --git a/level_3/iki_read/c/main/common/define.h b/level_3/iki_read/c/main/common/define.h index 4619318..bc7f74c 100644 --- a/level_3/iki_read/c/main/common/define.h +++ b/level_3/iki_read/c/main/common/define.h @@ -40,11 +40,78 @@ extern "C" { * - read_small: The block read size for small files. * - read_large: The block read size for large files. */ -#ifndef _di_iki_read_d_ +#ifndef _di_iki_read_block_d_ #define iki_read_block_max_d 16777216 #define iki_read_block_read_small_d 8192 #define iki_read_block_read_large_d 65536 -#endif // _di_iki_read_d_ +#endif // _di_iki_read_block_d_ + +/** + * Flags passed to the main function or program. + * + * iki_read_main_flag_*_d: + * - none: No flags set. + * - at: Selecting at a specific index. + * - content: Print Contents. + * - copyright: Print copyright. + * - help: Print help. + * - literal: Print as literal data (printing entire variable). + * - line: Selecting at a specific line. + * - name: Selecting using a specific Vocabulary name. + * - object: Print Objects. + * - pipe: Use the input pipe. + * - replace: Using re-assignments. + * - replace: Using replacements. + * - substitute: Using substitutions. + * - total: Enable printing of "total" count. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + * - whole: Print all data. + * - wrap: Using wrapping. + */ +#ifndef _di_iki_read_main_flag_d_ + #define iki_read_main_flag_none_d 0x0 + #define iki_read_main_flag_at_d 0x1 + #define iki_read_main_flag_content_d 0x2 + #define iki_read_main_flag_copyright_d 0x4 + #define iki_read_main_flag_help_d 0x8 + #define iki_read_main_flag_literal_d 0x10 + #define iki_read_main_flag_line_d 0x20 + #define iki_read_main_flag_name_d 0x40 + #define iki_read_main_flag_object_d 0x80 + #define iki_read_main_flag_pipe_d 0x100 + #define iki_read_main_flag_reassign_d 0x200 + #define iki_read_main_flag_replace_d 0x400 + #define iki_read_main_flag_substitute_d 0x800 + #define iki_read_main_flag_total_d 0x1000 + #define iki_read_main_flag_version_d 0x2000 + #define iki_read_main_flag_version_copyright_help_d 0x200c + #define iki_read_main_flag_whole_d 0x4000 + #define iki_read_main_flag_wrap_d 0x8000 +#endif // _di_iki_read_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * iki_read_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_iki_read_print_flag_d_ + #define iki_read_print_flag_none_d 0x0 + #define iki_read_print_flag_debug_d 0x1 + #define iki_read_print_flag_error_d 0x2 + #define iki_read_print_flag_file_d 0x4 + #define iki_read_print_flag_in_d 0x8 + #define iki_read_print_flag_out_d 0x10 + #define iki_read_print_flag_message_d 0x20 + #define iki_read_print_flag_warning_d 0x40 +#endif // _di_iki_read_print_flag_d_ /** * The program signal defines. diff --git a/level_3/iki_read/c/main/common/enumeration.h b/level_3/iki_read/c/main/common/enumeration.h index 9ee038d..015b47f 100644 --- a/level_3/iki_read/c/main/common/enumeration.h +++ b/level_3/iki_read/c/main/common/enumeration.h @@ -17,52 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * iki_read_main_flag_*_e: - * - none: No flags set. - * - at: Selecting at a specific index. - * - content: Print Contents. - * - copyright: Print copyright. - * - help: Print help. - * - literal: Print as literal data (printing entire variable). - * - line: Selecting at a specific line. - * - name: Selecting using a specific Vocabulary name. - * - object: Print Objects. - * - pipe: Use the input pipe. - * - replace: Using re-assignments. - * - replace: Using replacements. - * - substitute: Using substitutions. - * - total: Enable printing of "total" count. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - whole: Print all data. - * - wrap: Using wrapping. - */ -#ifndef _di_iki_read_main_flag_e_ - enum { - iki_read_main_flag_none_e = 0x0, - iki_read_main_flag_at_e = 0x1, - iki_read_main_flag_content_e = 0x2, - iki_read_main_flag_copyright_e = 0x4, - iki_read_main_flag_help_e = 0x8, - iki_read_main_flag_literal_e = 0x10, - iki_read_main_flag_line_e = 0x20, - iki_read_main_flag_name_e = 0x40, - iki_read_main_flag_object_e = 0x80, - iki_read_main_flag_pipe_e = 0x100, - iki_read_main_flag_reassign_e = 0x200, - iki_read_main_flag_replace_e = 0x400, - iki_read_main_flag_substitute_e = 0x800, - iki_read_main_flag_total_e = 0x1000, - iki_read_main_flag_version_e = 0x2000, - iki_read_main_flag_version_copyright_help_e = 0x200c, - iki_read_main_flag_whole_e = 0x4000, - iki_read_main_flag_wrap_e = 0x8000, - }; // enum -#endif // _di_iki_read_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_iki_read_parameter_e_ @@ -102,31 +56,6 @@ extern "C" { #define iki_read_parameter_total_d (f_console_parameter_state_type_total_d + 12) #endif // _di_iki_read_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * iki_read_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_iki_read_print_flag_e_ - enum { - iki_read_print_flag_none_e = 0x0, - iki_read_print_flag_debug_e = 0x1, - iki_read_print_flag_error_e = 0x2, - iki_read_print_flag_file_e = 0x4, - iki_read_print_flag_in_e = 0x8, - iki_read_print_flag_out_e = 0x10, - iki_read_print_flag_message_e = 0x20, - iki_read_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_iki_read_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/common/type.h b/level_3/iki_read/c/main/common/type.h index 3fe16d9..870ecfc 100644 --- a/level_3/iki_read/c/main/common/type.h +++ b/level_3/iki_read/c/main/common/type.h @@ -72,7 +72,7 @@ extern "C" { #define iki_read_setting_t_initialize \ { \ - iki_read_main_flag_none_e, \ + iki_read_main_flag_none_d, \ F_okay, \ macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_okay, 0, 0, 0, 0, 0, 0, 0), \ 0, \ diff --git a/level_3/iki_read/c/main/identify.c b/level_3/iki_read/c/main/identify.c index 054790e..304d551 100644 --- a/level_3/iki_read/c/main/identify.c +++ b/level_3/iki_read/c/main/identify.c @@ -11,7 +11,7 @@ extern "C" { f_number_unsigned_t i = 0; - if (main->setting.flag & (iki_read_main_flag_content_e | iki_read_main_flag_literal_e)) { + if (main->setting.flag & (iki_read_main_flag_content_d | iki_read_main_flag_literal_d)) { f_number_unsigned_t j = 0; for (i = 0; i < main->setting.data.vocabulary.used; ++i) { diff --git a/level_3/iki_read/c/main/iki_read.c b/level_3/iki_read/c/main/iki_read.c index d2f3b42..844bd70 100644 --- a/level_3/iki_read/c/main/iki_read.c +++ b/level_3/iki_read/c/main/iki_read.c @@ -11,21 +11,21 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & iki_read_main_flag_version_copyright_help_e) { - if (main->setting.flag & iki_read_main_flag_help_e) { + if (main->setting.flag & iki_read_main_flag_version_copyright_help_d) { + if (main->setting.flag & iki_read_main_flag_help_d) { iki_read_print_message_help(&main->program.message); } - else if (main->setting.flag & iki_read_main_flag_version_e) { + else if (main->setting.flag & iki_read_main_flag_version_d) { fll_program_print_version(&main->program.message, iki_read_program_version_s); } - else if (main->setting.flag & iki_read_main_flag_copyright_e) { + else if (main->setting.flag & iki_read_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } return; } - if (main->setting.flag & iki_read_main_flag_pipe_e) { + if (main->setting.flag & iki_read_main_flag_pipe_d) { f_file_t file = f_file_t_initialize; file.id = F_type_descriptor_input_d; diff --git a/level_3/iki_read/c/main/main.c b/level_3/iki_read/c/main/main.c index 7017a2e..a1cc4eb 100644 --- a/level_3/iki_read/c/main/main.c +++ b/level_3/iki_read/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { iki_read_main_t data = iki_read_main_t_initialize; - data.program.debug.flag |= iki_read_print_flag_debug_e | iki_read_print_flag_out_e; - data.program.error.flag |= iki_read_print_flag_error_e | iki_read_print_flag_out_e; - data.program.output.flag |= iki_read_print_flag_out_e; - data.program.message.flag |= iki_read_print_flag_message_e | iki_read_print_flag_out_e; - data.program.warning.flag |= iki_read_print_flag_warning_e | iki_read_print_flag_out_e; + data.program.debug.flag |= iki_read_print_flag_debug_d | iki_read_print_flag_out_d; + data.program.error.flag |= iki_read_print_flag_error_d | iki_read_print_flag_out_d; + data.program.output.flag |= iki_read_print_flag_out_d; + data.program.message.flag |= iki_read_print_flag_message_d | iki_read_print_flag_out_d; + data.program.warning.flag |= iki_read_print_flag_warning_d | iki_read_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/iki_read/c/main/print/data.c b/level_3/iki_read/c/main/print/data.c index 3d2e7a9..78c4afd 100644 --- a/level_3/iki_read/c/main/print/data.c +++ b/level_3/iki_read/c/main/print/data.c @@ -13,12 +13,12 @@ extern "C" { f_number_unsigned_t at = main->setting.reassign.used; - if (main->setting.reassign.used && (main->setting.flag & (iki_read_main_flag_content_e | iki_read_main_flag_literal_e))) { + if (main->setting.reassign.used && (main->setting.flag & (iki_read_main_flag_content_d | iki_read_main_flag_literal_d))) { at = iki_read_identify_substitution(main, main->setting.data.vocabulary.array[index], main->setting.data.content.array[index], &main->setting.reassign); } if (at < main->setting.reassign.used) { - if (main->setting.flag & iki_read_main_flag_content_e) { + if (main->setting.flag & iki_read_main_flag_content_d) { f_print_dynamic(main->setting.reassign.array[at].c, main->program.output.to); } else { @@ -39,12 +39,12 @@ extern "C" { at = main->setting.substitute.used; - if (main->setting.substitute.used && (main->setting.flag & (iki_read_main_flag_content_e | iki_read_main_flag_literal_e))) { + if (main->setting.substitute.used && (main->setting.flag & (iki_read_main_flag_content_d | iki_read_main_flag_literal_d))) { at = iki_read_identify_substitution(main, main->setting.data.vocabulary.array[index], main->setting.data.content.array[index], &main->setting.substitute); } if (at < main->setting.substitute.used) { - if (main->setting.flag & iki_read_main_flag_content_e) { + if (main->setting.flag & iki_read_main_flag_content_d) { iki_read_print_data_wrap_prepend(&main->program.output, index); f_print_dynamic(main->setting.substitute.array[at].c, main->program.output.to); @@ -69,14 +69,14 @@ extern "C" { } } else if (main->setting.replace.used && main->setting.map_replaces[index] < main->setting.replace.used) { - if (main->setting.flag & iki_read_main_flag_content_e) { + if (main->setting.flag & iki_read_main_flag_content_d) { iki_read_print_data_wrap_prepend(&main->program.output, index); f_print_dynamic(main->setting.replace.array[main->setting.map_replaces[index]].value, main->program.output.to); iki_read_print_data_wrap_append(&main->program.output, index); } - else if (main->setting.flag & iki_read_main_flag_object_e) { + else if (main->setting.flag & iki_read_main_flag_object_d) { f_print_dynamic(main->setting.replace.array[main->setting.map_replaces[index]].key, main->program.output.to); } else { @@ -96,14 +96,14 @@ extern "C" { f_print_dynamic_partial(main->setting.buffer, range, main->program.output.to); } } - else if (main->setting.flag & iki_read_main_flag_content_e) { + else if (main->setting.flag & iki_read_main_flag_content_d) { iki_read_print_data_wrap_prepend(&main->program.output, index); f_print_dynamic_partial(main->setting.buffer, main->setting.data.content.array[index], main->program.output.to); iki_read_print_data_wrap_append(&main->program.output, index); } - else if (main->setting.flag & iki_read_main_flag_object_e) { + else if (main->setting.flag & iki_read_main_flag_object_d) { f_print_dynamic_partial(main->setting.buffer, main->setting.data.vocabulary.array[index], main->program.output.to); } else { diff --git a/level_3/iki_read/c/main/process.c b/level_3/iki_read/c/main/process.c index 93776ea..81a6059 100644 --- a/level_3/iki_read/c/main/process.c +++ b/level_3/iki_read/c/main/process.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_iki_read_process_line_ void iki_read_process_line(iki_read_main_t * const main, f_range_t *range) { - if (!(main->setting.flag & iki_read_main_flag_line_e)) { + if (!(main->setting.flag & iki_read_main_flag_line_d)) { main->setting.state.status = F_false; return; @@ -40,7 +40,7 @@ extern "C" { #ifndef _di_iki_read_process_buffer_ void iki_read_process_buffer(iki_read_main_t * const main) { - if (main->setting.flag & iki_read_main_flag_total_e) { + if (main->setting.flag & iki_read_main_flag_total_d) { iki_read_process_buffer_total(main); if (F_status_is_error_not(main->setting.state.status)) { @@ -67,7 +67,7 @@ extern "C" { return; } - if (main->setting.flag & iki_read_main_flag_whole_e) { + if (main->setting.flag & iki_read_main_flag_whole_d) { iki_read_process_buffer_ranges_whole(main, buffer_range); } else { @@ -107,7 +107,7 @@ extern "C" { iki_read_identify_alteration(main); - if (main->setting.flag & iki_read_main_flag_name_e) { + if (main->setting.flag & iki_read_main_flag_name_d) { f_number_unsigned_t j = 0; f_number_unsigned_t matches = 0; bool unmatched = F_true; @@ -121,7 +121,7 @@ extern "C" { if (f_compare_dynamic_partial_string(main->setting.names.array[j].string, main->setting.buffer, main->setting.names.array[j].used, main->setting.data.vocabulary.array[i]) == F_equal_to) { unmatched = F_false; - if (main->setting.flag & iki_read_main_flag_at_e) { + if (main->setting.flag & iki_read_main_flag_at_d) { if (matches < main->setting.at) { matches++; @@ -149,7 +149,7 @@ extern "C" { } else { if (main->setting.data.variable.used) { - if (main->setting.flag & iki_read_main_flag_at_e) { + if (main->setting.flag & iki_read_main_flag_at_d) { if (main->setting.at < main->setting.data.variable.used) { f_file_stream_lock(main->program.output.to); diff --git a/level_3/iki_write/c/main/common.c b/level_3/iki_write/c/main/common.c index 0f3fa2d..59b4cd5 100644 --- a/level_3/iki_write/c/main/common.c +++ b/level_3/iki_write/c/main/common.c @@ -42,28 +42,28 @@ extern "C" { main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= iki_write_main_flag_help_e; + main->setting.flag |= iki_write_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= iki_write_main_flag_version_e; + main->setting.flag |= iki_write_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= iki_write_main_flag_copyright_e; + main->setting.flag |= iki_write_main_flag_copyright_d; return; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= iki_write_main_flag_pipe_e; + main->setting.flag |= iki_write_main_flag_pipe_d; } else { - main->setting.flag &= ~iki_write_main_flag_pipe_e; + main->setting.flag &= ~iki_write_main_flag_pipe_d; } if (main->program.parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->program.parameters.array[iki_write_parameter_file_e].values.used) { @@ -88,7 +88,7 @@ extern "C" { return; } - main->setting.flag |= iki_write_main_flag_file_to_e; + main->setting.flag |= iki_write_main_flag_file_to_d; } else if (main->program.parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -121,7 +121,7 @@ extern "C" { main->setting.objects.array[main->setting.objects.used++].size = 0; } // for - main->setting.flag |= iki_write_main_flag_object_e; + main->setting.flag |= iki_write_main_flag_object_d; } else if (main->program.parameters.array[iki_write_parameter_object_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -154,7 +154,7 @@ extern "C" { main->setting.contents.array[main->setting.contents.used++].size = 0; } // for - main->setting.flag |= iki_write_main_flag_content_e; + main->setting.flag |= iki_write_main_flag_content_d; } else if (main->program.parameters.array[iki_write_parameter_content_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -164,7 +164,7 @@ extern "C" { return; } - if (!(main->program.pipe & fll_program_data_pipe_input_e) && !(main->setting.flag & (iki_write_main_flag_content_e | iki_write_parameter_object_e))) { + if (!(main->program.pipe & fll_program_data_pipe_input_e) && !(main->setting.flag & (iki_write_main_flag_content_d | iki_write_parameter_object_e))) { main->setting.state.status = F_status_set_error(F_parameter); iki_write_print_error_main_missing(&main->program.error); @@ -173,7 +173,7 @@ extern "C" { } if (main->program.parameters.array[iki_write_parameter_wrap_e].result & f_console_result_found_e) { - main->setting.flag |= iki_write_main_flag_wrap_e; + main->setting.flag |= iki_write_main_flag_wrap_d; } main->setting.quote = f_iki_syntax_quote_double_s; diff --git a/level_3/iki_write/c/main/common/define.h b/level_3/iki_write/c/main/common/define.h index 0f44566..e3262f3 100644 --- a/level_3/iki_write/c/main/common/define.h +++ b/level_3/iki_write/c/main/common/define.h @@ -33,6 +33,57 @@ extern "C" { #endif // _di_iki_write_allocation_d_ /** + * Flags passed to the main function or program. + * + * iki_write_main_flag_*_d: + * - none: No flags set. + * - content: The Content being written is specified. + * - copyright: Print copyright. + * - file_to: Using a specified destination file. + * - help: Print help. + * - object: The Object being written is specified. + * - pipe: Use the input pipe. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + * - wrap: Wrap the vocabulary. + */ +#ifndef _di_iki_write_main_flag_d_ + #define iki_write_main_flag_none_d 0x0 + #define iki_write_main_flag_content_d 0x1 + #define iki_write_main_flag_copyright_d 0x2 + #define iki_write_main_flag_file_to_d 0x4 + #define iki_write_main_flag_help_d 0x8 + #define iki_write_main_flag_object_d 0x10 + #define iki_write_main_flag_pipe_d 0x20 + #define iki_write_main_flag_version_d 0x40 + #define iki_write_main_flag_version_copyright_help_d 0x4a + #define iki_write_main_flag_wrap_d 0x80 +#endif // _di_iki_write_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * iki_write_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_iki_write_print_flag_d_ + #define iki_write_print_flag_none_d 0x0 + #define iki_write_print_flag_debug_d 0x1 + #define iki_write_print_flag_error_d 0x2 + #define iki_write_print_flag_file_d 0x4 + #define iki_write_print_flag_in_d 0x8 + #define iki_write_print_flag_out_d 0x10 + #define iki_write_print_flag_message_d 0x20 + #define iki_write_print_flag_warning_d 0x40 +#endif // _di_iki_write_print_flag_d_ + +/** * The program signal defines. * * iki_write_signal_*_d: diff --git a/level_3/iki_write/c/main/common/enumeration.h b/level_3/iki_write/c/main/common/enumeration.h index d26193a..d0c7019 100644 --- a/level_3/iki_write/c/main/common/enumeration.h +++ b/level_3/iki_write/c/main/common/enumeration.h @@ -17,36 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * iki_write_main_flag_*_e: - * - none: No flags set. - * - content: The Content being written is specified. - * - copyright: Print copyright. - * - file_to: Using a specified destination file. - * - help: Print help. - * - object: The Object being written is specified. - * - pipe: Use the input pipe. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - wrap: Wrap the vocabulary. - */ -#ifndef _di_iki_write_main_flag_e_ - enum { - iki_write_main_flag_none_e = 0x0, - iki_write_main_flag_content_e = 0x1, - iki_write_main_flag_copyright_e = 0x2, - iki_write_main_flag_file_to_e = 0x4, - iki_write_main_flag_help_e = 0x8, - iki_write_main_flag_object_e = 0x10, - iki_write_main_flag_pipe_e = 0x20, - iki_write_main_flag_version_e = 0x40, - iki_write_main_flag_version_copyright_help_e = 0x4a, - iki_write_main_flag_wrap_e = 0x80, - }; // enum -#endif // _di_iki_write_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_iki_write_parameter_e_ @@ -76,31 +46,6 @@ extern "C" { #define iki_write_parameter_total_d (f_console_parameter_state_type_total_d + 7) #endif // _di_iki_write_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * iki_write_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_iki_write_print_flag_e_ - enum { - iki_write_print_flag_none_e = 0x0, - iki_write_print_flag_debug_e = 0x1, - iki_write_print_flag_error_e = 0x2, - iki_write_print_flag_file_e = 0x4, - iki_write_print_flag_in_e = 0x8, - iki_write_print_flag_out_e = 0x10, - iki_write_print_flag_message_e = 0x20, - iki_write_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_iki_write_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_write/c/main/common/type.h b/level_3/iki_write/c/main/common/type.h index 6d09bfd..d684511 100644 --- a/level_3/iki_write/c/main/common/type.h +++ b/level_3/iki_write/c/main/common/type.h @@ -57,7 +57,7 @@ extern "C" { #define iki_write_setting_t_initialize \ { \ - iki_write_main_flag_none_e, \ + iki_write_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ f_string_static_t_initialize, \ diff --git a/level_3/iki_write/c/main/iki_write.c b/level_3/iki_write/c/main/iki_write.c index 50c68fd..c7dc893 100644 --- a/level_3/iki_write/c/main/iki_write.c +++ b/level_3/iki_write/c/main/iki_write.c @@ -11,14 +11,14 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & iki_write_main_flag_version_copyright_help_e) { - if (main->setting.flag & iki_write_main_flag_help_e) { + if (main->setting.flag & iki_write_main_flag_version_copyright_help_d) { + if (main->setting.flag & iki_write_main_flag_help_d) { iki_write_print_message_help(&main->program.message); } - else if (main->setting.flag & iki_write_main_flag_version_e) { + else if (main->setting.flag & iki_write_main_flag_version_d) { fll_program_print_version(&main->program.message, iki_write_program_version_s); } - else if (main->setting.flag & iki_write_main_flag_copyright_e) { + else if (main->setting.flag & iki_write_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } @@ -27,7 +27,7 @@ extern "C" { main->setting.escaped.used = 0; - if (main->setting.flag & iki_write_main_flag_pipe_e) { + if (main->setting.flag & iki_write_main_flag_pipe_d) { bool object_ended = F_false; f_number_unsigned_t previous = 0; diff --git a/level_3/iki_write/c/main/main.c b/level_3/iki_write/c/main/main.c index ee2c567..68f6e87 100644 --- a/level_3/iki_write/c/main/main.c +++ b/level_3/iki_write/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { iki_write_main_t data = iki_write_main_t_initialize; - data.program.debug.flag |= iki_write_print_flag_debug_e | iki_write_print_flag_out_e; - data.program.error.flag |= iki_write_print_flag_error_e | iki_write_print_flag_out_e; - data.program.output.flag |= iki_write_print_flag_out_e; - data.program.message.flag |= iki_write_print_flag_message_e | iki_write_print_flag_out_e; - data.program.warning.flag |= iki_write_print_flag_warning_e | iki_write_print_flag_out_e; + data.program.debug.flag |= iki_write_print_flag_debug_d | iki_write_print_flag_out_d; + data.program.error.flag |= iki_write_print_flag_error_d | iki_write_print_flag_out_d; + data.program.output.flag |= iki_write_print_flag_out_d; + data.program.message.flag |= iki_write_print_flag_message_d | iki_write_print_flag_out_d; + data.program.warning.flag |= iki_write_print_flag_warning_d | iki_write_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/iki_write/c/main/process.c b/level_3/iki_write/c/main/process.c index d0b9c24..8cd8ce1 100644 --- a/level_3/iki_write/c/main/process.c +++ b/level_3/iki_write/c/main/process.c @@ -41,7 +41,7 @@ extern "C" { return; } - if (main->setting.flag & iki_write_main_flag_wrap_e) { + if (main->setting.flag & iki_write_main_flag_wrap_d) { fl_print_format("%r%Q%r%r%r%Q%r", main->program.output.to, f_iki_syntax_wrap_open_s, object, f_iki_syntax_wrap_close_s, f_iki_syntax_separator_s, main->setting.quote, main->setting.escaped, main->setting.quote); } else { diff --git a/level_3/status_code/c/fss/main.c b/level_3/status_code/c/fss/main.c index 148fe62..284296f 100644 --- a/level_3/status_code/c/fss/main.c +++ b/level_3/status_code/c/fss/main.c @@ -6,11 +6,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { status_code_main_t data = status_code_main_t_initialize; - data.program.debug.flag |= status_code_print_flag_debug_e | status_code_print_flag_out_e; - data.program.error.flag |= status_code_print_flag_error_e | status_code_print_flag_out_e; - data.program.output.flag |= status_code_print_flag_out_e; - data.program.message.flag |= status_code_print_flag_message_e | status_code_print_flag_out_e; - data.program.warning.flag |= status_code_print_flag_warning_e | status_code_print_flag_out_e; + data.program.debug.flag |= status_code_print_flag_debug_d | status_code_print_flag_out_d; + data.program.error.flag |= status_code_print_flag_error_d | status_code_print_flag_out_d; + data.program.output.flag |= status_code_print_flag_out_d; + data.program.message.flag |= status_code_print_flag_message_d | status_code_print_flag_out_d; + data.program.warning.flag |= status_code_print_flag_warning_d | status_code_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/status_code/c/main/common.c b/level_3/status_code/c/main/common.c index 2f15f66..18e7ce5 100644 --- a/level_3/status_code/c/main/common.c +++ b/level_3/status_code/c/main/common.c @@ -38,49 +38,49 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_help_e; + main->setting.flag |= status_code_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_version_e; + main->setting.flag |= status_code_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_copyright_e; + main->setting.flag |= status_code_main_flag_copyright_d; return; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= status_code_main_flag_pipe_e; + main->setting.flag |= status_code_main_flag_pipe_d; } else { - main->setting.flag &= ~status_code_main_flag_pipe_e; + main->setting.flag &= ~status_code_main_flag_pipe_d; } if (main->program.parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_error_e; + main->setting.flag |= status_code_main_flag_error_d; } if (main->program.parameters.array[status_code_parameter_fine_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_fine_e; + main->setting.flag |= status_code_main_flag_fine_d; } if (main->program.parameters.array[status_code_parameter_warning_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_warning_e; + main->setting.flag |= status_code_main_flag_warning_d; } if (main->program.parameters.array[status_code_parameter_number_e].result & f_console_result_found_e) { - main->setting.flag |= status_code_main_flag_number_e; + main->setting.flag |= status_code_main_flag_number_d; } - if (main->setting.flag & status_code_main_flag_error_e) { - if (main->setting.flag & status_code_main_flag_warning_e) { - if (!(main->setting.flag & status_code_main_flag_number_e)) { + if (main->setting.flag & status_code_main_flag_error_d) { + if (main->setting.flag & status_code_main_flag_warning_d) { + if (!(main->setting.flag & status_code_main_flag_number_d)) { main->setting.state.status = F_status_set_error(F_parameter); status_code_print_error_cannot_error_warning_number(&main->program.error); @@ -89,7 +89,7 @@ extern "C" { } } - if (main->setting.flag & status_code_main_flag_fine_e) { + if (main->setting.flag & status_code_main_flag_fine_d) { main->setting.state.status = F_status_set_error(F_parameter); fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_error_s, status_code_long_fine_s); @@ -97,7 +97,7 @@ extern "C" { return; } } - else if (main->setting.flag & status_code_main_flag_warning_e && main->setting.flag & status_code_main_flag_fine_e) { + else if (main->setting.flag & status_code_main_flag_warning_d && main->setting.flag & status_code_main_flag_fine_d) { main->setting.state.status = F_status_set_error(F_parameter); fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, status_code_long_warning_s, status_code_long_fine_s); diff --git a/level_3/status_code/c/main/common/define.h b/level_3/status_code/c/main/common/define.h index b035693..5af2fc6 100644 --- a/level_3/status_code/c/main/common/define.h +++ b/level_3/status_code/c/main/common/define.h @@ -33,6 +33,59 @@ extern "C" { #endif // _di_status_code_allocation_d_ /** + * Flags passed to the main function or program. + * + * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode). + * + * status_code_main_flag_*_d: + * - none: No flags set. + * - copyright: Print copyright. + * - error: Check if status is "error". + * - fine: Check if status is "fine". + * - help: Print help. + * - number: Operate in number mode. + * - pipe: Use the input pipe. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + * - warning: Check if status is "warning". + */ +#ifndef _di_status_code_main_flag_d_ + #define status_code_main_flag_none_d 0x0 + #define status_code_main_flag_copyright_d 0x1 + #define status_code_main_flag_error_d 0x2 + #define status_code_main_flag_fine_d 0x4 + #define status_code_main_flag_help_d 0x8 + #define status_code_main_flag_number_d 0x10 + #define status_code_main_flag_pipe_d 0x20 + #define status_code_main_flag_version_d 0x40 + #define status_code_main_flag_version_copyright_help_d 0x49 + #define status_code_main_flag_warning_d 0x80 +#endif // _di_status_code_main_flag_d_ + +/** + * Flags for fine-tuned print control. + * + * status_code_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_status_code_print_flag_d_ + #define status_code_print_flag_none_d 0x0 + #define status_code_print_flag_debug_d 0x1 + #define status_code_print_flag_error_d 0x2 + #define status_code_print_flag_file_d 0x4 + #define status_code_print_flag_in_d 0x8 + #define status_code_print_flag_out_d 0x10 + #define status_code_print_flag_message_d 0x20 + #define status_code_print_flag_warning_d 0x40 +#endif // _di_status_code_print_flag_d_ + +/** * The program signal defines. * * status_code_signal_*_d: diff --git a/level_3/status_code/c/main/common/enumeration.h b/level_3/status_code/c/main/common/enumeration.h index 570f0ce..4e0d900 100644 --- a/level_3/status_code/c/main/common/enumeration.h +++ b/level_3/status_code/c/main/common/enumeration.h @@ -17,38 +17,6 @@ extern "C" { #endif /** - * Flags passed to the main function or program. - * - * When number mode is not specified, then mode is "string" mode (there is no flag for "string" mode). - * - * status_code_main_flag_*_e: - * - none: No flags set. - * - copyright: Print copyright. - * - error: Check if status is "error". - * - fine: Check if status is "fine". - * - help: Print help. - * - number: Operate in number mode. - * - pipe: Use the input pipe. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - * - warning: Check if status is "warning". - */ -#ifndef _di_status_code_main_flag_e_ - enum { - status_code_main_flag_none_e = 0x0, - status_code_main_flag_copyright_e = 0x1, - status_code_main_flag_error_e = 0x2, - status_code_main_flag_fine_e = 0x4, - status_code_main_flag_help_e = 0x8, - status_code_main_flag_number_e = 0x10, - status_code_main_flag_pipe_e = 0x20, - status_code_main_flag_version_e = 0x40, - status_code_main_flag_version_copyright_help_e = 0x49, - status_code_main_flag_warning_e = 0x80, - }; // enum -#endif // _di_status_code_main_flag_e_ - -/** * The main program parameters. */ #ifndef _di_status_code_parameter_e_ @@ -72,31 +40,6 @@ extern "C" { #define status_code_parameter_total_d (f_console_parameter_state_type_total_d + 4) #endif // _di_status_code_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * status_code_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_status_code_print_flag_e_ - enum { - status_code_print_flag_none_e = 0x0, - status_code_print_flag_debug_e = 0x1, - status_code_print_flag_error_e = 0x2, - status_code_print_flag_file_e = 0x4, - status_code_print_flag_in_e = 0x8, - status_code_print_flag_out_e = 0x10, - status_code_print_flag_message_e = 0x20, - status_code_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_status_code_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/status_code/c/main/common/type.h b/level_3/status_code/c/main/common/type.h index e1ae1e2..0fe3178 100644 --- a/level_3/status_code/c/main/common/type.h +++ b/level_3/status_code/c/main/common/type.h @@ -48,7 +48,7 @@ extern "C" { #define status_code_setting_t_initialize \ { \ - status_code_main_flag_none_e, \ + status_code_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ 0, \ diff --git a/level_3/status_code/c/main/main.c b/level_3/status_code/c/main/main.c index a59ac39..0cc4afa 100644 --- a/level_3/status_code/c/main/main.c +++ b/level_3/status_code/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { status_code_main_t data = status_code_main_t_initialize; - data.program.debug.flag |= status_code_print_flag_debug_e | status_code_print_flag_out_e; - data.program.error.flag |= status_code_print_flag_error_e | status_code_print_flag_out_e; - data.program.output.flag |= status_code_print_flag_out_e; - data.program.message.flag |= status_code_print_flag_message_e | status_code_print_flag_out_e; - data.program.warning.flag |= status_code_print_flag_warning_e | status_code_print_flag_out_e; + data.program.debug.flag |= status_code_print_flag_debug_d | status_code_print_flag_out_d; + data.program.error.flag |= status_code_print_flag_error_d | status_code_print_flag_out_d; + data.program.output.flag |= status_code_print_flag_out_d; + data.program.message.flag |= status_code_print_flag_message_d | status_code_print_flag_out_d; + data.program.warning.flag |= status_code_print_flag_warning_d | status_code_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/status_code/c/main/process.c b/level_3/status_code/c/main/process.c index 1cb63d2..b587cce 100644 --- a/level_3/status_code/c/main/process.c +++ b/level_3/status_code/c/main/process.c @@ -18,7 +18,7 @@ extern "C" { f_file_stream_lock(main->program.output.to); - if ((main->setting.flag & status_code_main_flag_error_e) && F_status_is_error(number) || (main->setting.flag & status_code_main_flag_warning_e) && F_status_is_warning(number) || (main->setting.flag & status_code_main_flag_fine_e) && F_status_is_fine(number)) { + if ((main->setting.flag & status_code_main_flag_error_d) && F_status_is_error(number) || (main->setting.flag & status_code_main_flag_warning_d) && F_status_is_warning(number) || (main->setting.flag & status_code_main_flag_fine_d) && F_status_is_fine(number)) { f_print_dynamic_raw(f_status_true_s, main->program.output.to); } else { @@ -81,11 +81,11 @@ extern "C" { return; } - if (main->setting.flag & status_code_main_flag_error_e) { + if (main->setting.flag & status_code_main_flag_error_d) { code = F_status_set_error(code); } - if (main->setting.flag & status_code_main_flag_warning_e) { + if (main->setting.flag & status_code_main_flag_warning_d) { code = F_status_set_warning(code); } diff --git a/level_3/status_code/c/main/status_code.c b/level_3/status_code/c/main/status_code.c index 3f6b3a8..aefd52c 100644 --- a/level_3/status_code/c/main/status_code.c +++ b/level_3/status_code/c/main/status_code.c @@ -25,14 +25,14 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & status_code_main_flag_version_copyright_help_e) { - if (main->setting.flag & status_code_main_flag_help_e) { + if (main->setting.flag & status_code_main_flag_version_copyright_help_d) { + if (main->setting.flag & status_code_main_flag_help_d) { status_code_print_message_help(&main->program.message); } - else if (main->setting.flag & status_code_main_flag_version_e) { + else if (main->setting.flag & status_code_main_flag_version_d) { fll_program_print_version(&main->program.message, status_code_program_version_s); } - else if (main->setting.flag & status_code_main_flag_copyright_e) { + else if (main->setting.flag & status_code_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } @@ -41,8 +41,8 @@ extern "C" { f_status_t status = F_okay; - if (main->setting.flag & status_code_main_flag_number_e) { - if (main->setting.flag & status_code_main_flag_pipe_e) { + if (main->setting.flag & status_code_main_flag_number_d) { + if (main->setting.flag & status_code_main_flag_pipe_d) { // @todo call status_code_process_number() here for all main from pipe that are space separated. } @@ -73,8 +73,8 @@ extern "C" { f_file_stream_unlock(main->program.output.to); } } - else if ((main->setting.flag & status_code_main_flag_error_e) || (main->setting.flag & status_code_main_flag_warning_e) || (main->setting.flag & status_code_main_flag_fine_e)) { - if (main->setting.flag & status_code_main_flag_pipe_e) { + else if ((main->setting.flag & status_code_main_flag_error_d) || (main->setting.flag & status_code_main_flag_warning_d) || (main->setting.flag & status_code_main_flag_fine_d)) { + if (main->setting.flag & status_code_main_flag_pipe_d) { // @todo call status_code_process_check() here for all main from pipe that is space separated. } @@ -106,7 +106,7 @@ extern "C" { } } else { - if (main->setting.flag & status_code_main_flag_pipe_e) { + if (main->setting.flag & status_code_main_flag_pipe_d) { // @todo call status_code_process_normal() here for all main from pipe that is space separated. } diff --git a/level_3/utf8/c/main/bytesequence.c b/level_3/utf8/c/main/bytesequence.c index 9ce0396..5f640ec 100644 --- a/level_3/utf8/c/main/bytesequence.c +++ b/level_3/utf8/c/main/bytesequence.c @@ -36,7 +36,7 @@ extern "C" { return; } } - else if (!(main->setting.flag & utf8_main_flag_verify_e)) { + else if (!(main->setting.flag & utf8_main_flag_verify_d)) { if (main->setting.mode & utf8_mode_to_bytesequence_e) { utf8_print_data_bytesequence(&main->program.output, sequence); } diff --git a/level_3/utf8/c/main/codepoint.c b/level_3/utf8/c/main/codepoint.c index 460c4b5..fddcce5 100644 --- a/level_3/utf8/c/main/codepoint.c +++ b/level_3/utf8/c/main/codepoint.c @@ -43,7 +43,7 @@ extern "C" { return; } } - else if (!(main->setting.flag & utf8_main_flag_verify_e)) { + else if (!(main->setting.flag & utf8_main_flag_verify_d)) { if (main->setting.mode & utf8_mode_to_codepoint_e) { utf8_print_data_codepoint(&main->program.output, codepoint); } @@ -145,7 +145,7 @@ extern "C" { return; } } - else if (!(main->setting.flag & utf8_main_flag_verify_e)) { + else if (!(main->setting.flag & utf8_main_flag_verify_d)) { // The width actually includes the leading '0x', which is not part of the width of the digit in binary form. uint8_t width = main->setting.text.used > 1 ? (main->setting.text.used - 2) / 2 : 0; diff --git a/level_3/utf8/c/main/common.c b/level_3/utf8/c/main/common.c index 35451fa..0d0df01 100644 --- a/level_3/utf8/c/main/common.c +++ b/level_3/utf8/c/main/common.c @@ -113,28 +113,28 @@ extern "C" { } if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) { - main->setting.flag |= utf8_main_flag_help_e; + main->setting.flag |= utf8_main_flag_help_d; return; } if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) { - main->setting.flag |= utf8_main_flag_version_e; + main->setting.flag |= utf8_main_flag_version_d; return; } if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) { - main->setting.flag |= utf8_main_flag_copyright_e; + main->setting.flag |= utf8_main_flag_copyright_d; return; } if (main->program.pipe & fll_program_data_pipe_input_e) { - main->setting.flag |= utf8_main_flag_pipe_e; + main->setting.flag |= utf8_main_flag_pipe_d; } else { - main->setting.flag &= ~utf8_main_flag_pipe_e; + main->setting.flag &= ~utf8_main_flag_pipe_d; } if (main->program.parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) { @@ -177,7 +177,7 @@ extern "C" { return; } - main->setting.flag |= utf8_main_flag_file_to_e; + main->setting.flag |= utf8_main_flag_file_to_d; } else { utf8_print_error_parameter_file_name_empty(&main->program.error, main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]); @@ -196,7 +196,7 @@ extern "C" { } else { main->program.output.to = main->program.message.to; - main->setting.flag &= ~utf8_main_flag_file_to_e; + main->setting.flag &= ~utf8_main_flag_file_to_d; } if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_value_e) { @@ -248,7 +248,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status)) return; - main->setting.flag |= utf8_main_flag_file_from_e; + main->setting.flag |= utf8_main_flag_file_from_d; } else if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) { main->setting.state.status = F_status_set_error(F_parameter); @@ -258,7 +258,7 @@ extern "C" { return; } else { - main->setting.flag &= ~utf8_main_flag_file_from_e; + main->setting.flag &= ~utf8_main_flag_file_from_d; } if (main->program.parameters.remaining.used) { @@ -283,7 +283,7 @@ extern "C" { } // for } - if (!((main->setting.flag & (utf8_main_flag_pipe_e | utf8_main_flag_file_from_e)) || main->program.parameters.remaining.used)) { + if (!((main->setting.flag & (utf8_main_flag_pipe_d | utf8_main_flag_file_from_d)) || main->program.parameters.remaining.used)) { main->setting.state.status = F_status_set_error(F_parameter); utf8_print_error_no_from(&main->program.error); @@ -304,30 +304,30 @@ extern "C" { if (main->program.parameters.array[utf8_parameter_headers_e].result & f_console_result_found_e) { if (main->program.parameters.array[utf8_parameter_separate_e].result & f_console_result_found_e) { if (main->program.parameters.array[utf8_parameter_headers_e].location < main->program.parameters.array[utf8_parameter_separate_e].location) { - main->setting.flag |= utf8_main_flag_separate_e; + main->setting.flag |= utf8_main_flag_separate_d; } else if (main->program.parameters.array[utf8_parameter_headers_e].location == main->program.parameters.array[utf8_parameter_separate_e].location) { if (main->program.parameters.array[utf8_parameter_headers_e].location_sub < main->program.parameters.array[utf8_parameter_separate_e].location_sub) { - main->setting.flag |= utf8_main_flag_separate_e; + main->setting.flag |= utf8_main_flag_separate_d; } else { - main->setting.flag |= utf8_main_flag_header_e; + main->setting.flag |= utf8_main_flag_header_d; } } else { - main->setting.flag |= utf8_main_flag_header_e; + main->setting.flag |= utf8_main_flag_header_d; } } else { - main->setting.flag |= utf8_main_flag_header_e; + main->setting.flag |= utf8_main_flag_header_d; } } else if (main->program.parameters.array[utf8_parameter_separate_e].result & f_console_result_found_e) { - main->setting.flag |= utf8_main_flag_separate_e; + main->setting.flag |= utf8_main_flag_separate_d; } if (main->program.parameters.array[utf8_parameter_strip_invalid_e].result & f_console_result_found_e) { - main->setting.flag |= utf8_main_flag_strip_invalid_e; + main->setting.flag |= utf8_main_flag_strip_invalid_d; } main->setting.valid_not = main->program.message.set->error; diff --git a/level_3/utf8/c/main/common/define.h b/level_3/utf8/c/main/common/define.h index 42ac41a..f541f74 100644 --- a/level_3/utf8/c/main/common/define.h +++ b/level_3/utf8/c/main/common/define.h @@ -33,6 +33,87 @@ extern "C" { #endif // _di_utf8_allocation_d_ /** + * Flags passed to the main function or program. + * + * utf8_main_flag_*_d: + * - none: No flags set. + * - copyright: Print the copyright. + * - file_from: Using a specified source file. + * - file_to: Using a specified destination file. + * - header: Enable printing of headers. + * - help: Print help. + * - pipe: Use the input pipe. + * - separate: Enable printing of separators. + * - strip_invalid: Using strip invalid character mode. + * - verify: Using verify mode. + * - version: Print version. + * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. + */ +#ifndef _di_utf8_main_flag_d_ + #define utf8_main_flag_none_d 0x0 + #define utf8_main_flag_copyright_d 0x1 + #define utf8_main_flag_file_from_d 0x2 + #define utf8_main_flag_file_to_d 0x4 + #define utf8_main_flag_header_d 0x8 + #define utf8_main_flag_help_d 0x10 + #define utf8_main_flag_pipe_d 0x20 + #define utf8_main_flag_separate_d 0x40 + #define utf8_main_flag_strip_invalid_d 0x80 + #define utf8_main_flag_verify_d 0x100 + #define utf8_main_flag_version_d 0x200 + #define utf8_main_flag_version_copyright_help_d 0x211 +#endif // _di_utf8_main_flag_d_ + +/** + * Modes used to designate how to the input and output are to be processed. + * + * utf8_mode_*_d: + * - none: No flags set. + * + * utf8_mode_from_*_d: + * - bytesequence: The input format is bytesequence. + * - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX). + * + * utf8_mode_to_*_d: + * - bytesequence: The output format is bytesequence. + * - codepoint: The output format is codepoint (U+XXXX or U+XXXXXX). + * - combining: The output format is whether or not character is combining (may be used with "width"). + * - width: The output format is how wide the character is (may be used with "combining"). + */ +#ifndef _di_utf8_modes_d_ + #define utf8_mode_none_e 0x0 + #define utf8_mode_from_bytesequence_e 0x1 + #define utf8_mode_from_codepoint_e 0x2 + #define utf8_mode_to_bytesequence_e 0x4 + #define utf8_mode_to_codepoint_e 0x8 + #define utf8_mode_to_combining_e 0x10 + #define utf8_mode_to_width_e 0x20 +#endif // _di_utf8_modes_d_ + +/** + * Flags for fine-tuned print control. + * + * utf8_print_flag_*_d: + * - none: No flags set. + * - debug: Stream is for debug printing. + * - error: Stream is for error printing. + * - in: Stream is a source file. + * - message: Stream is for message printing. + * - out: Stream is a destination file. + * - warning: Stream is for warning printing. + */ +#ifndef _di_utf8_print_flag_d_ + #define utf8_print_flag_none_d 0x0 + #define utf8_print_flag_debug_d 0x1 + #define utf8_print_flag_error_d 0x2 + #define utf8_print_flag_file_d 0x4 + #define utf8_print_flag_in_d 0x8 + #define utf8_print_flag_out_d 0x10 + #define utf8_print_flag_message_d 0x20 + #define utf8_print_flag_warning_d 0x40 +#endif // _di_utf8_print_flag_d_ + +/** * The program signal defines. * * utf8_signal_*_d: diff --git a/level_3/utf8/c/main/common/enumeration.h b/level_3/utf8/c/main/common/enumeration.h index 01d9935..38164ae 100644 --- a/level_3/utf8/c/main/common/enumeration.h +++ b/level_3/utf8/c/main/common/enumeration.h @@ -17,68 +17,6 @@ extern "C" { #endif /** - * Modes used to designate how to the input and output are to be processed. - * - * utf8_mode_*_e: - * - none: No flags set. - * - * utf8_mode_from_*_e: - * - bytesequence: The input format is bytesequence. - * - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX). - * - * utf8_mode_to_*_e: - * - bytesequence: The output format is bytesequence. - * - codepoint: The output format is codepoint (U+XXXX or U+XXXXXX). - * - combining: The output format is whether or not character is combining (may be used with "width"). - * - width: The output format is how wide the character is (may be used with "combining"). - */ -#ifndef _di_utf8_modes_e_ - enum { - utf8_mode_none_e = 0x0, - utf8_mode_from_bytesequence_e = 0x1, - utf8_mode_from_codepoint_e = 0x2, - utf8_mode_to_bytesequence_e = 0x4, - utf8_mode_to_codepoint_e = 0x8, - utf8_mode_to_combining_e = 0x10, - utf8_mode_to_width_e = 0x20, - }; // enum -#endif // _di_utf8_modes_e_ - -/** - * Flags passed to the main function or program. - * - * utf8_main_flag_*_e: - * - none: No flags set. - * - copyright: Print the copyright. - * - file_from: Using a specified source file. - * - file_to: Using a specified destination file. - * - header: Enable printing of headers. - * - help: Print help. - * - pipe: Use the input pipe. - * - separate: Enable printing of separators. - * - strip_invalid: Using strip invalid character mode. - * - verify: Using verify mode. - * - version: Print version. - * - version_copyright_help: A helper flag representing version, copyright, and help flag bits being set. - */ -#ifndef _di_utf8_main_flag_e_ - enum { - utf8_main_flag_none_e = 0x0, - utf8_main_flag_copyright_e = 0x1, - utf8_main_flag_file_from_e = 0x2, - utf8_main_flag_file_to_e = 0x4, - utf8_main_flag_header_e = 0x8, - utf8_main_flag_help_e = 0x10, - utf8_main_flag_pipe_e = 0x20, - utf8_main_flag_separate_e = 0x40, - utf8_main_flag_strip_invalid_e = 0x80, - utf8_main_flag_verify_e = 0x100, - utf8_main_flag_version_e = 0x200, - utf8_main_flag_version_copyright_help_e = 0x211, - }; // enum -#endif // _di_utf8_main_flag_e_ - -/** * Codepoint modes for converting to/from binary and codepoint values. * * The special "raw" format is used only for reading from codepoint format where that format represents binary character that is not a valid Unicode character. @@ -154,31 +92,6 @@ extern "C" { #define utf8_parameter_total_d (f_console_parameter_state_type_total_d + 12) #endif // _di_utf8_parameter_e_ -/** - * Flags for fine-tuned print control. - * - * utf8_print_flag_*_e: - * - none: No flags set. - * - debug: Stream is for debug printing. - * - error: Stream is for error printing. - * - in: Stream is a source file. - * - message: Stream is for message printing. - * - out: Stream is a destination file. - * - warning: Stream is for warning printing. - */ -#ifndef _di_utf8_print_flag_e_ - enum { - utf8_print_flag_none_e = 0x0, - utf8_print_flag_debug_e = 0x1, - utf8_print_flag_error_e = 0x2, - utf8_print_flag_file_e = 0x4, - utf8_print_flag_in_e = 0x8, - utf8_print_flag_out_e = 0x10, - utf8_print_flag_message_e = 0x20, - utf8_print_flag_warning_e = 0x40, - }; // enum -#endif // _di_utf8_print_flag_e_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/utf8/c/main/common/type.h b/level_3/utf8/c/main/common/type.h index 765b5fa..2f6eaa0 100644 --- a/level_3/utf8/c/main/common/type.h +++ b/level_3/utf8/c/main/common/type.h @@ -38,8 +38,8 @@ extern "C" { * - buffer: A buffer to use for printing output (generally for storing a block of input from an input file). * - text: A buffer for storing a series of characters for processing (generally for code point processing). * - * - path_files_from: An array of all "from" file paths for when the flag utf8_main_flag_file_from_e is set. - * - path_files_to: An array of all "to" file paths for when the flag utf8_main_flag_file_to_e is set. + * - path_files_from: An array of all "from" file paths for when the flag utf8_main_flag_file_from_d is set. + * - path_files_to: An array of all "to" file paths for when the flag utf8_main_flag_file_to_d is set. * - remaining: An array containing all remaining arguments passed to the program. */ #ifndef _di_utf8_setting_t_ @@ -67,7 +67,7 @@ extern "C" { #define utf8_setting_t_initialize \ { \ utf8_mode_from_bytesequence_e | utf8_mode_to_codepoint_e, \ - utf8_main_flag_none_e, \ + utf8_main_flag_none_d, \ F_okay, \ f_state_t_initialize, \ f_color_set_t_initialize, \ diff --git a/level_3/utf8/c/main/main.c b/level_3/utf8/c/main/main.c index ce11bd3..589a29f 100644 --- a/level_3/utf8/c/main/main.c +++ b/level_3/utf8/c/main/main.c @@ -4,11 +4,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { utf8_main_t data = utf8_main_t_initialize; - data.program.debug.flag |= utf8_print_flag_debug_e | utf8_print_flag_out_e; - data.program.error.flag |= utf8_print_flag_error_e | utf8_print_flag_out_e; - data.program.output.flag |= utf8_print_flag_out_e; - data.program.message.flag |= utf8_print_flag_message_e | utf8_print_flag_out_e; - data.program.warning.flag |= utf8_print_flag_warning_e | utf8_print_flag_out_e; + data.program.debug.flag |= utf8_print_flag_debug_d | utf8_print_flag_out_d; + data.program.error.flag |= utf8_print_flag_error_d | utf8_print_flag_out_d; + data.program.output.flag |= utf8_print_flag_out_d; + data.program.message.flag |= utf8_print_flag_message_d | utf8_print_flag_out_d; + data.program.warning.flag |= utf8_print_flag_warning_d | utf8_print_flag_out_d; data.program.error.custom = (void *) &data; data.program.debug.custom = (void *) &data; data.program.message.custom = (void *) &data; diff --git a/level_3/utf8/c/main/print/data.c b/level_3/utf8/c/main/print/data.c index acd41d4..a396be9 100644 --- a/level_3/utf8/c/main/print/data.c +++ b/level_3/utf8/c/main/print/data.c @@ -24,7 +24,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; if (!invalid.used) return F_output_not; if ((main->setting.mode & utf8_mode_to_combining_e) || (main->setting.mode & utf8_mode_to_width_e)) { @@ -116,7 +116,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; fl_print_format("%r%[%r%]%r", print->to, main->setting.prepend, main->setting.valid_not, utf8_string_unknown_s, main->setting.valid_not, main->setting.append); @@ -131,7 +131,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; f_string_static_t character = macro_f_string_static_t_initialize_1(0, 0, width); @@ -176,7 +176,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; fl_print_format("%r%[%r%]%r", print->to, main->setting.prepend, main->setting.valid_not, raw, main->setting.valid_not, main->setting.append); @@ -191,7 +191,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; if (main->setting.mode & utf8_mode_to_combining_e) { utf8_print_data_combining_or_width_invalid(print); @@ -234,19 +234,19 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (!(main->setting.flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not; - if (main->setting.flag & utf8_main_flag_verify_e) return F_output_not; + if (!(main->setting.flag & (utf8_main_flag_header_d | utf8_main_flag_separate_d))) return F_output_not; + if (main->setting.flag & utf8_main_flag_verify_d) return F_output_not; f_file_stream_lock(print->to); - if (main->setting.flag & utf8_main_flag_header_e) { + if (main->setting.flag & utf8_main_flag_header_d) { if (index) { f_print_dynamic_raw(f_string_eol_s, print->to); } fl_print_format("%[File%] ", print->to, print->set->title, print->set->title); - if (main->setting.flag & utf8_main_flag_file_to_e) { + if (main->setting.flag & utf8_main_flag_file_to_d) { fl_print_format("%[%Q%]: %Q.%r", print->to, print->set->notable, name, print->set->notable, main->setting.path_files_to.array[0], f_string_eol_s); } else { @@ -267,13 +267,13 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (!(main->setting.flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not; - if (main->setting.flag & utf8_main_flag_verify_e) return F_output_not; + if (!(main->setting.flag & (utf8_main_flag_header_d | utf8_main_flag_separate_d))) return F_output_not; + if (main->setting.flag & utf8_main_flag_verify_d) return F_output_not; f_file_stream_lock(print->to); - if (main->setting.flag & utf8_main_flag_header_e) { - if ((main->setting.flag & (utf8_main_flag_pipe_e | utf8_main_flag_file_from_e)) || index) { + if (main->setting.flag & utf8_main_flag_header_d) { + if ((main->setting.flag & (utf8_main_flag_pipe_d | utf8_main_flag_file_from_d)) || index) { f_print_dynamic_raw(f_string_eol_s, print->to); } @@ -281,7 +281,7 @@ extern "C" { fl_print_format("%[%ul%]:%r", print->to, print->set->notable, index, print->set->notable, f_string_eol_s); } else { - if ((main->setting.flag & (utf8_main_flag_pipe_e | utf8_main_flag_file_from_e)) || index) { + if ((main->setting.flag & (utf8_main_flag_pipe_d | utf8_main_flag_file_from_d)) || index) { f_print_dynamic_raw(f_string_eol_s, print->to); } } @@ -299,10 +299,10 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (!(main->setting.flag & (utf8_main_flag_header_e | utf8_main_flag_separate_e))) return F_output_not; - if (main->setting.flag & utf8_main_flag_verify_e) return F_output_not; + if (!(main->setting.flag & (utf8_main_flag_header_d | utf8_main_flag_separate_d))) return F_output_not; + if (main->setting.flag & utf8_main_flag_verify_d) return F_output_not; - if (main->setting.flag & utf8_main_flag_header_e) { + if (main->setting.flag & utf8_main_flag_header_d) { fll_print_format("%[Pipe%]:%r", print->to, print->set->title, print->set->title, f_string_eol_s); } diff --git a/level_3/utf8/c/main/print/error.c b/level_3/utf8/c/main/print/error.c index 096c7db..91d9ed7 100644 --- a/level_3/utf8/c/main/print/error.c +++ b/level_3/utf8/c/main/print/error.c @@ -24,7 +24,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; fl_print_format("%[%QFailed to decode character code '%]", print->to, print->set->error, print->prefix, print->set->error); @@ -65,7 +65,7 @@ extern "C" { utf8_main_t * const main = (utf8_main_t *) print->custom; - if (main->setting.flag & (utf8_main_flag_strip_invalid_e | utf8_main_flag_verify_e)) return F_output_not; + if (main->setting.flag & (utf8_main_flag_strip_invalid_d | utf8_main_flag_verify_d)) return F_output_not; fl_print_format("%[%QFailed to encode Unicode codepoint '%]", print->to, print->set->error, print->prefix, print->set->error); fl_print_format("%[U+%_U%]", print->to, print->set->notable, codepoint, print->set->notable); diff --git a/level_3/utf8/c/main/utf8.c b/level_3/utf8/c/main/utf8.c index 11179e1..35bedd1 100644 --- a/level_3/utf8/c/main/utf8.c +++ b/level_3/utf8/c/main/utf8.c @@ -11,14 +11,14 @@ extern "C" { main->setting.state.status = F_okay; - if (main->setting.flag & utf8_main_flag_version_copyright_help_e) { - if (main->setting.flag & utf8_main_flag_help_e) { + if (main->setting.flag & utf8_main_flag_version_copyright_help_d) { + if (main->setting.flag & utf8_main_flag_help_d) { utf8_print_message_help(&main->program.message); } - else if (main->setting.flag & utf8_main_flag_version_e) { + else if (main->setting.flag & utf8_main_flag_version_d) { fll_program_print_version(&main->program.message, utf8_program_version_s); } - else if (main->setting.flag & utf8_main_flag_copyright_e) { + else if (main->setting.flag & utf8_main_flag_copyright_d) { fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s); } @@ -41,10 +41,10 @@ extern "C" { if (F_status_is_error_not(main->setting.state.status)) { if (main->setting.mode & utf8_mode_to_bytesequence_e) { - if (main->setting.flag & utf8_main_flag_header_e) { + if (main->setting.flag & utf8_main_flag_header_d) { fll_print_dynamic_raw(f_string_eol_s, main->program.output.to); } - else if ((main->setting.flag & (utf8_main_flag_separate_e | utf8_main_flag_file_from_e)) || main->setting.remaining.used) { + else if ((main->setting.flag & (utf8_main_flag_separate_d | utf8_main_flag_file_from_d)) || main->setting.remaining.used) { fll_print_dynamic_raw(f_string_eol_s, main->program.output.to); } } @@ -56,7 +56,7 @@ extern "C" { } // Process "from" files. - if (F_status_is_error_not(main->setting.state.status) && (main->setting.flag & utf8_main_flag_file_from_e)) { + if (F_status_is_error_not(main->setting.state.status) && (main->setting.flag & utf8_main_flag_file_from_d)) { f_file_t file = macro_f_file_t_initialize_1(0, -1, F_file_flag_read_only_d, 32768, F_file_default_size_write_d); for (f_number_unsigned_t i = 0; i < main->setting.path_files_from.used && F_status_is_error_not(main->setting.state.status); ++i) { @@ -83,7 +83,7 @@ extern "C" { f_file_stream_flush(file); f_file_stream_close(&file); - if (main->setting.flag & utf8_main_flag_verify_e) { + if (main->setting.flag & utf8_main_flag_verify_d) { if (main->setting.state.status == F_false) { valid = F_false; } @@ -91,15 +91,15 @@ extern "C" { if (F_status_is_error_not(main->setting.state.status)) { if (main->setting.mode & utf8_mode_to_bytesequence_e) { - if (main->setting.flag & utf8_main_flag_header_e) { + if (main->setting.flag & utf8_main_flag_header_d) { fll_print_dynamic_raw(f_string_eol_s, main->program.output.to); } - else if ((main->setting.flag & utf8_main_flag_separate_e) && (main->setting.remaining.used || main->setting.path_files_from.used)) { + else if ((main->setting.flag & utf8_main_flag_separate_d) && (main->setting.remaining.used || main->setting.path_files_from.used)) { fll_print_dynamic_raw(f_string_eol_s, main->program.output.to); } } else { - if (!(main->setting.flag & (utf8_main_flag_file_to_e | utf8_main_flag_header_e | utf8_main_flag_verify_e | utf8_main_flag_separate_e))) { + if (!(main->setting.flag & (utf8_main_flag_file_to_d | utf8_main_flag_header_d | utf8_main_flag_verify_d | utf8_main_flag_separate_d))) { fll_print_dynamic_raw(f_string_eol_s, main->program.output.to); } } @@ -131,7 +131,7 @@ extern "C" { utf8_process_text(main, main->program.parameters.arguments.array[main->program.parameters.remaining.array[i]]); - if (main->setting.flag & utf8_main_flag_verify_e) { + if (main->setting.flag & utf8_main_flag_verify_d) { if (main->setting.state.status == F_false) { valid = F_false; } @@ -141,7 +141,7 @@ extern "C" { if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_interrupt) return; - main->setting.state.status = (main->setting.flag & utf8_main_flag_verify_e) ? valid : F_okay; + main->setting.state.status = (main->setting.flag & utf8_main_flag_verify_d) ? valid : F_okay; } #endif // _di_utf8_main_ -- 1.8.3.1