From 846293613a4ad62b4eac3adedb783b599390a9ac Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 26 Jan 2023 23:31:07 -0600 Subject: [PATCH] Feature: Provide program parameter for displaying copyright. Provide copyright printing that can be slighty fine tuned using verbosity. Provide a define (_di_detailed_copyright_) for reducing some of the string printed. --- build/level_2/defines | 3 ++ build/monolithic/defines | 3 ++ level_0/f_console/c/console/common.c | 8 +++++ level_0/f_console/c/console/common.h | 13 +++++++ level_2/fll_program/c/program/print.c | 35 +++++++++++++++++++ level_2/fll_program/c/program/print.h | 19 ++++++++++ level_2/fll_program/data/build/defines | 1 + level_3/byte_dump/c/byte_dump.c | 10 ++++-- level_3/byte_dump/c/common.h | 6 ++-- level_3/control/c/common.c | 6 ++++ level_3/control/c/common.h | 24 +++++++------ level_3/control/c/control.c | 10 ++++-- level_3/controller/c/common.c | 6 ++++ level_3/controller/c/common.h | 24 +++++++------ level_3/controller/c/controller.c | 14 +++++--- level_3/controller/data/build/defines | 1 + level_3/fake/c/main/common.c | 6 ++++ level_3/fake/c/main/common.h | 40 ++++++++++++---------- level_3/fake/c/main/fake.c | 6 ++++ level_3/fake/data/build/defines | 1 + level_3/firewall/c/firewall.c | 18 ++++++---- level_3/firewall/data/build/defines | 1 + level_3/fss_basic_list_read/c/common.c | 6 ++++ level_3/fss_basic_list_read/c/common.h | 24 +++++++------ .../fss_basic_list_read/c/fss_basic_list_read.c | 14 +++++--- level_3/fss_basic_read/c/common.c | 6 ++++ level_3/fss_basic_read/c/common.h | 24 +++++++------ level_3/fss_basic_read/c/fss_basic_read.c | 14 +++++--- level_3/fss_embedded_list_read/c/common.c | 6 ++++ level_3/fss_embedded_list_read/c/common.h | 24 +++++++------ .../c/fss_embedded_list_read.c | 20 ++++++----- level_3/fss_extended_list_read/c/common.c | 6 ++++ level_3/fss_extended_list_read/c/common.h | 24 +++++++------ .../c/fss_extended_list_read.c | 10 ++++-- level_3/fss_extended_read/c/common.c | 6 ++++ level_3/fss_extended_read/c/common.h | 24 +++++++------ level_3/fss_extended_read/c/fss_extended_read.c | 10 ++++-- level_3/fss_identify/c/common.c | 6 ++++ level_3/fss_identify/c/common.h | 24 +++++++------ level_3/fss_identify/c/fss_identify.c | 10 ++++-- level_3/fss_payload_read/c/common.c | 6 ++++ level_3/fss_payload_read/c/common.h | 32 +++++++++-------- level_3/fss_payload_read/c/fss_payload_read.c | 10 ++++-- level_3/fss_write/c/main/common.c | 4 +++ level_3/fss_write/c/main/common.h | 24 +++++++------ level_3/fss_write/c/main/fss_write.c | 6 ++++ level_3/iki_read/c/main/common.c | 6 ++++ level_3/iki_read/c/main/common.h | 30 +++++++++------- level_3/iki_read/c/main/iki_read.c | 6 ++++ level_3/iki_write/c/main/common.c | 6 ++++ level_3/iki_write/c/main/common.h | 30 +++++++++------- level_3/iki_write/c/main/iki_write.c | 6 ++++ level_3/status_code/c/main/common.c | 6 ++++ level_3/status_code/c/main/common.h | 34 ++++++++++-------- level_3/status_code/c/main/status_code.c | 6 ++++ level_3/utf8/c/main/common.c | 6 ++++ level_3/utf8/c/main/common.h | 24 +++++++------ level_3/utf8/c/main/utf8.c | 6 ++++ 58 files changed, 547 insertions(+), 214 deletions(-) create mode 100644 build/level_2/defines create mode 100644 build/monolithic/defines diff --git a/build/level_2/defines b/build/level_2/defines new file mode 100644 index 0000000..91fff5d --- /dev/null +++ b/build/level_2/defines @@ -0,0 +1,3 @@ +# fss-0000 + +_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space). diff --git a/build/monolithic/defines b/build/monolithic/defines new file mode 100644 index 0000000..91fff5d --- /dev/null +++ b/build/monolithic/defines @@ -0,0 +1,3 @@ +# fss-0000 + +_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space). diff --git a/level_0/f_console/c/console/common.c b/level_0/f_console/c/console/common.c index efaf6c9..b700c25 100644 --- a/level_0/f_console/c/console/common.c +++ b/level_0/f_console/c/console/common.c @@ -5,6 +5,10 @@ extern "C" { #endif #ifndef _di_f_console_standard_s_ + #ifndef _di_f_console_standard_short_copyright_s_ + const f_string_static_t f_console_standard_short_copyright_s = macro_f_string_static_t_initialize(F_console_standard_short_copyright_s, 0, F_console_standard_short_copyright_s_length); + #endif // _di_f_console_standard_short_copyright_s_ + #ifndef _di_f_console_standard_short_dark_s_ const f_string_static_t f_console_standard_short_dark_s = macro_f_string_static_t_initialize(F_console_standard_short_dark_s, 0, F_console_standard_short_dark_s_length); #endif // _di_f_console_standard_short_dark_s_ @@ -61,6 +65,10 @@ extern "C" { const f_string_static_t f_console_standard_short_version_s = macro_f_string_static_t_initialize(F_console_standard_short_version_s, 0, F_console_standard_short_version_s_length); #endif // _di_f_console_standard_short_version_s_ + #ifndef _di_f_console_standard_long_copyright_s_ + const f_string_static_t f_console_standard_long_copyright_s = macro_f_string_static_t_initialize(F_console_standard_long_copyright_s, 0, F_console_standard_long_copyright_s_length); + #endif // _di_f_console_standard_long_copyright_s_ + #ifndef _di_f_console_standard_long_dark_s_ const f_string_static_t f_console_standard_long_dark_s = macro_f_string_static_t_initialize(F_console_standard_long_dark_s, 0, F_console_standard_long_dark_s_length); #endif // _di_f_console_standard_long_dark_s_ diff --git a/level_0/f_console/c/console/common.h b/level_0/f_console/c/console/common.h index 5b6185c..0b1e59a 100644 --- a/level_0/f_console/c/console/common.h +++ b/level_0/f_console/c/console/common.h @@ -562,6 +562,7 @@ extern "C" { * This is not strictly a requirement, but expect level 3 projects to work this way. * * The following options are subjective in interpretation of the verbosity but are expected to be follow the general interpretation: + * - copyright: Display copyright, if compiled in (consider combining with quiet, verbose, and normal). * - debug: Enable debugging, which will likely increase output verbosity. * - error: Similar to quiet, except that error messages are printed (this is less verbose than "normal"). * - normal: Use normal printing (don't use debug/quiet/verbose). @@ -587,6 +588,7 @@ extern "C" { * - To avoid problems with the status code after a program is forcibly killed, the status_out environment variable should be cleared at program start. */ #ifndef _di_f_console_standard_s_ + #define F_console_standard_short_copyright_s "C" #define F_console_standard_short_dark_s "d" #define F_console_standard_short_debug_s "D" #define F_console_standard_short_error_s "E" @@ -602,6 +604,7 @@ extern "C" { #define F_console_standard_short_verbose_s "V" #define F_console_standard_short_version_s "v" + #define F_console_standard_short_copyright_s_length 1 #define F_console_standard_short_dark_s_length 1 #define F_console_standard_short_debug_s_length 1 #define F_console_standard_short_error_s_length 1 @@ -617,6 +620,7 @@ extern "C" { #define F_console_standard_short_verbose_s_length 1 #define F_console_standard_short_version_s_length 1 + #define F_console_standard_long_copyright_s "copyright" #define F_console_standard_long_dark_s "dark" #define F_console_standard_long_debug_s "debug" #define F_console_standard_long_error_s "error" @@ -632,6 +636,7 @@ extern "C" { #define F_console_standard_long_verbose_s "verbose" #define F_console_standard_long_version_s "version" + #define F_console_standard_long_copyright_s_length 9 #define F_console_standard_long_dark_s_length 4 #define F_console_standard_long_debug_s_length 5 #define F_console_standard_long_error_s_length 5 @@ -647,6 +652,10 @@ extern "C" { #define F_console_standard_long_verbose_s_length 7 #define F_console_standard_long_version_s_length 7 + #ifndef _di_f_console_standard_short_copyright_s_ + extern const f_string_static_t f_console_standard_short_copyright_s; + #endif // _di_f_console_standard_short_copyright_s_ + #ifndef _di_f_console_standard_short_dark_s_ extern const f_string_static_t f_console_standard_short_dark_s; #endif // _di_f_console_standard_short_dark_s_ @@ -703,6 +712,10 @@ extern "C" { extern const f_string_static_t f_console_standard_short_version_s; #endif // _di_f_console_standard_short_version_s_ + #ifndef _di_f_console_standard_long_copyright_s_ + extern const f_string_static_t f_console_standard_long_copyright_s; + #endif // _di_f_console_standard_long_copyright_s_ + #ifndef _di_f_console_standard_long_dark_s_ extern const f_string_static_t f_console_standard_long_dark_s; #endif // _di_f_console_standard_long_dark_s_ diff --git a/level_2/fll_program/c/program/print.c b/level_2/fll_program/c/program/print.c index 7c480f9..dd2892f 100644 --- a/level_2/fll_program/c/program/print.c +++ b/level_2/fll_program/c/program/print.c @@ -5,6 +5,40 @@ extern "C" { #endif +#ifndef _di_fll_program_print_copyright_ + f_status_t fll_program_print_copyright(const fl_print_t print, const uint8_t first_last) { + + f_file_stream_lock(print.to); + + if (first_last & 0x1) { + f_print_dynamic_raw(f_string_eol_s, print.to); + } + + fl_print_format("Copyright © 2007-2023 Kevin Day.%r", print.to, f_string_eol_s); + + #ifndef _di_detailed_copyright_ + if (print.verbosity > f_console_verbosity_quiet_e) { + if (print.verbosity > f_console_verbosity_normal_e) { + fl_print_format("%rThis program comes with ABSOLUTELY NO WARRANTY.%r", print.to, f_string_eol_s, f_string_eol_s); + fl_print_format("This is free software, and you are welcome to modify or redistribute in accordance to the license.%r", print.to, f_string_eol_s); + } + + fl_print_format("%rSource code license lgpl-2.1-or-later.%r", print.to, f_string_eol_s, f_string_eol_s); + fl_print_format("Standard and specification license open-standard-license-1.0.%r", print.to, f_string_eol_s); + fl_print_format("Documentation license cc-by-sa-4.0.%r", print.to, f_string_eol_s); + } + #endif // _di_detailed_copyright_ + + if (first_last & 0x2) { + f_print_dynamic_raw(f_string_eol_s, print.to); + } + + f_file_stream_unlock(print.to); + + return F_none; + } +#endif // _di_fll_program_print_copyright_ + #ifndef _di_fll_program_print_error_missing_file_ f_status_t fll_program_print_error_missing_file(const fl_print_t print) { @@ -409,6 +443,7 @@ extern "C" { f_status_t fll_program_print_help_option_standard(const fl_print_t print) { private_fll_program_print_help_option(print, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Print this help message."); + private_fll_program_print_help_option(print, f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Print the copyright."); private_fll_program_print_help_option(print, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Output using colors that show up better on dark backgrounds."); private_fll_program_print_help_option(print, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Output using colors that show up better on light backgrounds."); private_fll_program_print_help_option(print, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_inverse_s, f_console_symbol_long_inverse_s, " Do not print using color."); diff --git a/level_2/fll_program/c/program/print.h b/level_2/fll_program/c/program/print.h index 85157d7..1060555 100644 --- a/level_2/fll_program/c/program/print.h +++ b/level_2/fll_program/c/program/print.h @@ -17,6 +17,25 @@ extern "C" { #endif /** + * Print Featureless Linux Library copyright. + * + * @param print + * The output structure to print to. + * The print.verbosity is used to determine how much detail is printed (except for when _di_detailed_copyright_ is set). + * @param uint8_t + * Bitwise variable representing whether or not to print the first and last new line. + * Set bit 0x1 to printing first line. + * Set bit 0x2 to printing last line. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + */ +#ifndef _di_fll_program_print_copyright_ + extern f_status_t fll_program_print_copyright(const fl_print_t print, const uint8_t first_last); +#endif // _di_fll_program_print_copyright_ + +/** * Print an error message when a file is not provided. * * This is only printed when verbosity is not set to quiet. diff --git a/level_2/fll_program/data/build/defines b/level_2/fll_program/data/build/defines index c665317..91fff5d 100644 --- a/level_2/fll_program/data/build/defines +++ b/level_2/fll_program/data/build/defines @@ -1,2 +1,3 @@ # fss-0000 +_di_detailed_copyright_ Disable the detailed copyright message (saves a small amount of space). diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 0943b83..e7b63fc 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -142,8 +142,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[byte_dump_parameter_help_e].result & f_console_result_found_e) { byte_dump_print_help(setting, main->message); @@ -156,6 +154,14 @@ extern "C" { return F_none; } + if (main->parameters.array[byte_dump_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + if (main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e)) { if (main->parameters.array[byte_dump_parameter_width_e].result & f_console_result_found_e) { f_file_stream_lock(main->error.to); diff --git a/level_3/byte_dump/c/common.h b/level_3/byte_dump/c/common.h index 5557932..39933ee 100644 --- a/level_3/byte_dump/c/common.h +++ b/level_3/byte_dump/c/common.h @@ -284,6 +284,7 @@ extern "C" { enum { byte_dump_parameter_help_e, + byte_dump_parameter_copyright_e, byte_dump_parameter_light_e, byte_dump_parameter_dark_e, byte_dump_parameter_no_color_e, @@ -319,7 +320,8 @@ extern "C" { #define byte_dump_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_normal_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -351,7 +353,7 @@ extern "C" { macro_f_console_parameter_t_initialize_5(byte_dump_long_classic_s, 0, f_console_flag_normal_e), \ } - #define byte_dump_total_parameters_d 28 + #define byte_dump_total_parameters_d 29 #endif // _di_byte_dump_parameter_d_ /** diff --git a/level_3/control/c/common.c b/level_3/control/c/common.c index 9594182..179804a 100644 --- a/level_3/control/c/common.c +++ b/level_3/control/c/common.c @@ -270,6 +270,12 @@ extern "C" { return; } + if (main->parameters.array[control_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= control_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[control_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/control/c/common.h b/level_3/control/c/common.h index 69b844d..bf877c8 100644 --- a/level_3/control/c/common.h +++ b/level_3/control/c/common.h @@ -95,6 +95,7 @@ extern "C" { enum { control_parameter_help_e = 0, + control_parameter_copyright_e, control_parameter_light_e, control_parameter_dark_e, control_parameter_no_color_e, @@ -115,7 +116,8 @@ extern "C" { #define control_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -134,7 +136,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(control_short_socket_s, control_long_socket_s, 1, f_console_flag_normal_e), \ } - #define control_total_parameters_d 16 + #define control_total_parameters_d 17 #endif // _di_control_parameter_d_ /** @@ -192,6 +194,7 @@ extern "C" { * * control_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -204,14 +207,15 @@ extern "C" { #ifndef _di_control_main_flag_e_ enum { control_main_flag_none_e = 0x0, - control_main_flag_file_from_e = 0x1, - control_main_flag_file_to_e = 0x2, - control_main_flag_header_e = 0x4, - control_main_flag_help_e = 0x8, - control_main_flag_separate_e = 0x10, - control_main_flag_strip_invalid_e = 0x20, - control_main_flag_verify_e = 0x40, - control_main_flag_version_e = 0x80, + control_main_flag_copyright_e = 0x1, + control_main_flag_file_from_e = 0x2, + control_main_flag_file_to_e = 0x4, + control_main_flag_header_e = 0x8, + control_main_flag_help_e = 0x10, + control_main_flag_separate_e = 0x20, + control_main_flag_strip_invalid_e = 0x40, + control_main_flag_verify_e = 0x80, + control_main_flag_version_e = 0x100, }; // enum #endif // _di_control_main_flag_e_ diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index 2fb179a..1ad7632 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -59,8 +59,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[control_parameter_help_e].result & f_console_result_found_e) { control_print_help(main); @@ -73,6 +71,14 @@ extern "C" { return F_none; } + if (main->parameters.array[control_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + { uint8_t ids[] = { control_parameter_name_e, diff --git a/level_3/controller/c/common.c b/level_3/controller/c/common.c index 2caf0a1..007375a 100644 --- a/level_3/controller/c/common.c +++ b/level_3/controller/c/common.c @@ -702,6 +702,12 @@ extern "C" { return; } + if (main->parameters.array[controller_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= controller_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[controller_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/controller/c/common.h b/level_3/controller/c/common.h index 01a69a0..9504f82 100644 --- a/level_3/controller/c/common.h +++ b/level_3/controller/c/common.h @@ -117,6 +117,7 @@ extern "C" { enum { controller_parameter_help_e, + controller_parameter_copyright_e, controller_parameter_light_e, controller_parameter_dark_e, controller_parameter_no_color_e, @@ -143,7 +144,8 @@ extern "C" { #define controller_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -168,7 +170,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(controller_short_validate_s, controller_long_validate_s, 0, f_console_flag_normal_e), \ } - #define controller_total_parameters_d 22 + #define controller_total_parameters_d 23 #endif // _di_controller_parameter_d_ /** @@ -450,6 +452,7 @@ extern "C" { * * controller_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -462,14 +465,15 @@ extern "C" { #ifndef _di_controller_main_flag_e_ enum { controller_main_flag_none_e = 0x0, - controller_main_flag_file_from_e = 0x1, - controller_main_flag_file_to_e = 0x2, - controller_main_flag_header_e = 0x4, - controller_main_flag_help_e = 0x8, - controller_main_flag_separate_e = 0x10, - controller_main_flag_strip_invalid_e = 0x20, - controller_main_flag_verify_e = 0x40, - controller_main_flag_version_e = 0x80, + controller_main_flag_copyright_e = 0x1, + controller_main_flag_file_from_e = 0x2, + controller_main_flag_file_to_e = 0x4, + controller_main_flag_header_e = 0x8, + controller_main_flag_help_e = 0x10, + controller_main_flag_separate_e = 0x20, + controller_main_flag_strip_invalid_e = 0x40, + controller_main_flag_verify_e = 0x80, + controller_main_flag_version_e = 0x100, }; // enum #endif // _di_controller_main_flag_e_ diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index ea6e396..1bf10a2 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -64,10 +64,6 @@ extern "C" { } } - f_string_static_t * const argv = main->parameters.arguments.array; - - status = F_none; - if (main->parameters.array[controller_parameter_help_e].result & f_console_result_found_e) { controller_print_help(main); @@ -84,6 +80,16 @@ extern "C" { return F_none; } + if (main->parameters.array[controller_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + + f_string_static_t * const argv = main->parameters.arguments.array; + controller_setting_t setting = controller_setting_t_initialize; setting.control.server.address = (struct sockaddr *) &setting.control.address; diff --git a/level_3/controller/data/build/defines b/level_3/controller/data/build/defines index 63c654f..80818ea 100644 --- a/level_3/controller/data/build/defines +++ b/level_3/controller/data/build/defines @@ -1,6 +1,7 @@ # fss-0000 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap). + _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). _controller_as_init_ Build the program to run as if it were "init" by default, including displaying the program name as "Init Program" or "Init". This changes the main.c file only, leaving the library shareable between both "controller" and "init". _override_controller_default_engine_ Provide a custom scripting engine name string to execute (such as php). diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 31dd4d6..4388cb7 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -216,6 +216,12 @@ extern "C" { return; } + if (main->parameters.array[fake_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fake_main_flag_copyright_e; + + return; + } + f_array_length_t j = 0; f_array_length_t index = 0; diff --git a/level_3/fake/c/main/common.h b/level_3/fake/c/main/common.h index 31c3438..b5b613b 100644 --- a/level_3/fake/c/main/common.h +++ b/level_3/fake/c/main/common.h @@ -424,6 +424,7 @@ extern "C" { enum { fake_parameter_help_e, + fake_parameter_copyright_e, fake_parameter_light_e, fake_parameter_dark_e, fake_parameter_no_color_e, @@ -463,6 +464,7 @@ extern "C" { #define fake_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -498,7 +500,7 @@ extern "C" { macro_f_console_parameter_t_initialize_6(fake_other_operation_skeleton_s, 0, f_console_flag_simple_e), \ } - #define fake_total_parameters_d 31 + #define fake_total_parameters_d 32 #endif // _di_fake_parameter_d_ /** @@ -506,6 +508,7 @@ extern "C" { * * 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). @@ -526,22 +529,23 @@ extern "C" { #ifndef _di_fake_main_flag_e_ enum { fake_main_flag_none_e = 0x0, - fake_main_flag_enable_documents_e = 0x1, - fake_main_flag_enable_shared_e = 0x2, - fake_main_flag_enable_static_e = 0x4, - fake_main_flag_file_from_e = 0x8, - fake_main_flag_file_to_e = 0x10, - fake_main_flag_header_e = 0x20, - fake_main_flag_help_e = 0x40, - fake_data_flag_operation_e = 0x80, - fake_data_flag_operation_build_e = 0x100, - fake_data_flag_operation_clean_e = 0x200, - fake_data_flag_operation_make_e = 0x400, - fake_data_flag_operation_skeleton_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_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_file_from_e = 0x10, + fake_main_flag_file_to_e = 0x20, + fake_main_flag_header_e = 0x40, + fake_main_flag_help_e = 0x80, + fake_data_flag_operation_e = 0x100, + fake_data_flag_operation_build_e = 0x200, + fake_data_flag_operation_clean_e = 0x400, + fake_data_flag_operation_make_e = 0x800, + fake_data_flag_operation_skeleton_e = 0x1000, + fake_main_flag_separate_e = 0x2000, + fake_main_flag_strip_invalid_e = 0x4000, + fake_main_flag_verify_e = 0x8000, + fake_main_flag_version_e = 0x10000, }; // enum #endif // _di_fake_main_flag_e_ @@ -574,7 +578,7 @@ extern "C" { */ #ifndef _di_fake_setting_t_ typedef struct { - uint16_t flag; + uint32_t flag; f_state_t state; f_status_t status; diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index 513f875..657e30b 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -38,6 +38,12 @@ extern "C" { return; } + if (setting->flag & fake_main_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + if ((setting->flag & fake_data_flag_operation_build_e) && (setting->flag & fake_data_flag_operation_make_e)) { setting->status = F_status_set_error(F_parameter); diff --git a/level_3/fake/data/build/defines b/level_3/fake/data/build/defines index 427a9c7..546ad61 100644 --- a/level_3/fake/data/build/defines +++ b/level_3/fake/data/build/defines @@ -1,6 +1,7 @@ # fss-0000 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap). + _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). _pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 49f71b0..a22727d 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -66,12 +66,6 @@ extern "C" { } } - firewall_data_t data = firewall_data_t_initialize; - data.main = main; - data.argv = main->parameters.arguments.array; - - status = F_none; - if (main->parameters.array[firewall_parameter_help_e].result & f_console_result_found_e) { firewall_print_help(setting, main->message); @@ -84,6 +78,18 @@ extern "C" { return F_none; } + if (main->parameters.array[firewall_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + + firewall_data_t data = firewall_data_t_initialize; + data.main = main; + data.argv = main->parameters.arguments.array; + // now determine which command was placed first bool found_command = F_false; unsigned int command = 0; diff --git a/level_3/firewall/data/build/defines b/level_3/firewall/data/build/defines index 427a9c7..546ad61 100644 --- a/level_3/firewall/data/build/defines +++ b/level_3/firewall/data/build/defines @@ -1,6 +1,7 @@ # fss-0000 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap). + _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). _pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_basic_list_read/c/common.c b/level_3/fss_basic_list_read/c/common.c index 940455f..375798f 100644 --- a/level_3/fss_basic_list_read/c/common.c +++ b/level_3/fss_basic_list_read/c/common.c @@ -161,6 +161,12 @@ extern "C" { return; } + if (main->parameters.array[fss_basic_list_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_basic_list_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_basic_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_basic_list_read/c/common.h b/level_3/fss_basic_list_read/c/common.h index 83b359e..656a811 100644 --- a/level_3/fss_basic_list_read/c/common.h +++ b/level_3/fss_basic_list_read/c/common.h @@ -193,6 +193,7 @@ extern "C" { enum { fss_basic_list_read_parameter_help_e, + fss_basic_list_read_parameter_copyright_e, fss_basic_list_read_parameter_light_e, fss_basic_list_read_parameter_dark_e, fss_basic_list_read_parameter_no_color_e, @@ -223,7 +224,8 @@ extern "C" { #define fss_basic_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -252,7 +254,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_basic_list_read_total_parameters_d 26 + #define fss_basic_list_read_total_parameters_d 27 #endif // _di_fss_basic_list_read_parameter_d_ /** @@ -310,6 +312,7 @@ extern "C" { * * fss_basic_list_read_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -322,14 +325,15 @@ extern "C" { #ifndef _di_fss_basic_list_read_main_flag_e_ enum { fss_basic_list_read_main_flag_none_e = 0x0, - fss_basic_list_read_main_flag_file_from_e = 0x1, - fss_basic_list_read_main_flag_file_to_e = 0x2, - fss_basic_list_read_main_flag_header_e = 0x4, - fss_basic_list_read_main_flag_help_e = 0x8, - fss_basic_list_read_main_flag_separate_e = 0x10, - fss_basic_list_read_main_flag_strip_invalid_e = 0x20, - fss_basic_list_read_main_flag_verify_e = 0x40, - fss_basic_list_read_main_flag_version_e = 0x80, + fss_basic_list_read_main_flag_copyright_e = 0x1, + fss_basic_list_read_main_flag_file_from_e = 0x2, + fss_basic_list_read_main_flag_file_to_e = 0x4, + fss_basic_list_read_main_flag_header_e = 0x8, + fss_basic_list_read_main_flag_help_e = 0x10, + fss_basic_list_read_main_flag_separate_e = 0x20, + fss_basic_list_read_main_flag_strip_invalid_e = 0x40, + fss_basic_list_read_main_flag_verify_e = 0x80, + fss_basic_list_read_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_basic_list_read_main_flag_e_ diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index 774ceac..d2a3908 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -59,20 +59,26 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_basic_list_read_parameter_help_e].result & f_console_result_found_e) { fss_basic_list_read_print_help(setting, main->message); - return status; + return F_none; } if (main->parameters.array[fss_basic_list_read_parameter_version_e].result & f_console_result_found_e) { fll_program_print_version(main->message, fss_basic_list_read_program_version_s); - return status; + return F_none; } + if (main->parameters.array[fss_basic_list_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + // Provide a range designating where within the buffer a particular file exists, using a statically allocated array. fss_basic_list_read_file_t files_array[main->parameters.remaining.used + 1]; fss_basic_list_read_data_t data = fss_basic_list_read_data_t_initialize; diff --git a/level_3/fss_basic_read/c/common.c b/level_3/fss_basic_read/c/common.c index 62ed9c8..2411e51 100644 --- a/level_3/fss_basic_read/c/common.c +++ b/level_3/fss_basic_read/c/common.c @@ -160,6 +160,12 @@ extern "C" { return; } + if (main->parameters.array[fss_basic_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_basic_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_basic_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_basic_read/c/common.h b/level_3/fss_basic_read/c/common.h index 4743856..76e3317 100644 --- a/level_3/fss_basic_read/c/common.h +++ b/level_3/fss_basic_read/c/common.h @@ -191,6 +191,7 @@ extern "C" { enum { fss_basic_read_parameter_help_e, + fss_basic_read_parameter_copyright_e, fss_basic_read_parameter_light_e, fss_basic_read_parameter_dark_e, fss_basic_read_parameter_no_color_e, @@ -221,7 +222,8 @@ extern "C" { #define fss_basic_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -250,7 +252,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_basic_read_total_parameters_d 26 + #define fss_basic_read_total_parameters_d 27 #endif // _di_fss_basic_read_parameter_d_ /** @@ -308,6 +310,7 @@ extern "C" { * * fss_basic_read_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -320,14 +323,15 @@ extern "C" { #ifndef _di_fss_basic_read_main_flag_e_ enum { fss_basic_read_main_flag_none_e = 0x0, - fss_basic_read_main_flag_file_from_e = 0x1, - fss_basic_read_main_flag_file_to_e = 0x2, - fss_basic_read_main_flag_header_e = 0x4, - fss_basic_read_main_flag_help_e = 0x8, - fss_basic_read_main_flag_separate_e = 0x10, - fss_basic_read_main_flag_strip_invalid_e = 0x20, - fss_basic_read_main_flag_verify_e = 0x40, - fss_basic_read_main_flag_version_e = 0x80, + fss_basic_read_main_flag_copyright_e = 0x1, + fss_basic_read_main_flag_file_from_e = 0x2, + fss_basic_read_main_flag_file_to_e = 0x4, + fss_basic_read_main_flag_header_e = 0x8, + fss_basic_read_main_flag_help_e = 0x10, + fss_basic_read_main_flag_separate_e = 0x20, + fss_basic_read_main_flag_strip_invalid_e = 0x40, + fss_basic_read_main_flag_verify_e = 0x80, + fss_basic_read_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_basic_read_main_flag_e_ diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 5d1dd2a..f516c08 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -59,20 +59,26 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_basic_read_parameter_help_e].result & f_console_result_found_e) { fss_basic_read_print_help(setting, main->message); - return status; + return F_none; } if (main->parameters.array[fss_basic_read_parameter_version_e].result & f_console_result_found_e) { fll_program_print_version(main->message, fss_basic_read_program_version_s); - return status; + return F_none; } + if (main->parameters.array[fss_basic_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + // Provide a range designating where within the buffer a particular file exists, using a statically allocated array. fss_basic_read_file_t files_array[main->parameters.remaining.used + 1]; fss_basic_read_data_t data = fss_basic_read_data_t_initialize; diff --git a/level_3/fss_embedded_list_read/c/common.c b/level_3/fss_embedded_list_read/c/common.c index c9325bb..b246207 100644 --- a/level_3/fss_embedded_list_read/c/common.c +++ b/level_3/fss_embedded_list_read/c/common.c @@ -159,6 +159,12 @@ extern "C" { return; } + if (main->parameters.array[fss_embedded_list_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_embedded_list_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_embedded_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_embedded_list_read/c/common.h b/level_3/fss_embedded_list_read/c/common.h index a9cfd08..049987c 100644 --- a/level_3/fss_embedded_list_read/c/common.h +++ b/level_3/fss_embedded_list_read/c/common.h @@ -191,6 +191,7 @@ extern "C" { enum { fss_embedded_list_read_parameter_help_e, + fss_embedded_list_read_parameter_copyright_e, fss_embedded_list_read_parameter_light_e, fss_embedded_list_read_parameter_dark_e, fss_embedded_list_read_parameter_no_color_e, @@ -221,7 +222,8 @@ extern "C" { #define fss_embedded_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -250,7 +252,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_embedded_list_read_short_trim_s.string, fss_embedded_list_read_long_trim_s.string, 0, 0, f_console_flag_normal_e), \ } - #define fss_embedded_list_read_total_parameters_d 26 + #define fss_embedded_list_read_total_parameters_d 27 #endif // _di_fss_embedded_list_read_parameter_d_ /** @@ -291,6 +293,7 @@ extern "C" { * * fss_embedded_list_read_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -303,14 +306,15 @@ extern "C" { #ifndef _di_fss_embedded_list_read_main_flag_e_ enum { fss_embedded_list_read_main_flag_none_e = 0x0, - fss_embedded_list_read_main_flag_file_from_e = 0x1, - fss_embedded_list_read_main_flag_file_to_e = 0x2, - fss_embedded_list_read_main_flag_header_e = 0x4, - fss_embedded_list_read_main_flag_help_e = 0x8, - fss_embedded_list_read_main_flag_separate_e = 0x10, - fss_embedded_list_read_main_flag_strip_invalid_e = 0x20, - fss_embedded_list_read_main_flag_verify_e = 0x40, - fss_embedded_list_read_main_flag_version_e = 0x80, + fss_embedded_list_read_main_flag_copyright_e = 0x1, + fss_embedded_list_read_main_flag_file_from_e = 0x2, + fss_embedded_list_read_main_flag_file_to_e = 0x4, + fss_embedded_list_read_main_flag_header_e = 0x8, + fss_embedded_list_read_main_flag_help_e = 0x10, + fss_embedded_list_read_main_flag_separate_e = 0x20, + fss_embedded_list_read_main_flag_strip_invalid_e = 0x40, + fss_embedded_list_read_main_flag_verify_e = 0x80, + fss_embedded_list_read_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_embedded_list_read_main_flag_e_ diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 5abcaa3..ede790f 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -59,28 +59,30 @@ extern "C" { } } - fss_embedded_list_read_data_t data = fss_embedded_list_read_data_t_initialize; - data.main = main; - data.argv = main->parameters.arguments.array; - - status = F_none; - if (main->parameters.array[fss_embedded_list_read_parameter_help_e].result & f_console_result_found_e) { fss_embedded_list_read_print_help(setting, main->message); - fss_embedded_list_read_data_delete(&data); - return F_none; } if (main->parameters.array[fss_embedded_list_read_parameter_version_e].result & f_console_result_found_e) { fll_program_print_version(main->message, fss_embedded_list_read_program_version_s); - fss_embedded_list_read_data_delete(&data); + return F_none; + } + + if (main->parameters.array[fss_embedded_list_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); return F_none; } + status = F_none; + + fss_embedded_list_read_data_t data = fss_embedded_list_read_data_t_initialize; + data.main = main; + data.argv = main->parameters.arguments.array; + if (F_status_is_error_not(status) && (main->parameters.array[fss_embedded_list_read_parameter_total_e].result & f_console_result_found_e)) { if (main->parameters.array[fss_embedded_list_read_parameter_columns_e].result & f_console_result_found_e) { if (main->error.verbosity > f_console_verbosity_quiet_e) { diff --git a/level_3/fss_extended_list_read/c/common.c b/level_3/fss_extended_list_read/c/common.c index 45a689f..d2efda0 100644 --- a/level_3/fss_extended_list_read/c/common.c +++ b/level_3/fss_extended_list_read/c/common.c @@ -167,6 +167,12 @@ extern "C" { return; } + if (main->parameters.array[fss_extended_list_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_extended_list_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_extended_list_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_extended_list_read/c/common.h b/level_3/fss_extended_list_read/c/common.h index 48b39dc..46fe131 100644 --- a/level_3/fss_extended_list_read/c/common.h +++ b/level_3/fss_extended_list_read/c/common.h @@ -191,6 +191,7 @@ extern "C" { enum { fss_extended_list_read_parameter_help_e, + fss_extended_list_read_parameter_copyright_e fss_extended_list_read_parameter_light_e, fss_extended_list_read_parameter_dark_e, fss_extended_list_read_parameter_no_color_e, @@ -221,7 +222,8 @@ extern "C" { #define fss_extended_list_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -250,7 +252,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_extended_list_read_total_parameters_d 26 + #define fss_extended_list_read_total_parameters_d 27 #endif // _di_fss_extended_list_read_parameter_d_ /** @@ -308,6 +310,7 @@ extern "C" { * * fss_extended_list_read_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -320,14 +323,15 @@ extern "C" { #ifndef _di_fss_extended_list_read_main_flag_e_ enum { fss_extended_list_read_main_flag_none_e = 0x0, - fss_extended_list_read_main_flag_file_from_e = 0x1, - fss_extended_list_read_main_flag_file_to_e = 0x2, - fss_extended_list_read_main_flag_header_e = 0x4, - fss_extended_list_read_main_flag_help_e = 0x8, - fss_extended_list_read_main_flag_separate_e = 0x10, - fss_extended_list_read_main_flag_strip_invalid_e = 0x20, - fss_extended_list_read_main_flag_verify_e = 0x40, - fss_extended_list_read_main_flag_version_e = 0x80, + fss_extended_list_read_main_flag_copyright_e = 0x1, + fss_extended_list_read_main_flag_file_from_e = 0x2, + fss_extended_list_read_main_flag_file_to_e = 0x4, + fss_extended_list_read_main_flag_header_e = 0x8, + fss_extended_list_read_main_flag_help_e = 0x10, + fss_extended_list_read_main_flag_separate_e = 0x20, + fss_extended_list_read_main_flag_strip_invalid_e = 0x40, + fss_extended_list_read_main_flag_verify_e = 0x80, + fss_extended_list_read_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_extended_list_read_main_flag_e_ diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index f6e3ea2..944c56a 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -59,8 +59,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_extended_list_read_parameter_help_e].result & f_console_result_found_e) { fss_extended_list_read_print_help(setting, main->message); @@ -73,6 +71,14 @@ extern "C" { return status; } + if (main->parameters.array[fss_extended_list_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return status; + } + + status = F_none; + // Provide a range designating where within the buffer a particular file exists, using a statically allocated array. fss_extended_list_read_file_t files_array[main->parameters.remaining.used + 1]; fss_extended_list_read_data_t data = fss_extended_list_read_data_t_initialize; diff --git a/level_3/fss_extended_read/c/common.c b/level_3/fss_extended_read/c/common.c index e78fd2d..3fa4e22 100644 --- a/level_3/fss_extended_read/c/common.c +++ b/level_3/fss_extended_read/c/common.c @@ -160,6 +160,12 @@ extern "C" { return; } + if (main->parameters.array[fss_extended_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_extended_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_extended_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_extended_read/c/common.h b/level_3/fss_extended_read/c/common.h index da94ab3..49f5d5b 100644 --- a/level_3/fss_extended_read/c/common.h +++ b/level_3/fss_extended_read/c/common.h @@ -191,6 +191,7 @@ extern "C" { enum { fss_extended_read_parameter_help_e, + fss_extended_read_parameter_copyright_e, fss_extended_read_parameter_light_e, fss_extended_read_parameter_dark_e, fss_extended_read_parameter_no_color_e, @@ -221,7 +222,8 @@ extern "C" { #define fss_extended_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -249,7 +251,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_extended_read_total_parameters_d 26 + #define fss_extended_read_total_parameters_d 27 #endif // _di_fss_extended_read_parameter_d_ /** @@ -307,6 +309,7 @@ extern "C" { * * fss_extended_read_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -319,14 +322,15 @@ extern "C" { #ifndef _di_fss_extended_read_main_flag_e_ enum { fss_extended_read_main_flag_none_e = 0x0, - fss_extended_read_main_flag_file_from_e = 0x1, - fss_extended_read_main_flag_file_to_e = 0x2, - fss_extended_read_main_flag_header_e = 0x4, - fss_extended_read_main_flag_help_e = 0x8, - fss_extended_read_main_flag_separate_e = 0x10, - fss_extended_read_main_flag_strip_invalid_e = 0x20, - fss_extended_read_main_flag_verify_e = 0x40, - fss_extended_read_main_flag_version_e = 0x80, + fss_extended_read_main_flag_copyright_e = 0x1, + fss_extended_read_main_flag_file_from_e = 0x2, + fss_extended_read_main_flag_file_to_e = 0x4, + fss_extended_read_main_flag_header_e = 0x8, + fss_extended_read_main_flag_help_e = 0x10, + fss_extended_read_main_flag_separate_e = 0x20, + fss_extended_read_main_flag_strip_invalid_e = 0x40, + fss_extended_read_main_flag_verify_e = 0x80, + fss_extended_read_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_extended_read_main_flag_e_ diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index f3342f2..8b00764 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -59,8 +59,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_extended_read_parameter_help_e].result & f_console_result_found_e) { fss_extended_read_print_help(setting, main->message); @@ -73,6 +71,14 @@ extern "C" { return status; } + if (main->parameters.array[fss_extended_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return status; + } + + status = F_none; + // Provide a range designating where within the buffer a particular file exists, using a statically allocated array. fss_extended_read_file_t files_array[main->parameters.remaining.used + 1]; fss_extended_read_data_t data = fss_extended_read_data_t_initialize; diff --git a/level_3/fss_identify/c/common.c b/level_3/fss_identify/c/common.c index 79ccfc6..fb37b77 100644 --- a/level_3/fss_identify/c/common.c +++ b/level_3/fss_identify/c/common.c @@ -127,6 +127,12 @@ extern "C" { return; } + if (main->parameters.array[fss_identify_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_identify_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_identify_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_identify/c/common.h b/level_3/fss_identify/c/common.h index cafb8f5..be5b9b3 100644 --- a/level_3/fss_identify/c/common.h +++ b/level_3/fss_identify/c/common.h @@ -108,6 +108,7 @@ extern "C" { enum { fss_identify_parameter_help_e, + fss_identify_parameter_copyright_e, fss_identify_parameter_light_e, fss_identify_parameter_dark_e, fss_identify_parameter_no_color_e, @@ -129,7 +130,8 @@ extern "C" { #define fss_identify_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -149,7 +151,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_identify_total_parameters_d 17 + #define fss_identify_total_parameters_d 18 #endif // _di_fss_identify_parameter_d_ /** @@ -157,6 +159,7 @@ extern "C" { * * fss_identify_main_flag_*_e: * - none: No flags set. + * - copyright: Print copyright. * - file_from: Using a specified source file. * - file_to: Using a specified destination file. * - help: Print help. @@ -169,14 +172,15 @@ extern "C" { #ifndef _di_fss_identify_main_flag_e_ enum { fss_identify_main_flag_none_e = 0x0, - fss_identify_main_flag_file_from_e = 0x1, - fss_identify_main_flag_file_to_e = 0x2, - fss_identify_main_flag_header_e = 0x4, - fss_identify_main_flag_help_e = 0x8, - fss_identify_main_flag_separate_e = 0x10, - fss_identify_main_flag_strip_invalid_e = 0x20, - fss_identify_main_flag_verify_e = 0x40, - fss_identify_main_flag_version_e = 0x80, + fss_identify_main_flag_copyright_e = 0x1, + fss_identify_main_flag_file_from_e = 0x2, + fss_identify_main_flag_file_to_e = 0x4, + fss_identify_main_flag_header_e = 0x8, + fss_identify_main_flag_help_e = 0x10, + fss_identify_main_flag_separate_e = 0x20, + fss_identify_main_flag_strip_invalid_e = 0x40, + fss_identify_main_flag_verify_e = 0x80, + fss_identify_main_flag_version_e = 0x100, }; // enum #endif // _di_fss_identify_main_flag_e_ diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index a537fb3..307b1f6 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -58,8 +58,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_identify_parameter_help_e].result & f_console_result_found_e) { fss_identify_print_help(setting, main->message); @@ -72,6 +70,14 @@ extern "C" { return F_none; } + if (main->parameters.array[fss_identify_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return F_none; + } + + status = F_none; + fss_identify_data_t data = fss_identify_data_t_initialize; data.argv = main->parameters.arguments.array; diff --git a/level_3/fss_payload_read/c/common.c b/level_3/fss_payload_read/c/common.c index 322e213..6544fb4 100644 --- a/level_3/fss_payload_read/c/common.c +++ b/level_3/fss_payload_read/c/common.c @@ -161,6 +161,12 @@ extern "C" { return; } + if (main->parameters.array[fss_payload_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_payload_read_main_flag_copyright_e; + + return; + } + f_string_static_t * const args = main->parameters.arguments.array; if (main->parameters.array[fss_payload_read_parameter_strip_invalid_e].result & f_console_result_found_e) { diff --git a/level_3/fss_payload_read/c/common.h b/level_3/fss_payload_read/c/common.h index 239912c..61b2072 100644 --- a/level_3/fss_payload_read/c/common.h +++ b/level_3/fss_payload_read/c/common.h @@ -185,6 +185,7 @@ extern "C" { enum { fss_payload_read_parameter_help_e, + fss_payload_read_parameter_copyright_e, fss_payload_read_parameter_light_e, fss_payload_read_parameter_dark_e, fss_payload_read_parameter_no_color_e, @@ -215,7 +216,8 @@ extern "C" { #define fss_payload_read_console_parameter_t_initialize \ { \ - macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e, 0), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -244,7 +246,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_flag_normal_e), \ } - #define fss_payload_read_total_parameters_d 26 + #define fss_payload_read_total_parameters_d 27 #endif // _di_fss_payload_read_parameter_d_ /** @@ -304,6 +306,7 @@ extern "C" { * - 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. @@ -322,18 +325,19 @@ extern "C" { fss_payload_read_main_flag_none_e = 0x0, fss_payload_read_main_flag_at_e = 0x1, fss_payload_read_main_flag_content_e = 0x2, - fss_payload_read_main_flag_help_e = 0x4, - fss_payload_read_main_flag_literal_e = 0x8, - fss_payload_read_main_flag_line_e = 0x10, - fss_payload_read_main_flag_name_e = 0x20, - fss_payload_read_main_flag_object_e = 0x40, - fss_payload_read_main_flag_reassign_e = 0x80, - fss_payload_read_main_flag_replace_e = 0x100, - fss_payload_read_main_flag_substitute_e = 0x200, - fss_payload_read_main_flag_total_e = 0x400, - fss_payload_read_main_flag_version_e = 0x800, - fss_payload_read_main_flag_whole_e = 0x1000, - fss_payload_read_main_flag_wrap_e = 0x2000, + fss_payload_read_main_flag_copyright_e = 0x4, + fss_payload_read_main_flag_help_e = 0x8, + fss_payload_read_main_flag_literal_e = 0x10, + fss_payload_read_main_flag_line_e = 0x20, + fss_payload_read_main_flag_name_e = 0x40, + fss_payload_read_main_flag_object_e = 0x80, + fss_payload_read_main_flag_reassign_e = 0x100, + fss_payload_read_main_flag_replace_e = 0x200, + fss_payload_read_main_flag_substitute_e = 0x400, + fss_payload_read_main_flag_total_e = 0x800, + fss_payload_read_main_flag_version_e = 0x1000, + fss_payload_read_main_flag_whole_e = 0x2000, + fss_payload_read_main_flag_wrap_e = 0x4000, }; // enum #endif // _di_fss_payload_read_main_flag_e_ diff --git a/level_3/fss_payload_read/c/fss_payload_read.c b/level_3/fss_payload_read/c/fss_payload_read.c index 778f84b..56e5f98 100644 --- a/level_3/fss_payload_read/c/fss_payload_read.c +++ b/level_3/fss_payload_read/c/fss_payload_read.c @@ -59,8 +59,6 @@ extern "C" { } } - status = F_none; - if (main->parameters.array[fss_payload_read_parameter_help_e].result & f_console_result_found_e) { fss_payload_read_print_help(setting, main->message); @@ -73,6 +71,14 @@ extern "C" { return status; } + if (main->parameters.array[fss_payload_read_parameter_copyright_e].result & f_console_result_found_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return status; + } + + status = F_none; + // Provide a range designating where within the buffer a particular file exists, using a statically allocated array. fss_payload_read_file_t files_array[main->parameters.remaining.used + 1]; fss_payload_read_data_t data = fss_payload_read_data_t_initialize; diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index 05f33ed..2e530dc 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -151,6 +151,10 @@ extern "C" { setting->flag |= fss_write_flag_version_e; } + if (main->parameters.array[fss_write_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= fss_write_flag_copyright_e; + } + if (callback) { callback(arguments, state, main, setting); if (F_status_is_error(setting->status)) return; diff --git a/level_3/fss_write/c/main/common.h b/level_3/fss_write/c/main/common.h index aee7ca0..03af4a9 100644 --- a/level_3/fss_write/c/main/common.h +++ b/level_3/fss_write/c/main/common.h @@ -221,6 +221,7 @@ extern "C" { enum { fss_write_parameter_help_e, + fss_write_parameter_copyright_e, fss_write_parameter_light_e, fss_write_parameter_dark_e, fss_write_parameter_no_color_e, @@ -252,6 +253,7 @@ extern "C" { #define fss_write_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -280,7 +282,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(fss_write_short_trim_s, fss_write_long_trim_s, 0, f_console_flag_normal_e), \ } - #define fss_write_total_parameters_d 26 + #define fss_write_total_parameters_d 27 #endif // _di_fss_write_parameter_d_ /** @@ -292,6 +294,7 @@ extern "C" { * - 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). @@ -309,15 +312,16 @@ extern "C" { fss_write_flag_content_end_e = 0x2, fss_write_flag_content_multiple_e = 0x4, fss_write_flag_content_next_e = 0x8, - fss_write_flag_file_to_e = 0x10, - fss_write_flag_help_e = 0x20, - fss_write_flag_ignore_e = 0x40, - fss_write_flag_object_e = 0x80, - fss_write_flag_object_open_e = 0x100, - fss_write_flag_partial_e = 0x200, - fss_write_flag_prepend_e = 0x400, - fss_write_flag_trim_e = 0x800, - fss_write_flag_version_e = 0x1000, + fss_write_flag_copyright_e = 0x10, + fss_write_flag_file_to_e = 0x20, + fss_write_flag_help_e = 0x40, + fss_write_flag_ignore_e = 0x80, + fss_write_flag_object_e = 0x100, + fss_write_flag_object_open_e = 0x200, + fss_write_flag_partial_e = 0x400, + fss_write_flag_prepend_e = 0x800, + fss_write_flag_trim_e = 0x1000, + fss_write_flag_version_e = 0x2000, }; // enum #endif // _di_fss_write_flag_e_ diff --git a/level_3/fss_write/c/main/fss_write.c b/level_3/fss_write/c/main/fss_write.c index 7cdb5f1..ea8288e 100644 --- a/level_3/fss_write/c/main/fss_write.c +++ b/level_3/fss_write/c/main/fss_write.c @@ -31,6 +31,12 @@ extern "C" { return; } + if (setting->flag & fss_write_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + setting->escaped.used = 0; if (main->pipe & fll_program_data_pipe_input_e) { diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index 6a5bb38..c1ff6ba 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -152,6 +152,12 @@ extern "C" { return; } + + if (main->parameters.array[iki_read_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= iki_read_main_flag_copyright_e; + + return; + } } if (!(main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e))) { diff --git a/level_3/iki_read/c/main/common.h b/level_3/iki_read/c/main/common.h index f323261..09012eb 100644 --- a/level_3/iki_read/c/main/common.h +++ b/level_3/iki_read/c/main/common.h @@ -164,6 +164,7 @@ extern "C" { enum { iki_read_parameter_help_e, + iki_read_parameter_copyright_e, iki_read_parameter_light_e, iki_read_parameter_dark_e, iki_read_parameter_no_color_e, @@ -193,6 +194,7 @@ extern "C" { #define iki_read_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -219,7 +221,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(iki_read_short_wrap_s, iki_read_long_wrap_s, 3, f_console_flag_normal_e), \ } - #define iki_read_total_parameters_d 24 + #define iki_read_total_parameters_d 25 #endif // _di_iki_read_parameter_d_ #ifndef _di_iki_read_substitution_t_ @@ -249,6 +251,7 @@ extern "C" { * - 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. @@ -267,18 +270,19 @@ extern "C" { 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_help_e = 0x4, - iki_read_main_flag_literal_e = 0x8, - iki_read_main_flag_line_e = 0x10, - iki_read_main_flag_name_e = 0x20, - iki_read_main_flag_object_e = 0x40, - iki_read_main_flag_reassign_e = 0x80, - iki_read_main_flag_replace_e = 0x100, - iki_read_main_flag_substitute_e = 0x200, - iki_read_main_flag_total_e = 0x400, - iki_read_main_flag_version_e = 0x800, - iki_read_main_flag_whole_e = 0x1000, - iki_read_main_flag_wrap_e = 0x2000, + 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_reassign_e = 0x100, + iki_read_main_flag_replace_e = 0x200, + iki_read_main_flag_substitute_e = 0x400, + iki_read_main_flag_total_e = 0x800, + iki_read_main_flag_version_e = 0x1000, + iki_read_main_flag_whole_e = 0x2000, + iki_read_main_flag_wrap_e = 0x4000, }; #endif // _di_iki_read_main_flag_e_ diff --git a/level_3/iki_read/c/main/iki_read.c b/level_3/iki_read/c/main/iki_read.c index 0a6fd51..c141a77 100644 --- a/level_3/iki_read/c/main/iki_read.c +++ b/level_3/iki_read/c/main/iki_read.c @@ -31,6 +31,12 @@ extern "C" { return; } + if (setting->flag & iki_read_main_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + if (main->pipe & fll_program_data_pipe_input_e) { f_file_t file = f_file_t_initialize; diff --git a/level_3/iki_write/c/main/common.c b/level_3/iki_write/c/main/common.c index b1e67d2..8c3d41e 100644 --- a/level_3/iki_write/c/main/common.c +++ b/level_3/iki_write/c/main/common.c @@ -134,6 +134,12 @@ extern "C" { return; } + if (main->parameters.array[iki_write_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= iki_write_main_flag_copyright_e; + + return; + } + if (main->parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->parameters.array[iki_write_parameter_file_e].values.used) { if (main->parameters.array[iki_write_parameter_file_e].values.used > 1) { setting->status = F_status_set_error(F_parameter); diff --git a/level_3/iki_write/c/main/common.h b/level_3/iki_write/c/main/common.h index c8725d5..66f68eb 100644 --- a/level_3/iki_write/c/main/common.h +++ b/level_3/iki_write/c/main/common.h @@ -125,6 +125,7 @@ extern "C" { enum { iki_write_parameter_help_e, + iki_write_parameter_copyright_e, iki_write_parameter_light_e, iki_write_parameter_dark_e, iki_write_parameter_no_color_e, @@ -148,6 +149,7 @@ extern "C" { #define iki_write_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -168,28 +170,30 @@ extern "C" { macro_f_console_parameter_t_initialize_3(iki_write_short_single_s, iki_write_long_single_s, 0, f_console_flag_normal_e), \ } - #define iki_write_total_parameters_d 18 + #define iki_write_total_parameters_d 19 #endif // _di_iki_write_parameter_d_ /** * Flags passed to the main function or program. * * iki_write_main_flag_*_e: - * - none: No flags set. - * - content: The Content being written is specified. - * - file_to: Using a specified destination file. - * - help: Print help. - * - object: The Object being written is specified. - * - version: Print version. + * - 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. + * - version: Print version. */ #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_file_to_e = 0x2, - iki_write_main_flag_help_e = 0x4, - iki_write_main_flag_object_e = 0x8, - iki_write_main_flag_version_e = 0x10, + 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_version_e = 0x20, }; #endif // _di_iki_write_main_flag_e_ diff --git a/level_3/iki_write/c/main/iki_write.c b/level_3/iki_write/c/main/iki_write.c index f18ad87..b1686ba 100644 --- a/level_3/iki_write/c/main/iki_write.c +++ b/level_3/iki_write/c/main/iki_write.c @@ -31,6 +31,12 @@ extern "C" { return; } + if (setting->flag & iki_write_main_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + setting->escaped.used = 0; if (main->pipe & fll_program_data_pipe_input_e) { diff --git a/level_3/status_code/c/main/common.c b/level_3/status_code/c/main/common.c index 2831a42..627aac9 100644 --- a/level_3/status_code/c/main/common.c +++ b/level_3/status_code/c/main/common.c @@ -124,6 +124,12 @@ extern "C" { return; } + + if (main->parameters.array[status_code_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= status_code_main_flag_copyright_e; + + return; + } } if (main->parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) { diff --git a/level_3/status_code/c/main/common.h b/level_3/status_code/c/main/common.h index 514e6af..c26e30a 100644 --- a/level_3/status_code/c/main/common.h +++ b/level_3/status_code/c/main/common.h @@ -148,6 +148,7 @@ extern "C" { enum { status_code_parameter_help_e, + status_code_parameter_copyright_e, status_code_parameter_light_e, status_code_parameter_dark_e, status_code_parameter_no_color_e, @@ -169,6 +170,7 @@ extern "C" { #define status_code_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -187,7 +189,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(status_code_short_number_s, status_code_long_number_s, 0, f_console_flag_normal_e), \ } - #define status_code_total_parameters_d 16 + #define status_code_total_parameters_d 17 #endif // _di_status_code_parameter_d_ /** @@ -196,23 +198,25 @@ extern "C" { * 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. - * - error: Check if status is "error". - * - fine: Check if status is "fine". - * - help: Print help. - * - number: Operate in number mode. - * - version: Print version. - * - warning: Check if status is "warning". + * - 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. + * - version: Print version. + * - 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_error_e = 0x1, - status_code_main_flag_fine_e = 0x2, - status_code_main_flag_help_e = 0x4, - status_code_main_flag_number_e = 0x8, - status_code_main_flag_version_e = 0x10, - status_code_main_flag_warning_e = 0x20, + 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_version_e = 0x20, + status_code_main_flag_warning_e = 0x40, }; #endif // _di_status_code_main_flag_e_ diff --git a/level_3/status_code/c/main/status_code.c b/level_3/status_code/c/main/status_code.c index 7012b89..a1ef2e8 100644 --- a/level_3/status_code/c/main/status_code.c +++ b/level_3/status_code/c/main/status_code.c @@ -45,6 +45,12 @@ extern "C" { return; } + if (setting->flag & status_code_main_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + f_status_t status2 = F_none; if (setting->flag & status_code_main_flag_number_e) { diff --git a/level_3/utf8/c/main/common.c b/level_3/utf8/c/main/common.c index 6756ae8..2758a5c 100644 --- a/level_3/utf8/c/main/common.c +++ b/level_3/utf8/c/main/common.c @@ -245,6 +245,12 @@ extern "C" { return; } + if (main->parameters.array[utf8_parameter_copyright_e].result & f_console_result_found_e) { + setting->flag |= utf8_main_flag_copyright_e; + + return; + } + if (main->parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) { if (main->parameters.array[utf8_parameter_to_file_e].values.used > 1) { setting->status = F_status_set_error(F_parameter); diff --git a/level_3/utf8/c/main/common.h b/level_3/utf8/c/main/common.h index 1012a9b..f3a321a 100644 --- a/level_3/utf8/c/main/common.h +++ b/level_3/utf8/c/main/common.h @@ -244,6 +244,7 @@ extern "C" { enum { utf8_parameter_help_e, + utf8_parameter_copyright_e, utf8_parameter_light_e, utf8_parameter_dark_e, utf8_parameter_no_color_e, @@ -276,6 +277,7 @@ extern "C" { #define utf8_console_parameter_t_initialize \ { \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_help_s, f_console_standard_long_help_s, 0, f_console_flag_normal_e), \ + macro_f_console_parameter_t_initialize_3(f_console_standard_short_copyright_s, f_console_standard_long_copyright_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_light_s, f_console_standard_long_light_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_dark_s, f_console_standard_long_dark_s, 0, f_console_flag_inverse_e), \ macro_f_console_parameter_t_initialize_3(f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, 0, f_console_flag_inverse_e), \ @@ -302,7 +304,7 @@ extern "C" { macro_f_console_parameter_t_initialize_3(utf8_short_verify_s, utf8_long_verify_s, 0, f_console_flag_normal_e), \ } - #define utf8_total_parameters_d 24 + #define utf8_total_parameters_d 25 #endif // _di_utf8_parameter_d_ /** @@ -338,6 +340,7 @@ extern "C" { * * 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. @@ -351,15 +354,16 @@ extern "C" { #ifndef _di_utf8_main_flag_e_ enum { utf8_main_flag_none_e = 0x0, - utf8_main_flag_file_from_e = 0x1, - utf8_main_flag_file_to_e = 0x2, - utf8_main_flag_header_e = 0x4, - utf8_main_flag_help_e = 0x8, - utf8_main_flag_pipe_e = 0x10, - utf8_main_flag_separate_e = 0x20, - utf8_main_flag_strip_invalid_e = 0x40, - utf8_main_flag_verify_e = 0x80, - utf8_main_flag_version_e = 0x100, + 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, }; // enum #endif // _di_utf8_main_flag_e_ diff --git a/level_3/utf8/c/main/utf8.c b/level_3/utf8/c/main/utf8.c index bdd2066..136d97a 100644 --- a/level_3/utf8/c/main/utf8.c +++ b/level_3/utf8/c/main/utf8.c @@ -33,6 +33,12 @@ extern "C" { return; } + if (setting->flag & utf8_main_flag_copyright_e) { + fll_program_print_copyright(main->message, (setting->line_first.used ? 0x1 : 0x0) | (setting->line_last.used ? 0x2 : 0x0)); + + return; + } + if (!(setting->flag & utf8_main_flag_header_e)) { utf8_print_line_first_locked(setting, main->message); } -- 1.8.3.1