From 6a49e470343cd7c505ab1b942e28f69567c6d9c4 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 16 Oct 2021 22:43:57 -0500 Subject: [PATCH] Refactor: Convert old f_file_t output strategy to the newer fl_print_t output strategy. The "f_file_t output" should now be "fl_print_t output". The output verbosity can now be used rather than the error verbosity for output verbosity. This makes the code more readable and consistent. The default fl_print_t_initialize is for normal output so also convert the error output initialization to use macro_fl_print_t_initialize_error(). --- level_3/byte_dump/c/byte_dump.c | 130 ++++----- level_3/byte_dump/c/byte_dump.h | 8 +- level_3/byte_dump/c/private-byte_dump.c | 272 +++++++++---------- level_3/control/c/control.c | 36 +-- level_3/control/c/control.h | 8 +- level_3/controller/c/controller.c | 64 ++--- level_3/controller/c/controller.h | 4 +- level_3/controller/c/private-controller.c | 128 ++++----- level_3/controller/c/private-rule.c | 299 ++++++++++----------- level_3/fake/c/fake.c | 104 +++---- level_3/fake/c/fake.h | 8 +- level_3/fake/c/private-build.c | 60 +++-- level_3/fake/c/private-clean.c | 22 +- level_3/fake/c/private-fake.c | 12 +- level_3/fake/c/private-make.c | 137 +++++----- level_3/fake/c/private-skeleton.c | 18 +- level_3/firewall/c/firewall.c | 73 ++--- level_3/firewall/c/firewall.h | 8 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 164 +++++------ .../fss_basic_list_read/c/fss_basic_list_read.h | 8 +- .../c/private-fss_basic_list_read.c | 86 +++--- .../fss_basic_list_write/c/fss_basic_list_write.c | 80 +++--- .../fss_basic_list_write/c/fss_basic_list_write.h | 8 +- level_3/fss_basic_read/c/fss_basic_read.c | 164 +++++------ level_3/fss_basic_read/c/fss_basic_read.h | 8 +- level_3/fss_basic_read/c/private-fss_basic_read.c | 82 +++--- level_3/fss_basic_write/c/fss_basic_write.c | 76 +++--- level_3/fss_basic_write/c/fss_basic_write.h | 8 +- .../c/fss_embedded_list_read.c | 166 ++++++------ .../c/fss_embedded_list_read.h | 8 +- .../c/private-fss_embedded_list_read.c | 50 ++-- .../c/fss_embedded_list_write.c | 102 +++---- .../c/fss_embedded_list_write.h | 8 +- .../c/fss_extended_list_read.c | 164 +++++------ .../c/fss_extended_list_read.h | 8 +- .../c/private-fss_extended_list_read.c | 84 +++--- .../c/fss_extended_list_write.c | 102 +++---- .../c/fss_extended_list_write.h | 8 +- level_3/fss_extended_read/c/fss_extended_read.c | 164 +++++------ level_3/fss_extended_read/c/fss_extended_read.h | 8 +- .../c/private-fss_extended_read.c | 102 +++---- level_3/fss_extended_write/c/fss_extended_write.c | 76 +++--- level_3/fss_extended_write/c/fss_extended_write.h | 8 +- level_3/fss_identify/c/fss_identify.c | 74 ++--- level_3/fss_identify/c/fss_identify.h | 8 +- level_3/fss_identify/c/private-fss_identify.c | 12 +- level_3/fss_status_code/c/fss_status_code.c | 58 ++-- level_3/fss_status_code/c/fss_status_code.h | 8 +- .../fss_status_code/c/private-fss_status_code.c | 42 +-- level_3/iki_read/c/iki_read.c | 82 +++--- level_3/iki_read/c/iki_read.h | 8 +- level_3/iki_read/c/private-iki_read.c | 56 ++-- level_3/iki_write/c/iki_write.c | 86 +++--- level_3/iki_write/c/iki_write.h | 8 +- level_3/status_code/c/private-status_code.c | 42 +-- level_3/status_code/c/status_code.c | 58 ++-- level_3/status_code/c/status_code.h | 8 +- 57 files changed, 1883 insertions(+), 1800 deletions(-) diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 55dd926..02c57c7 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -7,64 +7,64 @@ extern "C" { #endif #ifndef _di_byte_dump_print_help_ - f_status_t byte_dump_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t byte_dump_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, byte_dump_name_long, byte_dump_version); + fll_program_print_help_header(file, context, byte_dump_name_long, byte_dump_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display binary representation."); - fll_program_print_help_option(output, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display decimal representation."); - fll_program_print_help_option(output, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display duodecimal representation."); - fll_program_print_help_option(output, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Display hexadecimal representation."); - fll_program_print_help_option(output, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display octal representation."); - fll_program_print_help_option(output, context, byte_dump_short_unicode, byte_dump_long_unicode, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display using Unicode representation for valid Unicode (like: U+0000)."); + fll_program_print_help_option(file, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display binary representation."); + fll_program_print_help_option(file, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display decimal representation."); + fll_program_print_help_option(file, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display duodecimal representation."); + fll_program_print_help_option(file, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Display hexadecimal representation."); + fll_program_print_help_option(file, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display octal representation."); + fll_program_print_help_option(file, context, byte_dump_short_unicode, byte_dump_long_unicode, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Display using Unicode representation for valid Unicode (like: U+0000)."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Start reading at this byte offset."); - fll_program_print_help_option(output, context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Stop reading at this (inclusive) byte offset."); - fll_program_print_help_option(output, context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Set number of columns of Bytes to display."); + fll_program_print_help_option(file, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Start reading at this byte offset."); + fll_program_print_help_option(file, context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Stop reading at this (inclusive) byte offset."); + fll_program_print_help_option(file, context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Set number of columns of Bytes to display."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include a column of text when displaying the bytes."); - fll_program_print_help_option(output, context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use a placeholder character instead of a space for placeholders."); + fll_program_print_help_option(file, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include a column of text when displaying the bytes."); + fll_program_print_help_option(file, context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use a placeholder character instead of a space for placeholders."); - f_print_character(f_string_eol_s[0], output.stream); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); + f_print_character(f_string_eol_s[0], file.stream); - fl_print_format(" %[Special Options:%] ", output.stream, context.set.important, context.set.important); + fl_print_format(" %[Special Options:%] ", file.stream, context.set.important, context.set.important); - fll_program_print_help_option_long(output, context, byte_dump_long_normal, f_console_symbol_long_enable_s, " Display UTF-8 symbols for ASCII control codes."); - fll_program_print_help_option_long(output, context, byte_dump_long_simple, f_console_symbol_long_enable_s, " Display spaces for ASCII control codes."); - fll_program_print_help_option_long(output, context, byte_dump_long_classic, f_console_symbol_long_enable_s, "Display periods for ASCII control codes."); + fll_program_print_help_option_long(file, context, byte_dump_long_normal, f_console_symbol_long_enable_s, " Display UTF-8 symbols for ASCII control codes."); + fll_program_print_help_option_long(file, context, byte_dump_long_simple, f_console_symbol_long_enable_s, " Display spaces for ASCII control codes."); + fll_program_print_help_option_long(file, context, byte_dump_long_classic, f_console_symbol_long_enable_s, "Display periods for ASCII control codes."); - fll_program_print_help_usage(output, context, byte_dump_name, "filename(s)"); + fll_program_print_help_usage(file, context, byte_dump_name, "filename(s)"); - fl_print_format(" When using the %[%s%s%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_text, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_text, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the %[%s%s%] option is used).%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_placeholder, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the %[%s%s%] option is used).%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_placeholder, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When %[%s%s%] is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When %[%s%s%] is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, invalid Unicode will fallback to being displayed using one of the other modes.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_unicode, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, invalid Unicode will fallback to being displayed using one of the other modes.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_unicode, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -122,18 +122,22 @@ extern "C" { } if (choice == byte_dump_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == byte_dump_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == byte_dump_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == byte_dump_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -201,14 +205,14 @@ extern "C" { } if (main->parameters[byte_dump_parameter_help].result == f_console_result_found) { - byte_dump_print_help(main->output, main->context); + byte_dump_print_help(main->output.to, main->context); byte_dump_main_delete(main); return F_none; } if (main->parameters[byte_dump_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, byte_dump_version); + fll_program_print_version(main->output.to, byte_dump_version); byte_dump_main_delete(main); return F_none; @@ -361,30 +365,30 @@ extern "C" { file.id = f_type_descriptor_input; file.stream = f_type_input; - flockfile(main->output.stream); + flockfile(main->output.to.stream); - f_print_terminated(f_string_eol_s, main->output.stream); - fl_print_format("%[Piped Byte Dump: (in ", main->output.stream, main->context.set.title); + f_print_terminated(f_string_eol_s, main->output.to.stream); + fl_print_format("%[Piped Byte Dump: (in ", main->output.to.stream, main->context.set.title); if (main->mode == byte_dump_mode_hexidecimal) { - f_print_terminated("Hexidecimal", main->output.stream); + f_print_terminated("Hexidecimal", main->output.to.stream); } else if (main->mode == byte_dump_mode_duodecimal) { - f_print_terminated("Duodecimal", main->output.stream); + f_print_terminated("Duodecimal", main->output.to.stream); } else if (main->mode == byte_dump_mode_octal) { - f_print_terminated("Octal", main->output.stream); + f_print_terminated("Octal", main->output.to.stream); } else if (main->mode == byte_dump_mode_binary) { - f_print_terminated("Binary", main->output.stream); + f_print_terminated("Binary", main->output.to.stream); } else if (main->mode == byte_dump_mode_decimal) { - f_print_terminated("Decimal", main->output.stream); + f_print_terminated("Decimal", main->output.to.stream); } - fl_print_format(")%]%c", main->output.stream, main->context.set.title, f_string_eol_s[0]); + fl_print_format(")%]%c", main->output.to.stream, main->context.set.title, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); status = byte_dump_file(*main, 0, file); @@ -439,32 +443,32 @@ extern "C" { return status; } - flockfile(main->output.stream); + flockfile(main->output.to.stream); - f_print_terminated(f_string_eol_s, main->output.stream); - fl_print_format("%[Byte Dump of: %]%[", main->output.stream, main->context.set.title, main->context.set.title, main->context.set.notable); - fll_print_safely_terminated(arguments.argv[main->remaining.array[counter]], main->output.stream); - fl_print_format("%] %[(in ", main->output.stream, main->context.set.notable, main->context.set.title); + f_print_terminated(f_string_eol_s, main->output.to.stream); + fl_print_format("%[Byte Dump of: %]%[", main->output.to.stream, main->context.set.title, main->context.set.title, main->context.set.notable); + fll_print_safely_terminated(arguments.argv[main->remaining.array[counter]], main->output.to.stream); + fl_print_format("%] %[(in ", main->output.to.stream, main->context.set.notable, main->context.set.title); if (main->mode == byte_dump_mode_hexidecimal) { - f_print_terminated("Hexidecimal", main->output.stream); + f_print_terminated("Hexidecimal", main->output.to.stream); } else if (main->mode == byte_dump_mode_duodecimal) { - f_print_terminated("Duodecimal", main->output.stream); + f_print_terminated("Duodecimal", main->output.to.stream); } else if (main->mode == byte_dump_mode_octal) { - f_print_terminated("Octal", main->output.stream); + f_print_terminated("Octal", main->output.to.stream); } else if (main->mode == byte_dump_mode_binary) { - f_print_terminated("Binary", main->output.stream); + f_print_terminated("Binary", main->output.to.stream); } else if (main->mode == byte_dump_mode_decimal) { - f_print_terminated("Decimal", main->output.stream); + f_print_terminated("Decimal", main->output.to.stream); } - fl_print_format(")%]%c", main->output.stream, main->context.set.title, f_string_eol_s[0]); + fl_print_format(")%]%c", main->output.to.stream, main->context.set.title, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); status = byte_dump_file(*main, arguments.argv[main->remaining.array[counter]], file); diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index dd55ce2..e0d469a 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -229,7 +229,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -247,8 +247,8 @@ extern "C" { byte_dump_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ @@ -262,7 +262,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -271,7 +271,7 @@ extern "C" { * F_none on success. */ #ifndef _di_byte_dump_print_help_ - extern f_status_t byte_dump_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t byte_dump_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_byte_dump_print_help_ /** diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 87bd3d8..92cf34d 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -132,7 +132,7 @@ extern "C" { } } - flockfile(main.output.stream); + flockfile(main.output.to.stream); if (byte_dump_print_character_fragment(main, characters, invalid, width_utf, 1, &previous, &cell, &offset) == F_true) { character_reset = F_true; @@ -159,7 +159,7 @@ extern "C" { position += width_utf; if (position >= main.last) { - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); break; } @@ -169,19 +169,19 @@ extern "C" { ++position; if (position >= main.last) { - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); break; } } - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); width_utf = -1; } // for } - flockfile(main.output.stream); + flockfile(main.output.to.stream); // Print placeholders to fill out the remaining line and then optionally print the text block. if (cell.column && cell.column < main.width) { @@ -191,22 +191,22 @@ extern "C" { while (cell.column < main.width) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_hexidecimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_duodecimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_octal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_binary) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_decimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } ++cell.column; @@ -214,32 +214,32 @@ extern "C" { if (cell.column < main.width) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { if (!(cell.column % 4)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_hexidecimal) { if (!(cell.column % 8)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_duodecimal) { if (!(cell.column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_octal) { if (!(cell.column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_binary) { if (!(cell.column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_decimal) { if (!(cell.column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } } @@ -249,16 +249,16 @@ extern "C" { byte_dump_print_text(main, characters, invalid, &previous, &offset); } else { - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); // make sure to flush standard out to help prevent standard error from causing poblems. - fflush(main.output.stream); + fflush(main.output.to.stream); if (found_invalid_utf) { flockfile(main.error.to.stream); @@ -312,7 +312,7 @@ extern "C" { } if (!cell->column) { - fl_print_format("%[%016_UL%] ", main.output.stream, main.context.set.notable, cell->row, main.context.set.notable); + fl_print_format("%[%016_UL%] ", main.output.to.stream, main.context.set.notable, cell->row, main.context.set.notable); if (*offset) { uint8_t offset_to_print = *offset; @@ -321,22 +321,22 @@ extern "C" { while (offset_to_print && cell->column < main.width) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_hexidecimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_duodecimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_octal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_binary) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } else if (main.mode == byte_dump_mode_decimal) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } --offset_to_print; @@ -345,32 +345,32 @@ extern "C" { if (cell->column < main.width) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { if (!(cell->column % 4)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_hexidecimal) { if (!(cell->column % 8)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_duodecimal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_octal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_binary) { if (!(cell->column % 4)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_decimal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } } @@ -412,73 +412,73 @@ extern "C" { } if (width_utf < 4) { - fl_print_format(" U+%04_U ", main.output.stream, unicode); + fl_print_format(" U+%04_U ", main.output.to.stream, unicode); } else { - fl_print_format(" U+%06_U ", main.output.stream, unicode); + fl_print_format(" U+%06_U ", main.output.to.stream, unicode); } } else { // Pad the characters that are incomplete fragments of an already printed valid Unicode. - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } } else { if (main.mode == byte_dump_mode_hexidecimal) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } if (invalid[character_current]) { - fl_print_format(" %[%02_uii%]", main.output.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); + fl_print_format(" %[%02_uii%]", main.output.to.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); } else { - fl_print_format(" %02_uii", main.output.stream, (uint8_t) byte); + fl_print_format(" %02_uii", main.output.to.stream, (uint8_t) byte); } } else if (main.mode == byte_dump_mode_duodecimal) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } if (invalid[character_current]) { - fl_print_format(" %[%03&uii%]", main.output.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); + fl_print_format(" %[%03&uii%]", main.output.to.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); } else { - fl_print_format(" %03&uii", main.output.stream, (uint8_t) byte); + fl_print_format(" %03&uii", main.output.to.stream, (uint8_t) byte); } } else if (main.mode == byte_dump_mode_octal) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } if (invalid[character_current]) { - fl_print_format(" %[%03@uii%]", main.output.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); + fl_print_format(" %[%03@uii%]", main.output.to.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); } else { - fl_print_format(" %03@uii", main.output.stream, (uint8_t) byte); + fl_print_format(" %03@uii", main.output.to.stream, (uint8_t) byte); } } else if (main.mode == byte_dump_mode_binary) { if (invalid[character_current]) { - fl_print_format(" %[%08!uii%]", main.output.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); + fl_print_format(" %[%08!uii%]", main.output.to.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); } else { - fl_print_format(" %08!uii", main.output.stream, (uint8_t) byte); + fl_print_format(" %08!uii", main.output.to.stream, (uint8_t) byte); } } else if (main.mode == byte_dump_mode_decimal) { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); } if (invalid[character_current]) { - fl_print_format(" %[%3uii%]", main.output.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); + fl_print_format(" %[%3uii%]", main.output.to.stream, main.context.set.error, (uint8_t) byte, main.context.set.error); } else { - fl_print_format(" %3uii", main.output.stream, (uint8_t) byte); + fl_print_format(" %3uii", main.output.to.stream, (uint8_t) byte); } } } @@ -499,7 +499,7 @@ extern "C" { byte_dump_print_text(main, characters, invalid, previous, offset); } else { - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } cell->column = 0; @@ -517,32 +517,32 @@ extern "C" { else { if (main.parameters[byte_dump_parameter_unicode].result == f_console_result_found) { if (!(cell->column % 4)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_hexidecimal) { if (!(cell->column % 8)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_duodecimal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_octal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_binary) { if (!(cell->column % 4)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (main.mode == byte_dump_mode_decimal) { if (!(cell->column % 6)) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } } @@ -561,15 +561,15 @@ extern "C" { char byte[5] = { 0, 0, 0, 0, 0 }; - f_print_terminated(" ", main.output.stream); - fl_print_color_terminated(byte_dump_character_wall, main.context.set.notable, main.output.stream); - f_print_character(f_string_space_s[0], main.output.stream); + f_print_terminated(" ", main.output.to.stream); + fl_print_color_terminated(byte_dump_character_wall, main.context.set.notable, main.output.to.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); if (*offset) { if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { while (*offset && j < main.width) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); --(*offset); ++j; } // while @@ -579,16 +579,16 @@ extern "C" { while (*offset && j < main.width) { - f_print_terminated(" ", main.output.stream); + f_print_terminated(" ", main.output.to.stream); if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } else { - fl_print_color_terminated(f_string_space_s, main.context.set.warning, main.output.stream); + fl_print_color_terminated(f_string_space_s, main.context.set.warning, main.output.to.stream); } - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); --(*offset); ++j; } // while @@ -608,19 +608,19 @@ extern "C" { for (; j < previous->bytes && j < main.width; ++j) { if (previous->invalid) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.to.stream); } else if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } } // for } else { for (; j < previous->bytes && j < main.width; ++j) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } // for } } @@ -640,12 +640,12 @@ extern "C" { width_utf = macro_f_utf_byte_width_is(c); if (invalid[i]) { - fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.error, main.output.to.stream); } else if (f_utf_character_is_control(characters.string[i]) == F_true) { if (main.presentation == byte_dump_presentation_normal) { - fl_print_color_before(main.context.set.notable, main.output.stream); - fl_print_color_before(main.context.set.warning, main.output.stream); + fl_print_color_before(main.context.set.notable, main.output.to.stream); + fl_print_color_before(main.context.set.warning, main.output.to.stream); if (width_utf) { byte[0] = c; @@ -671,41 +671,41 @@ extern "C" { byte[1] = 0; } - f_print_safely(byte, width_utf ? width_utf : 1, main.output.stream); + f_print_safely(byte, width_utf ? width_utf : 1, main.output.to.stream); } else { - f_print_character_safely(c, main.output.stream); + f_print_character_safely(c, main.output.to.stream); } - fl_print_color_after(main.context.set.warning, main.output.stream); - fl_print_color_after(main.context.set.notable, main.output.stream); + fl_print_color_after(main.context.set.warning, main.output.to.stream); + fl_print_color_after(main.context.set.notable, main.output.to.stream); } else if (main.presentation == byte_dump_presentation_simple) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); if (width_utf > 1) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); if (width_utf > 2) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); if (width_utf > 3) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } } } else if (main.presentation == byte_dump_presentation_classic) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); if (width_utf > 1) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); if (width_utf > 2) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); if (width_utf > 3) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } } } @@ -713,84 +713,84 @@ extern "C" { } else if (f_utf_character_is_whitespace(characters.string[i]) == F_true) { if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_before(main.context.set.notable, main.output.stream); - fl_print_color_terminated(byte_dump_sequence_space, main.context.set.warning, main.output.stream); - fl_print_color_after(main.context.set.notable, main.output.stream); + fl_print_color_before(main.context.set.notable, main.output.to.stream); + fl_print_color_terminated(byte_dump_sequence_space, main.context.set.warning, main.output.to.stream); + fl_print_color_after(main.context.set.notable, main.output.to.stream); } } else if (f_utf_character_is_zero_width(characters.string[i]) == F_true) { if (main.presentation == byte_dump_presentation_classic) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { - fl_print_color_before(main.context.set.notable, main.output.stream); - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); - fl_print_color_after(main.context.set.notable, main.output.stream); + fl_print_color_before(main.context.set.notable, main.output.to.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); + fl_print_color_after(main.context.set.notable, main.output.to.stream); } else { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else if (width_utf == 2 && characters.string[i] == 0xd89d0000) { // U+061C - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xefbfb000 && characters.string[i] <= 0xefbfbc00) { // Use space to represent Specials codes. // 0xefbfbd00 is excluded because it is printable (and is the "Replacement Character" code). - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xe290a700 && characters.string[i] <= 0xe290bf00) { // Use space to represent Control Pictues codes that are not currently defined but are reserved. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xee808000 && characters.string[i] <= 0xefa3bf00) { // Use space to represent Private Use Area codes. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 4 && characters.string[i] >= 0xf09c80a0 && characters.string[i] <= 0xf09c80bd) { // Use space to represent Vaiation Selectors Supplement codes. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 4 && characters.string[i] >= 0xf3b08080 && characters.string[i] <= 0xf3bfbfbf) { // Use space to represent Supplemental Private Use Area-A codes. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 4 && characters.string[i] >= 0xf4808080 && characters.string[i] <= 0xf48fbfbf) { // Use space to represent Supplemental Private Use Area-B codes. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 1) { // print invalid placeholder for invalid UTF-8 widths. if (invalid[i]) { - fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.error, main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_incomplete, main.context.set.warning, main.output.to.stream); } } else if (width_utf) { - f_print_character(c, main.output.stream); + f_print_character(c, main.output.to.stream); if (width_utf > 1) { - f_print_character(macro_f_utf_character_t_to_char_2(characters.string[i]), main.output.stream); + f_print_character(macro_f_utf_character_t_to_char_2(characters.string[i]), main.output.to.stream); if (width_utf > 2) { - f_print_character(macro_f_utf_character_t_to_char_3(characters.string[i]), main.output.stream); + f_print_character(macro_f_utf_character_t_to_char_3(characters.string[i]), main.output.to.stream); if (width_utf > 3) { - f_print_character(macro_f_utf_character_t_to_char_4(characters.string[i]), main.output.stream); + f_print_character(macro_f_utf_character_t_to_char_4(characters.string[i]), main.output.to.stream); } } } @@ -800,58 +800,58 @@ extern "C" { if (width_utf == 2 && characters.string[i] >= 0xdea60000 && characters.string[i] <= 0xdeb00000) { // Thana combining codes: U+07A6 to U+07B0. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 2 && characters.string[i] >= 0xcc800000 && characters.string[i] <= 0xcdaf0000) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xe1aab000 && characters.string[i] <= 0xe1abbf00) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xe1b78000 && characters.string[i] <= 0xe1b7bf00) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 3 && characters.string[i] >= 0xe2839000 && characters.string[i] <= 0xe283bf00) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 2 && characters.string[i] >= 0xd8900000 && characters.string[i] <= 0xd89a0000) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 2 && characters.string[i] >= 0xd98b0000 && characters.string[i] <= 0xd99f0000) { // Arabic, U+064B to U+065F. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 2 && characters.string[i] >= 0xdb960000 && characters.string[i] <= 0xdb9c0000) { // Arabic, U+06D6 to U+06DC. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } else if (width_utf == 2 && characters.string[i] >= 0xd6910000 && characters.string[i] <= 0xd6bd0000) { // Hebrew, U+0591 to U+05BD. - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } } else { - f_print_character(c, main.output.stream); + f_print_character(c, main.output.to.stream); } // When using UTF-8 characters, the character columns will not line up, so print placeholders to simulate the bytes that are not printed, if necessary for alignment. if (width_utf > 1 && j + 1 < main.width) { if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.to.stream); } else if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } } else { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } ++j; @@ -859,17 +859,17 @@ extern "C" { if (width_utf > 2 && j + 1 < main.width) { if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.to.stream); } else if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } } else { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } ++j; @@ -877,17 +877,17 @@ extern "C" { if (width_utf > 3 && j + 1 < main.width) { if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.to.stream); } else if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } } else { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } ++j; @@ -901,25 +901,25 @@ extern "C" { for (; j < main.width; ++j) { if (invalid[j]) { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.error, main.output.to.stream); } else if (main.parameters[byte_dump_parameter_classic].result == f_console_result_found) { - f_print_character(f_string_ascii_period_s[0], main.output.stream); + f_print_character(f_string_ascii_period_s[0], main.output.to.stream); } else { - fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.stream); + fl_print_color_terminated(byte_dump_character_placeholder, main.context.set.warning, main.output.to.stream); } } // for } else { for (; j < main.width; ++j) { - f_print_character(f_string_space_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); } // for } - f_print_character(f_string_space_s[0], main.output.stream); - fl_print_color_terminated(byte_dump_character_wall, main.context.set.notable, main.output.stream); - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_space_s[0], main.output.to.stream); + fl_print_color_terminated(byte_dump_character_wall, main.context.set.notable, main.output.to.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } #endif // _di_byte_dump_file_ diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index c3450a0..4b12b82 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -7,25 +7,25 @@ extern "C" { #endif #ifndef _di_control_print_help_ - f_status_t control_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t control_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, control_name_long, control_version); + fll_program_print_help_header(file, context, control_name_long, control_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - fll_program_print_help_usage(output, context, control_name, f_string_empty_s); + fll_program_print_help_usage(file, context, control_name, f_string_empty_s); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -83,18 +83,22 @@ extern "C" { } if (choice == control_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == control_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == control_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == control_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -104,14 +108,14 @@ extern "C" { } if (main->parameters[control_parameter_help].result == f_console_result_found) { - control_print_help(main->output, main->context); + control_print_help(main->output.to, main->context); control_main_delete(main); return F_none; } if (main->parameters[control_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, control_version); + fll_program_print_version(main->output.to, control_version); control_main_delete(main); return F_none; diff --git a/level_3/control/c/control.h b/level_3/control/c/control.h index 2205404..43474d2 100644 --- a/level_3/control/c/control.h +++ b/level_3/control/c/control.h @@ -100,7 +100,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -112,8 +112,8 @@ extern "C" { control_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -122,7 +122,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -131,7 +131,7 @@ extern "C" { * F_none on success. */ #ifndef _di_control_print_help_ - extern f_status_t control_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t control_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_control_print_help_ /** diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 1cfcbaf..a31bd65 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -13,42 +13,42 @@ extern "C" { #ifndef _di_controller_print_help_ f_status_t controller_print_help(const controller_main_t main) { - controller_print_lock(main.output, 0); + controller_print_lock(main.output.to, 0); - fll_program_print_help_header(main.output, main.context, main.program_name_long, controller_version); + fll_program_print_help_header(main.output.to, main.context, main.program_name_long, controller_version); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not main.output in color."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal main.output."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal main.output."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal main.output."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal main.output."); - fll_program_print_help_option(main.output, main.context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not main.output.to in color."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal main.output.to."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal main.output.to."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal main.output.to."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal main.output.to."); + fll_program_print_help_option(main.output.to, main.context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); - fll_program_print_help_option(main.output, main.context, controller_short_control, controller_long_control, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom control group file path, such as '" f_control_group_path_system_prefix f_control_group_path_system_default "'."); - fll_program_print_help_option(main.output, main.context, controller_short_daemon, controller_long_daemon, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run in daemon only mode (do not process the entry)."); - fll_program_print_help_option(main.output, main.context, controller_short_init, controller_long_init, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The program will run as an init replacement."); - fll_program_print_help_option(main.output, main.context, controller_short_interruptable, controller_long_interruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate that this program can be interrupted by a signal."); - fll_program_print_help_option(main.output, main.context, controller_short_pid, controller_long_pid, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom pid file path, such as '" controller_path_pid controller_string_default controller_path_suffix "'."); - fll_program_print_help_option(main.output, main.context, controller_short_settings, controller_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom settings path, such as '" controller_path_settings "'."); - fll_program_print_help_option(main.output, main.context, controller_short_simulate, controller_long_simulate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run as a simulation."); - fll_program_print_help_option(main.output, main.context, controller_short_uninterruptable, controller_long_uninterruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Designate that this program cannot be interrupted by a signal."); - fll_program_print_help_option(main.output, main.context, controller_short_validate, controller_long_validate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Validate the settings (entry and rules) without running (does not simulate)."); + fll_program_print_help_option(main.output.to, main.context, controller_short_control, controller_long_control, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom control group file path, such as '" f_control_group_path_system_prefix f_control_group_path_system_default "'."); + fll_program_print_help_option(main.output.to, main.context, controller_short_daemon, controller_long_daemon, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run in daemon only mode (do not process the entry)."); + fll_program_print_help_option(main.output.to, main.context, controller_short_init, controller_long_init, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The program will run as an init replacement."); + fll_program_print_help_option(main.output.to, main.context, controller_short_interruptable, controller_long_interruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate that this program can be interrupted by a signal."); + fll_program_print_help_option(main.output.to, main.context, controller_short_pid, controller_long_pid, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom pid file path, such as '" controller_path_pid controller_string_default controller_path_suffix "'."); + fll_program_print_help_option(main.output.to, main.context, controller_short_settings, controller_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom settings path, such as '" controller_path_settings "'."); + fll_program_print_help_option(main.output.to, main.context, controller_short_simulate, controller_long_simulate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Run as a simulation."); + fll_program_print_help_option(main.output.to, main.context, controller_short_uninterruptable, controller_long_uninterruptable, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Designate that this program cannot be interrupted by a signal."); + fll_program_print_help_option(main.output.to, main.context, controller_short_validate, controller_long_validate, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Validate the settings (entry and rules) without running (does not simulate)."); - fll_program_print_help_usage(main.output, main.context, main.program_name, "entry"); + fll_program_print_help_usage(main.output.to, main.context, main.program_name, "entry"); - fl_print_format(" When both the %[%s%s%] parameter and the", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_simulate, main.context.set.notable); - fl_print_format(" %[%s%s%] parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_validate, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both the %[%s%s%] parameter and the", main.output.to.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_simulate, main.context.set.notable); + fl_print_format(" %[%s%s%] parameter are specified, then additional information on each would be executed rule is printed but no simulation is performed.%c%c", main.output.to.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_validate, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The default interrupt behavior is to operate as if the %[%s%s%] parameter is passed.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, main.setting_default.used ? controller_long_uninterruptable : controller_long_interruptable, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The default interrupt behavior is to operate as if the %[%s%s%] parameter is passed.%c%c", main.output.to.stream, main.context.set.notable, f_console_symbol_long_enable_s, main.setting_default.used ? controller_long_uninterruptable : controller_long_interruptable, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify an empty string for the %[%s%s%] parameter to disable pid file creation for this program.%c%c", main.output.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify an empty string for the %[%s%s%] parameter to disable pid file creation for this program.%c%c", main.output.to.stream, main.context.set.notable, f_console_symbol_long_enable_s, controller_long_pid, main.context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - controller_print_unlock_flush(main.output, 0); + controller_print_unlock_flush(main.output.to, 0); return F_none; } @@ -106,18 +106,22 @@ extern "C" { } if (choice == controller_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == controller_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == controller_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == controller_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -134,11 +138,11 @@ extern "C" { } if (main->parameters[controller_parameter_version].result == f_console_result_found) { - controller_print_lock(main->output, 0); + controller_print_lock(main->output.to, 0); - fll_program_print_version(main->output, controller_version); + fll_program_print_version(main->output.to, controller_version); - controller_print_unlock_flush(main->output, 0); + controller_print_unlock_flush(main->output.to, 0); controller_main_delete(main); return F_none; diff --git a/level_3/controller/c/controller.h b/level_3/controller/c/controller.h index 3e32543..e8dc47b 100644 --- a/level_3/controller/c/controller.h +++ b/level_3/controller/c/controller.h @@ -223,7 +223,7 @@ extern "C" { bool process_pipe; bool as_init; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -246,8 +246,8 @@ extern "C" { f_array_lengths_t_initialize, \ F_false, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index 89aaf75..5b7af95 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -763,12 +763,12 @@ extern "C" { if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug) { if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cProcessing %s%s item '", global->main->output.stream, f_string_eol_s[0], failsafe ? "failsafe " : "", is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%Q%]'.%c", global->main->output.stream, global->main->context.set.notable, cache->action.name_item, global->main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%cProcessing %s%s item '", global->main->output.to.stream, f_string_eol_s[0], failsafe ? "failsafe " : "", is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%Q%]'.%c", global->main->output.to.stream, global->main->context.set.notable, cache->action.name_item, global->main->context.set.notable, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } @@ -794,24 +794,24 @@ extern "C" { if (F_status_is_error(entry_action->status)) { if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found) { if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cThe %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_action, global->main->context.set.title); + fl_print_format("%cThe %s item action '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.title, cache->action.name_action, global->main->context.set.title); if (entry_action->parameters.used) { - fl_print_format(" %[", global->main->output.stream, global->main->context.set.notable); + fl_print_format(" %[", global->main->output.to.stream, global->main->context.set.notable); - controller_entry_action_parameters_print(global->main->output.stream, *entry_action); + controller_entry_action_parameters_print(global->main->output.to.stream, *entry_action); - fl_print_format("%]", global->main->output.stream, global->main->context.set.notable); + fl_print_format("%]", global->main->output.to.stream, global->main->context.set.notable); } - fl_print_format("' is %[%s%] and is in a ", global->main->output.stream, global->main->context.set.notable, entry_action->code & controller_entry_rule_code_require ? "required" : "optional", global->main->context.set.notable); + fl_print_format("' is %[%s%] and is in a ", global->main->output.to.stream, global->main->context.set.notable, entry_action->code & controller_entry_rule_code_require ? "required" : "optional", global->main->context.set.notable); - fl_print_format("%[failed%] state, skipping.%c", global->main->output.stream, global->main->context.set.notable, global->main->context.set.notable, global->main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%[failed%] state, skipping.%c", global->main->output.to.stream, global->main->context.set.notable, global->main->context.set.notable, global->main->context.set.notable, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } else { @@ -871,14 +871,14 @@ extern "C" { if (entry_action->type == controller_entry_action_type_ready) { if ((entry_action->code & controller_entry_rule_code_wait) || global->setting->ready == controller_setting_ready_wait) { if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug || entry->show == controller_entry_show_init) { - if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + if (global->main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cWaiting before processing %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title); - fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format("%cWaiting before processing %s item action '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title); + fl_print_format("'.%c", global->main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } @@ -889,20 +889,20 @@ extern "C" { if (global->setting->ready == controller_setting_ready_yes) { if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug) { - if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + if (global->main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cIgnoring %s item action '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title); - fl_print_format("', state already is ready.%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format("%cIgnoring %s item action '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_string_ready_s, global->main->context.set.title); + fl_print_format("', state already is ready.%c", global->main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } } else { if (!failsafe && (global->main->error.verbosity == f_console_verbosity_verbose || entry->show == controller_entry_show_init) && global->main->parameters[controller_parameter_simulate].result == f_console_result_none) { - fl_print_format("%cState is now '%[%s%]'.%c", global->main->output.stream, f_string_eol_s[0], global->main->context.set.notable, controller_string_ready_s, global->main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%cState is now '%[%s%]'.%c", global->main->output.to.stream, f_string_eol_s[0], global->main->context.set.notable, controller_string_ready_s, global->main->context.set.notable, f_string_eol_s[0]); } status = controller_perform_ready(is_entry, *global, cache); @@ -960,14 +960,14 @@ extern "C" { } if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug) { - if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + if (global->main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cProcessing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, cache->action.name_item, global->main->context.set.title); - fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format("%cProcessing %s item '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.title, cache->action.name_item, global->main->context.set.title); + fl_print_format("'.%c", global->main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } @@ -1015,27 +1015,27 @@ extern "C" { f_thread_unlock(&global->thread->lock.rule); if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug || (entry->show == controller_entry_show_init && entry_action->type != controller_entry_action_type_consider)) { - if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + if (global->main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%c%s %s item rule ", global->main->output.stream, f_string_eol_s[0], entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("'%[%Q%]'", global->main->output.stream, global->main->context.set.title, alias_rule, global->main->context.set.title); + fl_print_format("%c%s %s item rule ", global->main->output.to.stream, f_string_eol_s[0], entry_action->type == controller_entry_action_type_consider ? "Considering" : "Processing", is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("'%[%Q%]'", global->main->output.to.stream, global->main->context.set.title, alias_rule, global->main->context.set.title); if (entry->show == controller_entry_show_init && global->main->parameters[controller_parameter_simulate].result == f_console_result_none) { - fl_print_format(" [%[%s%]]", global->main->output.stream, global->main->context.set.notable, entry_action->code == controller_entry_rule_code_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, global->main->context.set.notable); + fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, entry_action->code == controller_entry_rule_code_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, global->main->context.set.notable); if (entry_action->code == controller_entry_rule_code_wait) { - fl_print_format(" [%[%s%]]", global->main->output.stream, global->main->context.set.notable, controller_string_wait_s, global->main->context.set.notable); + fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, controller_string_wait_s, global->main->context.set.notable); } if (entry_action->code == controller_entry_rule_code_require) { - fl_print_format(" [%[%s%]]", global->main->output.stream, global->main->context.set.notable, controller_string_required_s, global->main->context.set.notable); + fl_print_format(" [%[%s%]]", global->main->output.to.stream, global->main->context.set.notable, controller_string_required_s, global->main->context.set.notable); } } - fl_print_format(".%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format(".%c", global->main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } @@ -1097,11 +1097,11 @@ extern "C" { if (F_status_is_error(status)) { if (global->main->error.verbosity != f_console_verbosity_quiet) { if (F_status_set_fine(status) != F_interrupt) { - controller_print_lock(global->main->output, global->thread); + controller_print_lock(global->main->error.to, global->thread); controller_entry_error_print_cache(is_entry, global->main->error, cache->action); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->error.to, global->thread); } } @@ -1167,23 +1167,23 @@ extern "C" { } else if (entry_action->type == controller_entry_action_type_execute) { if (global->main->parameters[controller_parameter_simulate].result == f_console_result_found || global->main->error.verbosity == f_console_verbosity_verbose || global->main->error.verbosity == f_console_verbosity_debug || entry->show == controller_entry_show_init) { - if (global->main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(global->main->output, global->thread); + if (global->main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%c%s is executing '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%c%s is executing '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); for (f_array_length_t k = 0; k < entry_action->parameters.used; ++k) { - fl_print_format("%[%Q%]", global->main->output.stream, global->main->context.set.title, entry_action->parameters.array[k], global->main->context.set.title); + fl_print_format("%[%Q%]", global->main->output.to.stream, global->main->context.set.title, entry_action->parameters.array[k], global->main->context.set.title); if (k + 1 < entry_action->parameters.used) { - f_print_character(f_string_space_s[0], global->main->output.stream); + f_print_character(f_string_space_s[0], global->main->output.to.stream); } } // for - fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format("'.%c", global->main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } } @@ -1357,18 +1357,18 @@ extern "C" { } if ((global->main->parameters[controller_parameter_simulate].result == f_console_result_found && global->main->error.verbosity != f_console_verbosity_quiet) || global->main->error.verbosity == f_console_verbosity_verbose) { - controller_print_lock(global->main->output, global->thread); + controller_print_lock(global->main->output.to, global->thread); - fl_print_format("%cDone processing %s item '", global->main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%s%]", global->main->output.stream, global->main->context.set.title, controller_string_main_s, global->main->context.set.title); - fl_print_format("'.%c", global->main->output.stream, f_string_eol_s[0]); + fl_print_format("%cDone processing %s item '", global->main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%[%s%]", global->main->output.to.stream, global->main->context.set.title, controller_string_main_s, global->main->context.set.title); + fl_print_format("'.%c", global->main->output.to.stream, f_string_eol_s[0]); // failsafe should not print the extra newline because the failure exit from controller_main should handle this. if (!failsafe) { - f_print_terminated(f_string_eol_s, global->main->output.stream); + f_print_terminated(f_string_eol_s, global->main->output.to.stream); } - controller_print_unlock_flush(global->main->output, global->thread); + controller_print_unlock_flush(global->main->output.to, global->thread); } return status; @@ -1382,24 +1382,24 @@ extern "C" { return; } - controller_print_lock(global.main->output, global.thread); + controller_print_lock(global.main->output.to, global.thread); - fl_print_format("%cProcessing %s item action '", global.main->output.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); + fl_print_format("%cProcessing %s item action '", global.main->output.to.stream, f_string_eol_s[0], is_entry ? controller_string_entry_s : controller_string_exit_s); - fl_print_format("%[%S%]' setting ", global.main->output.stream, global.main->context.set.title, name, global.main->context.set.title); + fl_print_format("%[%S%]' setting ", global.main->output.to.stream, global.main->context.set.title, name, global.main->context.set.title); if (name_sub) { - fl_print_format("'%[%S%]'", global.main->output.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable); + fl_print_format("'%[%S%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable); } else { - fl_print_format("value", global.main->output.stream); + fl_print_format("value", global.main->output.to.stream); } - fl_print_format(" to '%[%Q%]", global.main->output.stream, global.main->context.set.important, value, global.main->context.set.important); + fl_print_format(" to '%[%Q%]", global.main->output.to.stream, global.main->context.set.important, value, global.main->context.set.important); - fl_print_format("'%S.%c", global.main->output.stream, suffix, f_string_eol_s[0]); + fl_print_format("'%S.%c", global.main->output.to.stream, suffix, f_string_eol_s[0]); - controller_print_unlock_flush(global.main->output, global.thread); + controller_print_unlock_flush(global.main->output.to, global.thread); } #endif // _di_controller_process_entry_print_simulate_setting_value_ diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index c0337ad..0080a11 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -1580,33 +1580,33 @@ extern "C" { } if (options & controller_process_option_simulate) { - if (main->error.verbosity != f_console_verbosity_quiet) { - controller_print_lock(main->output, thread); + if (main->output.verbosity != f_console_verbosity_quiet) { + controller_print_lock(main->output.to, thread); - fl_print_format("%cSimulating execution of '%[", main->output.stream, f_string_eol_s[0], main->context.set.title); + fl_print_format("%cSimulating execution of '%[", main->output.to.stream, f_string_eol_s[0], main->context.set.title); if (program) { - f_print_safely_terminated(program, main->output.stream); + f_print_safely_terminated(program, main->output.to.stream); } else { - f_print_dynamic_safely(arguments.array[0], main->output.stream); + f_print_dynamic_safely(arguments.array[0], main->output.to.stream); } - fl_print_format("%]' with the arguments: '%[", main->output.stream, main->context.set.title, main->context.set.important); + fl_print_format("%]' with the arguments: '%[", main->output.to.stream, main->context.set.title, main->context.set.important); for (f_array_length_t i = program ? 0 : 1; i < arguments.used; ++i) { if (program && i || !program && i > 1) { - f_print_terminated(f_string_space_s, main->output.stream); + f_print_terminated(f_string_space_s, main->output.to.stream); } - f_print_dynamic_safely(arguments.array[i], main->output.stream); + f_print_dynamic_safely(arguments.array[i], main->output.to.stream); } // for - fl_print_format("%]' from '", main->output.stream, main->context.set.important); - fl_print_format("%[%Q%]'.%c", main->output.stream, main->context.set.notable, process->rule.name, main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%]' from '", main->output.to.stream, main->context.set.important); + fl_print_format("%[%Q%]'.%c", main->output.to.stream, main->context.set.notable, process->rule.name, main->context.set.notable, f_string_eol_s[0]); - controller_print_unlock_flush(main->output, thread); + controller_print_unlock_flush(main->output.to, thread); } // sleep for less than a second to better show simulation of synchronous vs asynchronous. @@ -2019,30 +2019,30 @@ extern "C" { if (!rerun_item->max || rerun_item->count < rerun_item->max) { if (main->error.verbosity == f_console_verbosity_debug) { - controller_print_lock(main->output, thread); + controller_print_lock(main->output.to, thread); - fl_print_format("%cRe-running '", main->output.stream, f_string_eol_s[0]); - fl_print_format("%[%q%]", main->output.stream, main->context.set.title, process->rule.alias, main->context.set.title); - f_print_terminated("' '", main->output.stream); - fl_print_format("%[%q%]", main->output.stream, main->context.set.notable, controller_rule_action_type_execute_name(action), main->context.set.notable); - f_print_terminated("' with a ", main->output.stream); - fl_print_format("%[%s%]", main->output.stream, main->context.set.notable, controller_string_delay_s, main->context.set.notable); - f_print_terminated(" of ", main->output.stream); - fl_print_format("%[%ul%] MegaTime", main->output.stream, main->context.set.notable, rerun_item->delay, main->context.set.notable); + fl_print_format("%cRe-running '", main->output.to.stream, f_string_eol_s[0]); + fl_print_format("%[%q%]", main->output.to.stream, main->context.set.title, process->rule.alias, main->context.set.title); + f_print_terminated("' '", main->output.to.stream); + fl_print_format("%[%q%]", main->output.to.stream, main->context.set.notable, controller_rule_action_type_execute_name(action), main->context.set.notable); + f_print_terminated("' with a ", main->output.to.stream); + fl_print_format("%[%s%]", main->output.to.stream, main->context.set.notable, controller_string_delay_s, main->context.set.notable); + f_print_terminated(" of ", main->output.to.stream); + fl_print_format("%[%ul%] MegaTime", main->output.to.stream, main->context.set.notable, rerun_item->delay, main->context.set.notable); if (rerun_item->max) { - f_print_terminated(" for ", main->output.stream); - fl_print_format("%[%ul%]", main->output.stream, main->context.set.notable, rerun_item->count, main->context.set.notable); - f_print_terminated(" of ", main->output.stream); - fl_print_format("%[%s%] ", main->output.stream, main->context.set.notable, controller_string_max_s, main->context.set.notable); - fl_print_format("%[%ul%]", main->output.stream, main->context.set.notable, rerun_item->max, main->context.set.notable); - fl_print_format(".%c", main->output.stream, f_string_eol_s[0]); + f_print_terminated(" for ", main->output.to.stream); + fl_print_format("%[%ul%]", main->output.to.stream, main->context.set.notable, rerun_item->count, main->context.set.notable); + f_print_terminated(" of ", main->output.to.stream); + fl_print_format("%[%s%] ", main->output.to.stream, main->context.set.notable, controller_string_max_s, main->context.set.notable); + fl_print_format("%[%ul%]", main->output.to.stream, main->context.set.notable, rerun_item->max, main->context.set.notable); + fl_print_format(".%c", main->output.to.stream, f_string_eol_s[0]); } else { - fl_print_format(" with no %[%s%].%c", main->output.stream, main->context.set.notable, controller_string_max_s, main->context.set.notable, f_string_eol_s[0]); + fl_print_format(" with no %[%s%].%c", main->output.to.stream, main->context.set.notable, controller_string_max_s, main->context.set.notable, f_string_eol_s[0]); } - controller_print_unlock_flush(main->output, thread); + controller_print_unlock_flush(main->output.to, thread); } if (rerun_item->delay) { @@ -4719,7 +4719,6 @@ extern "C" { status = F_status_set_fine(status); if ((zero_only && number) || (!zero_only && (number < 1 || number > 99)) || status == F_data_not || status == F_number || status == F_number_overflow || status == F_number_negative || status == F_number_positive) { - if (global.main->error.verbosity != f_console_verbosity_quiet) { // get the current line number within the settings item. @@ -5368,11 +5367,11 @@ extern "C" { } else { if (global.main->error.verbosity == f_console_verbosity_debug || (global.main->error.verbosity == f_console_verbosity_verbose && global.main->parameters[controller_parameter_simulate].result == f_console_result_found)) { - controller_print_lock(global.main->output, global.thread); + controller_print_lock(global.main->output.to, global.thread); - fl_print_format("%cProcessing rule item action '%[%s%]' setting value to an empty set.%c", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title, controller_string_environment_s, global.main->context.set.title, f_string_eol_s[0]); + fl_print_format("%cProcessing rule item action '%[%s%]' setting value to an empty set.%c", global.main->output.to.stream, f_string_eol_s[0], global.main->context.set.title, controller_string_environment_s, global.main->context.set.title, f_string_eol_s[0]); - controller_print_unlock_flush(global.main->output, global.thread); + controller_print_unlock_flush(global.main->output.to, global.thread); } } @@ -5597,14 +5596,14 @@ extern "C" { } if (global.main->error.verbosity == f_console_verbosity_debug || (global.main->error.verbosity == f_console_verbosity_verbose && global.main->parameters[controller_parameter_simulate].result == f_console_result_found)) { - controller_print_lock(global.main->output, global.thread); + controller_print_lock(global.main->output.to, global.thread); - fl_print_format("%cProcessing rule item action '%[%S%]', adding ", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title, controller_string_on_s, global.main->context.set.title); - fl_print_format("'%[%/Q%]' of ", global.main->output.stream, global.main->context.set.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->context.set.notable); - fl_print_format("'%[%/Q%]/", global.main->output.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->context.set.important); - fl_print_format("%[%/Q%]'.%c", global.main->output.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[3], global.main->context.set.important, f_string_eol_s[0]); + fl_print_format("%cProcessing rule item action '%[%S%]', adding ", global.main->output.to.stream, f_string_eol_s[0], global.main->context.set.title, controller_string_on_s, global.main->context.set.title); + fl_print_format("'%[%/Q%]' of ", global.main->output.to.stream, global.main->context.set.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->context.set.notable); + fl_print_format("'%[%/Q%]/", global.main->output.to.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->context.set.important); + fl_print_format("%[%/Q%]'.%c", global.main->output.to.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[3], global.main->context.set.important, f_string_eol_s[0]); - controller_print_unlock_flush(global.main->output, global.thread); + controller_print_unlock_flush(global.main->output.to, global.thread); } } // for @@ -5627,21 +5626,21 @@ extern "C" { return; } - controller_print_lock(global.main->output, global.thread); + controller_print_lock(global.main->output.to, global.thread); - fl_print_format("%cProcessing rule item action '%[%S%]' setting ", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title, name, global.main->context.set.title); + fl_print_format("%cProcessing rule item action '%[%S%]' setting ", global.main->output.to.stream, f_string_eol_s[0], global.main->context.set.title, name, global.main->context.set.title); if (name_sub) { - fl_print_format("'%[%S%]'", global.main->output.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable); + fl_print_format("'%[%S%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable); } else { - f_print_terminated("value", global.main->output.stream); + f_print_terminated("value", global.main->output.to.stream); } - fl_print_format(" to '%[%Q%]'", global.main->output.stream, global.main->context.set.important, value, global.main->context.set.important); - fl_print_format("%S.%c", global.main->output.stream, suffix, f_string_eol_s[0]); + fl_print_format(" to '%[%Q%]'", global.main->output.to.stream, global.main->context.set.important, value, global.main->context.set.important); + fl_print_format("%S.%c", global.main->output.to.stream, suffix, f_string_eol_s[0]); - controller_print_unlock_flush(global.main->output, global.thread); + controller_print_unlock_flush(global.main->output.to, global.thread); } #endif // _di_controller_rule_setting_read_print_value_ @@ -5652,29 +5651,29 @@ extern "C" { return; } - controller_print_lock(global.main->output, global.thread); + controller_print_lock(global.main->output.to, global.thread); - fl_print_format("%cProcessing rule item action '%[%S%]' setting value to", global.main->output.stream, f_string_eol_s[0], global.main->context.set.title, name, global.main->context.set.title); + fl_print_format("%cProcessing rule item action '%[%S%]' setting value to", global.main->output.to.stream, f_string_eol_s[0], global.main->context.set.title, name, global.main->context.set.title); for (f_array_length_t j = 0; j < cache->content_actions.array[index].used; ++j) { - fl_print_format(" '%[%/Q%]'", global.main->output.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[index].array[j], global.main->context.set.important); + fl_print_format(" '%[%/Q%]'", global.main->output.to.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[index].array[j], global.main->context.set.important); if (j + 2 == cache->content_actions.array[index].used) { if (cache->content_actions.array[index].used > 2) { - f_print_terminated(",", global.main->output.stream); + f_print_terminated(",", global.main->output.to.stream); } - f_print_terminated(" and", global.main->output.stream); + f_print_terminated(" and", global.main->output.to.stream); } else if (j + 1 < cache->content_actions.array[index].used) { - f_print_terminated(",", global.main->output.stream); + f_print_terminated(",", global.main->output.to.stream); } } // for - fl_print_format(".%c", global.main->output.stream, f_string_eol_s[0]); + fl_print_format(".%c", global.main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(global.main->output, global.thread); + controller_print_unlock_flush(global.main->output.to, global.thread); } #endif // _di_controller_rule_setting_read_print_value_ @@ -5774,74 +5773,74 @@ extern "C" { } // for if (missing) { - controller_print_lock(main->output, global.thread); + controller_print_lock(main->output.to, global.thread); if (rule.items.used) { - fl_print_format("%cRule '", main->output.stream, f_string_eol_s[0]); - fl_print_format("%[%Q%]' has no '", main->output.stream, main->context.set.title, rule.name, main->context.set.title); - fl_print_format("%[%q%]' action to execute and would '", main->output.stream, main->context.set.title, controller_rule_action_type_name(action), main->context.set.title); - fl_print_format("%[%s%]' because it is '", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important); - fl_print_format("%[%s%]'.%c", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format("%cRule '", main->output.to.stream, f_string_eol_s[0]); + fl_print_format("%[%Q%]' has no '", main->output.to.stream, main->context.set.title, rule.name, main->context.set.title); + fl_print_format("%[%q%]' action to execute and would '", main->output.to.stream, main->context.set.title, controller_rule_action_type_name(action), main->context.set.title); + fl_print_format("%[%s%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important); + fl_print_format("%[%s%]'.%c", main->output.to.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]); } else { - fl_print_format("%cRule '", main->output.stream, f_string_eol_s[0]); - fl_print_format("%[%Q%]' has no known '", main->output.stream, main->context.set.title, rule.name, main->context.set.title); - fl_print_format("%[%s %s%]' (such as ", main->output.stream, main->context.set.title, controller_string_rule_s, controller_string_type_s, main->context.set.title); - fl_print_format("'%[%s%]', ", main->output.stream, main->context.set.title, controller_string_command_s, main->context.set.title); - fl_print_format("'%[%s%]', ", main->output.stream, main->context.set.title, controller_string_service_s, main->context.set.title); - fl_print_format("'%[%s%]', or ", main->output.stream, main->context.set.title, controller_string_script_s, main->context.set.title); - fl_print_format("'%[%s%]'", main->output.stream, main->context.set.title, controller_string_utility_s, main->context.set.title); - fl_print_format(") and would '%[%s%]' because it is '", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important); - fl_print_format("%[%s%]'.%c", main->output.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format("%cRule '", main->output.to.stream, f_string_eol_s[0]); + fl_print_format("%[%Q%]' has no known '", main->output.to.stream, main->context.set.title, rule.name, main->context.set.title); + fl_print_format("%[%s %s%]' (such as ", main->output.to.stream, main->context.set.title, controller_string_rule_s, controller_string_type_s, main->context.set.title); + fl_print_format("'%[%s%]', ", main->output.to.stream, main->context.set.title, controller_string_command_s, main->context.set.title); + fl_print_format("'%[%s%]', ", main->output.to.stream, main->context.set.title, controller_string_service_s, main->context.set.title); + fl_print_format("'%[%s%]', or ", main->output.to.stream, main->context.set.title, controller_string_script_s, main->context.set.title); + fl_print_format("'%[%s%]'", main->output.to.stream, main->context.set.title, controller_string_utility_s, main->context.set.title); + fl_print_format(") and would '%[%s%]' because it is '", main->output.to.stream, main->context.set.important, options & controller_process_option_require ? controller_string_fail_s : controller_string_succeed_s, main->context.set.important); + fl_print_format("%[%s%]'.%c", main->output.to.stream, main->context.set.important, options & controller_process_option_require ? controller_string_required_s : controller_string_optional_s, main->context.set.important, f_string_eol_s[0]); } - controller_print_unlock_flush(main->output, global.thread); + controller_print_unlock_flush(main->output.to, global.thread); } } - controller_print_lock(main->output, global.thread); + controller_print_lock(main->output.to, global.thread); - fl_print_format("%cRule %[%Q%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.title, rule.alias, main->context.set.title, f_string_eol_s[0]); - fl_print_format(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_name_s, main->context.set.important, rule.name, f_string_eol_s[0]); - fl_print_format(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_how_s, main->context.set.important, options & controller_process_option_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, f_string_eol_s[0]); - fl_print_format(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_wait_s, main->context.set.important, options & controller_process_option_wait ? controller_string_yes_s : controller_string_no_s, f_string_eol_s[0]); - fl_print_format(" %[%s%] ", main->output.stream, main->context.set.important, controller_string_capability_s, main->context.set.important); + fl_print_format("%cRule %[%Q%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.title, rule.alias, main->context.set.title, f_string_eol_s[0]); + fl_print_format(" %[%s%] %Q%c", main->output.to.stream, main->context.set.important, controller_string_name_s, main->context.set.important, rule.name, f_string_eol_s[0]); + fl_print_format(" %[%s%] %s%c", main->output.to.stream, main->context.set.important, controller_string_how_s, main->context.set.important, options & controller_process_option_asynchronous ? controller_string_asynchronous_s : controller_string_synchronous_s, f_string_eol_s[0]); + fl_print_format(" %[%s%] %s%c", main->output.to.stream, main->context.set.important, controller_string_wait_s, main->context.set.important, options & controller_process_option_wait ? controller_string_yes_s : controller_string_no_s, f_string_eol_s[0]); + fl_print_format(" %[%s%] ", main->output.to.stream, main->context.set.important, controller_string_capability_s, main->context.set.important); if (f_capability_supported()) { if (rule.capability) { cache->action.generic.used = 0; if (F_status_is_error_not(f_capability_to_text(rule.capability, &cache->action.generic))) { - f_print_dynamic_safely(cache->action.generic, main->output.stream); + f_print_dynamic_safely(cache->action.generic, main->output.to.stream); } } - f_print_terminated(f_string_eol_s, main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); } else { - fl_print_format("%[(unsupported)%]%c", main->output.stream, main->context.set.warning, controller_string_capability_s, main->context.set.warning, f_string_eol_s[0]); + fl_print_format("%[(unsupported)%]%c", main->output.to.stream, main->context.set.warning, controller_string_capability_s, main->context.set.warning, f_string_eol_s[0]); } - fl_print_format(" %[%s%]", main->output.stream, main->context.set.important, controller_string_control_group_s, main->context.set.important); + fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_string_control_group_s, main->context.set.important); if (rule.has & controller_rule_has_control_group) { - fl_print_format(" %s", main->output.stream, rule.control_group.as_new ? controller_string_new_s : controller_string_existing_s); + fl_print_format(" %s", main->output.to.stream, rule.control_group.as_new ? controller_string_new_s : controller_string_existing_s); for (i = 0; i < rule.control_group.groups.used; ++i) { if (rule.control_group.groups.array[i].used) { - fl_print_format(" %Q", main->output.stream, rule.control_group.groups.array[i]); + fl_print_format(" %Q", main->output.to.stream, rule.control_group.groups.array[i]); } } // for } - fl_print_format("%c %[%s%]", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_nice_s, main->context.set.important); + fl_print_format("%c %[%s%]", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_nice_s, main->context.set.important); if (rule.has & controller_rule_has_nice) { - fl_print_format(" %i", main->output.stream, rule.nice); + fl_print_format(" %i", main->output.to.stream, rule.nice); } - fl_print_format("%c %[%s%]", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_scheduler_s, main->context.set.important); + fl_print_format("%c %[%s%]", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_scheduler_s, main->context.set.important); if (rule.has & controller_rule_has_scheduler) { f_string_t policy = ""; @@ -5865,70 +5864,70 @@ extern "C" { policy = controller_string_round_robin_s; } - fl_print_format(" %s %i", main->output.stream, policy, rule.scheduler.priority); + fl_print_format(" %s %i", main->output.to.stream, policy, rule.scheduler.priority); } - fl_print_format("%c %[%s%] %Q%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_script_s, main->context.set.important, rule.script, f_string_eol_s[0]); - fl_print_format(" %[%s%]", main->output.stream, main->context.set.important, controller_string_user_s, main->context.set.important); + fl_print_format("%c %[%s%] %Q%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_script_s, main->context.set.important, rule.script, f_string_eol_s[0]); + fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_string_user_s, main->context.set.important); if (rule.has & controller_rule_has_user) { - fl_print_format(" %i", main->output.stream, rule.user); + fl_print_format(" %i", main->output.to.stream, rule.user); } - fl_print_format("%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_affinity_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format("%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_affinity_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.affinity.used; ++i) { - fl_print_format(" %i%c", main->output.stream, rule.affinity.array[i], f_string_eol_s[0]); + fl_print_format(" %i%c", main->output.to.stream, rule.affinity.array[i], f_string_eol_s[0]); } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_define_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_define_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.define.used; ++i) { if (rule.define.array[i].name.used && rule.define.array[i].value.used) { - fl_print_format(" %Q %[=%] %Q%c", main->output.stream, rule.define.array[i].name, main->context.set.important, main->context.set.important, rule.define.array[i].value, f_string_eol_s[0]); + fl_print_format(" %Q %[=%] %Q%c", main->output.to.stream, rule.define.array[i].name, main->context.set.important, main->context.set.important, rule.define.array[i].value, f_string_eol_s[0]); } } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_environment_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_environment_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.environment.used; ++i) { if (rule.environment.array[i].used) { - fl_print_format(" %Q%c", main->output.stream, rule.environment.array[i], f_string_eol_s[0]); + fl_print_format(" %Q%c", main->output.to.stream, rule.environment.array[i], f_string_eol_s[0]); } } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.parameter.used; ++i) { if (rule.parameter.array[i].name.used && rule.parameter.array[i].value.used) { - fl_print_format(" %Q %[=%] %Q%c", main->output.stream, rule.parameter.array[i].name, main->context.set.important, main->context.set.important, rule.parameter.array[i].value, f_string_eol_s[0]); + fl_print_format(" %Q %[=%] %Q%c", main->output.to.stream, rule.parameter.array[i].name, main->context.set.important, main->context.set.important, rule.parameter.array[i].value, f_string_eol_s[0]); } } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_group_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_group_s, main->context.set.important, f_string_eol_s[0]); if (rule.has & controller_rule_has_group) { - fl_print_format(" %i%c", main->output.stream, rule.group, f_string_eol_s[0]); + fl_print_format(" %i%c", main->output.to.stream, rule.group, f_string_eol_s[0]); for (i = 0; i < rule.groups.used; ++i) { - fl_print_format(" %i%c", main->output.stream, rule.groups.array[i], f_string_eol_s[0]); + fl_print_format(" %i%c", main->output.to.stream, rule.groups.array[i], f_string_eol_s[0]); } // for } - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_limit_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_limit_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.limits.used; ++i) { - fl_print_format(" %Q %[=%] %un %un%c", main->output.stream, controller_rule_setting_limit_type_name(rule.limits.array[i].type), main->context.set.important, main->context.set.important, rule.limits.array[i].value.rlim_cur, rule.limits.array[i].value.rlim_max, f_string_eol_s[0]); + fl_print_format(" %Q %[=%] %un %un%c", main->output.to.stream, controller_rule_setting_limit_type_name(rule.limits.array[i].type), main->context.set.important, main->context.set.important, rule.limits.array[i].value.rlim_cur, rule.limits.array[i].value.rlim_max, f_string_eol_s[0]); } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_on_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_on_s, main->context.set.important, f_string_eol_s[0]); for (i = 0; i < rule.ons.used; ++i) { - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]); { f_string_t action = ""; @@ -5961,40 +5960,40 @@ extern "C" { action = controller_string_thaw_s; } - fl_print_format(" %[%s%] %s%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, action, f_string_eol_s[0]); + fl_print_format(" %[%s%] %s%c", main->output.to.stream, main->context.set.important, controller_string_type_s, main->context.set.important, action, f_string_eol_s[0]); } - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_need_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_need_s, main->context.set.important, f_string_eol_s[0]); for (j = 0; j < rule.ons.array[i].need.used; ++j) { if (rule.ons.array[i].need.array[j].used) { - fl_print_format(" %Q%c", main->output.stream, rule.ons.array[i].need.array[j], f_string_eol_s[0]); + fl_print_format(" %Q%c", main->output.to.stream, rule.ons.array[i].need.array[j], f_string_eol_s[0]); } } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_want_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_want_s, main->context.set.important, f_string_eol_s[0]); for (j = 0; j < rule.ons.array[i].want.used; ++j) { if (rule.ons.array[i].want.array[j].used) { - fl_print_format(" %Q%c", main->output.stream, rule.ons.array[i].want.array[j], f_string_eol_s[0]); + fl_print_format(" %Q%c", main->output.to.stream, rule.ons.array[i].want.array[j], f_string_eol_s[0]); } } // for - fl_print_format(" }%c %[%s%] {%c", main->output.stream, f_string_eol_s[0], main->context.set.important, controller_string_wish_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" }%c %[%s%] {%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, controller_string_wish_s, main->context.set.important, f_string_eol_s[0]); for (j = 0; j < rule.ons.array[i].wish.used; ++j) { if (rule.ons.array[i].wish.array[j].used) { - fl_print_format(" %Q%c", main->output.stream, rule.ons.array[i].wish.array[j], f_string_eol_s[0]); + fl_print_format(" %Q%c", main->output.to.stream, rule.ons.array[i].wish.array[j], f_string_eol_s[0]); } } // for - fl_print_format(" }%c }%c", main->output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" }%c }%c", main->output.to.stream, f_string_eol_s[0], f_string_eol_s[0]); } // for - fl_print_format(" }%c", main->output.stream, f_string_eol_s[0]); + fl_print_format(" }%c", main->output.to.stream, f_string_eol_s[0]); if (rule.items.used) { controller_rule_action_t *action = 0; @@ -6009,10 +6008,10 @@ extern "C" { item = &rule.items.array[i]; - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_item_s, main->context.set.important, f_string_eol_s[0]); - fl_print_format(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_item_type_name(item->type), f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_item_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] %Q%c", main->output.to.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_item_type_name(item->type), f_string_eol_s[0]); - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_rerun_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_rerun_s, main->context.set.important, f_string_eol_s[0]); for (j = 0; j < controller_rule_action_type_execute__enum_size; ++j) { for (k = 0; k < 2; ++k) { @@ -6027,121 +6026,121 @@ extern "C" { continue; } - fl_print_format(" %[", main->output.stream, main->context.set.important); + fl_print_format(" %[", main->output.to.stream, main->context.set.important); switch (j) { case controller_rule_action_type_execute_freeze: - f_print_terminated(controller_string_freeze_s, main->output.stream); + f_print_terminated(controller_string_freeze_s, main->output.to.stream); break; case controller_rule_action_type_execute_kill: - f_print_terminated(controller_string_kill_s, main->output.stream); + f_print_terminated(controller_string_kill_s, main->output.to.stream); break; case controller_rule_action_type_execute_pause: - f_print_terminated(controller_string_pause_s, main->output.stream); + f_print_terminated(controller_string_pause_s, main->output.to.stream); break; case controller_rule_action_type_execute_reload: - f_print_terminated(controller_string_reload_s, main->output.stream); + f_print_terminated(controller_string_reload_s, main->output.to.stream); break; case controller_rule_action_type_execute_restart: - f_print_terminated(controller_string_restart_s, main->output.stream); + f_print_terminated(controller_string_restart_s, main->output.to.stream); break; case controller_rule_action_type_execute_resume: - f_print_terminated(controller_string_resume_s, main->output.stream); + f_print_terminated(controller_string_resume_s, main->output.to.stream); break; case controller_rule_action_type_execute_start: - f_print_terminated(controller_string_start_s, main->output.stream); + f_print_terminated(controller_string_start_s, main->output.to.stream); break; case controller_rule_action_type_execute_stop: - f_print_terminated(controller_string_stop_s, main->output.stream); + f_print_terminated(controller_string_stop_s, main->output.to.stream); break; case controller_rule_action_type_execute_thaw: - f_print_terminated(controller_string_thaw_s, main->output.stream); + f_print_terminated(controller_string_thaw_s, main->output.to.stream); break; default: break; } - fl_print_format("%] %s", main->output.stream, main->context.set.important, k ? controller_string_success_s : controller_string_failure_s); - fl_print_format(" %s %ul %s %ul", main->output.stream, controller_string_delay_s, rerun_item->delay, controller_string_max_s, rerun_item->max); + fl_print_format("%] %s", main->output.to.stream, main->context.set.important, k ? controller_string_success_s : controller_string_failure_s); + fl_print_format(" %s %ul %s %ul", main->output.to.stream, controller_string_delay_s, rerun_item->delay, controller_string_max_s, rerun_item->max); if (!k && (item->reruns[j].is & controller_rule_rerun_is_failure_reset) || k && (item->reruns[j].is & controller_rule_rerun_is_success_reset)) { - fl_print_format(" %s", main->output.stream, controller_string_reset_s); + fl_print_format(" %s", main->output.to.stream, controller_string_reset_s); } - f_print_terminated(f_string_eol_s, main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); } // for } // for - fl_print_format(" }%c", main->output.stream, f_string_eol_s[0]); + fl_print_format(" }%c", main->output.to.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%]", main->output.stream, main->context.set.important, controller_string_pid_file_s, main->context.set.important); + fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_string_pid_file_s, main->context.set.important); if (item->pid_file.used) { - fl_print_format(" %Q", main->output.stream, item->pid_file); + fl_print_format(" %Q", main->output.to.stream, item->pid_file); } - f_print_terminated(f_string_eol_s, main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); - fl_print_format(" %[%s%]", main->output.stream, main->context.set.important, controller_string_with_s, main->context.set.important); + fl_print_format(" %[%s%]", main->output.to.stream, main->context.set.important, controller_string_with_s, main->context.set.important); if (item->with & controller_with_full_path) { - fl_print_format(" %s", main->output.stream, controller_string_full_path_s); + fl_print_format(" %s", main->output.to.stream, controller_string_full_path_s); } - f_print_terminated(f_string_eol_s, main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); for (j = 0; j < item->actions.used; ++j) { action = &item->actions.array[j]; - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]); - fl_print_format(" %[%s%] %q%c", main->output.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_action_type_name(action->type), f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_action_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] %q%c", main->output.to.stream, main->context.set.important, controller_string_type_s, main->context.set.important, controller_rule_action_type_name(action->type), f_string_eol_s[0]); if (item->type == controller_rule_item_type_script || item->type == controller_rule_item_type_utility) { - fl_print_format(" %[%s%] {%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]); + fl_print_format(" %[%s%] {%c", main->output.to.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, f_string_eol_s[0]); parameter = &action->parameters.array[0]; if (parameter->used) { - f_print_terminated(" ", main->output.stream); + f_print_terminated(" ", main->output.to.stream); for (k = 0; k < parameter->used; ++k) { if (parameter->string[k] == f_fss_eol) { if (k + 1 < parameter->used) { - f_print_terminated(f_string_eol_s, main->output.stream); - f_print_terminated(" ", main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); + f_print_terminated(" ", main->output.to.stream); } } else { - f_print_character_safely(parameter->string[k], main->output.stream); + f_print_character_safely(parameter->string[k], main->output.to.stream); } } // for - f_print_terminated(f_string_eol_s, main->output.stream); + f_print_terminated(f_string_eol_s, main->output.to.stream); } - fl_print_format(" }%c", main->output.stream, f_string_eol_s[0]); + fl_print_format(" }%c", main->output.to.stream, f_string_eol_s[0]); } else { for (k = 0; k < action->parameters.used; ++k) { - fl_print_format(" %[%s%] %Q%c", main->output.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s[0]); + fl_print_format(" %[%s%] %Q%c", main->output.to.stream, main->context.set.important, controller_string_parameter_s, main->context.set.important, action->parameters.array[k], f_string_eol_s[0]); } // for } - fl_print_format(" }%c", main->output.stream, f_string_eol_s[0]); + fl_print_format(" }%c", main->output.to.stream, f_string_eol_s[0]); } // for - fl_print_format(" }%c", main->output.stream, f_string_eol_s[0]); + fl_print_format(" }%c", main->output.to.stream, f_string_eol_s[0]); } // for } - fl_print_format("}%c", main->output.stream, f_string_eol_s[0]); + fl_print_format("}%c", main->output.to.stream, f_string_eol_s[0]); - controller_print_unlock_flush(main->output, global.thread); + controller_print_unlock_flush(main->output.to, global.thread); } #endif // _di_controller_rule_validate_ diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 9cefd51..5a24b33 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -12,70 +12,70 @@ extern "C" { #endif #ifndef _di_fake_print_help_ - f_status_t fake_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fake_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fake_name_long, fake_version); + fll_program_print_help_header(file, context, fake_name_long, fake_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fake_short_define, fake_long_define, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Append an additional define after defines from settings file."); - fll_program_print_help_option(output, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this fakefile."); - fll_program_print_help_option(output, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use this mode when processing the build settings."); - fll_program_print_help_option(output, context, fake_short_process, fake_long_process, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Process name for storing build states."); - fll_program_print_help_option(output, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this settings file."); + fll_program_print_help_option(file, context, fake_short_define, fake_long_define, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Append an additional define after defines from settings file."); + fll_program_print_help_option(file, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this fakefile."); + fll_program_print_help_option(file, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use this mode when processing the build settings."); + fll_program_print_help_option(file, context, fake_short_process, fake_long_process, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Process name for storing build states."); + fll_program_print_help_option(file, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Use this settings file."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom build directory."); - fll_program_print_help_option(output, context, fake_short_path_data, fake_long_path_data, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom path to the data files."); - fll_program_print_help_option(output, context, fake_short_path_sources, fake_long_path_sources, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Specify a custom path to the source files."); - fll_program_print_help_option(output, context, fake_short_path_work, fake_long_path_work, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use includes/libraries/programs from this directory instead of system."); + fll_program_print_help_option(file, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom build directory."); + fll_program_print_help_option(file, context, fake_short_path_data, fake_long_path_data, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a custom path to the data files."); + fll_program_print_help_option(file, context, fake_short_path_sources, fake_long_path_sources, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Specify a custom path to the source files."); + fll_program_print_help_option(file, context, fake_short_path_work, fake_long_path_work, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use includes/libraries/programs from this directory instead of system."); - fl_print_format("%c%c %[Special Options:%] ", output.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); + fl_print_format("%c%c %[Special Options:%] ", file.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); - fll_program_print_help_option_long(output, context, fake_long_documents_disabled, f_console_symbol_long_enable_s, " Forcibly do not build documents files."); - fll_program_print_help_option_long(output, context, fake_long_documents_enabled, f_console_symbol_long_enable_s, " Forcibly do build documents files."); - fll_program_print_help_option_long(output, context, fake_long_shared_disabled, f_console_symbol_long_enable_s, "Forcibly do not build shared files."); - fll_program_print_help_option_long(output, context, fake_long_shared_enabled, f_console_symbol_long_enable_s, " Forcibly do build shared files."); - fll_program_print_help_option_long(output, context, fake_long_static_disabled, f_console_symbol_long_enable_s, "Forcibly do not build static files."); - fll_program_print_help_option_long(output, context, fake_long_static_enabled, f_console_symbol_long_enable_s, " Forcibly do build static files."); + fll_program_print_help_option_long(file, context, fake_long_documents_disabled, f_console_symbol_long_enable_s, " Forcibly do not build documents files."); + fll_program_print_help_option_long(file, context, fake_long_documents_enabled, f_console_symbol_long_enable_s, " Forcibly do build documents files."); + fll_program_print_help_option_long(file, context, fake_long_shared_disabled, f_console_symbol_long_enable_s, "Forcibly do not build shared files."); + fll_program_print_help_option_long(file, context, fake_long_shared_enabled, f_console_symbol_long_enable_s, " Forcibly do build shared files."); + fll_program_print_help_option_long(file, context, fake_long_static_disabled, f_console_symbol_long_enable_s, "Forcibly do not build static files."); + fll_program_print_help_option_long(file, context, fake_long_static_enabled, f_console_symbol_long_enable_s, " Forcibly do build static files."); - fl_print_format("%c%c %[Operations:%] ", output.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); + fl_print_format("%c%c %[Operations:%] ", file.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); - fll_program_print_help_option_other(output, context, fake_other_operation_build, " Build or compile the code based on build settings file."); - fll_program_print_help_option_other(output, context, fake_other_operation_clean, " Delete all build files."); - fll_program_print_help_option_other(output, context, fake_other_operation_make, " Build or compile the code based on fakefile."); - fll_program_print_help_option_other(output, context, fake_other_operation_skeleton, "Build a skeleton directory structure."); + fll_program_print_help_option_other(file, context, fake_other_operation_build, " Build or compile the code based on build settings file."); + fll_program_print_help_option_other(file, context, fake_other_operation_clean, " Delete all build files."); + fll_program_print_help_option_other(file, context, fake_other_operation_make, " Build or compile the code based on fakefile."); + fll_program_print_help_option_other(file, context, fake_other_operation_skeleton, "Build a skeleton directory structure."); - fll_program_print_help_usage(output, context, fake_name, "operation"); + fll_program_print_help_usage(file, context, fake_name, "operation"); - fl_print_format(" When performing the %[%s%] operation, the", output.stream, context.set.notable, fake_other_operation_build, context.set.notable); - fl_print_format(" %[%s%s%] parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_mode, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When performing the %[%s%] operation, the", file.stream, context.set.notable, fake_other_operation_build, context.set.notable); + fl_print_format(" %[%s%s%] parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_mode, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For example, when a %[%s%]", output.stream, context.set.notable, fake_make_parameter_variable_mode, context.set.notable); - fl_print_format(" of 'fll_monolithic' is specified, build libraries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For example, when a %[%s%]", file.stream, context.set.notable, fake_make_parameter_variable_mode, context.set.notable); + fl_print_format(" of 'fll_monolithic' is specified, build libraries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying the %[%s%] or the %[%s%]", output.stream, context.set.notable, fake_make_parameter_variable_fakefile, context.set.notable, context.set.notable, fake_make_parameter_variable_settings, context.set.notable); - fl_print_format(" parameters, the filenames are relative to the data build directory, unless a path is used.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When specifying the %[%s%] or the %[%s%]", file.stream, context.set.notable, fake_make_parameter_variable_fakefile, context.set.notable, context.set.notable, fake_make_parameter_variable_settings, context.set.notable); + fl_print_format(" parameters, the filenames are relative to the data build directory, unless a path is used.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For example, with '%[%s%s my_fakefile%]' the fakefile at", output.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile, context.set.notable); - fl_print_format(" '%[./%s%smy_fakefile%]' would be used, however with", output.stream, context.set.notable, fake_default_path_data, fake_default_path_build, context.set.notable); - fl_print_format(" '%[%s%s ./my_fakefile%]' the fakefile at", output.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile, context.set.notable); - fl_print_format(" '%[./my_fakefile%]' would be used.%c%c", output.stream, context.set.notable, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For example, with '%[%s%s my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile, context.set.notable); + fl_print_format(" '%[./%s%smy_fakefile%]' would be used, however with", file.stream, context.set.notable, fake_default_path_data, fake_default_path_build, context.set.notable); + fl_print_format(" '%[%s%s ./my_fakefile%]' the fakefile at", file.stream, context.set.notable, f_console_symbol_long_enable_s, fake_long_fakefile, context.set.notable); + fl_print_format(" '%[./my_fakefile%]' would be used.%c%c", file.stream, context.set.notable, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -133,18 +133,22 @@ extern "C" { } if (choice == fake_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fake_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fake_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fake_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -237,14 +241,14 @@ extern "C" { status = F_none; if (main->parameters[fake_parameter_help].result == f_console_result_found) { - fake_print_help(main->output, main->context); + fake_print_help(main->output.to, main->context); fake_main_delete(main); return F_none; } if (main->parameters[fake_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fake_version); + fll_program_print_version(main->output.to, fake_version); fake_main_delete(main); return F_none; @@ -346,7 +350,7 @@ extern "C" { fll_print_character(f_string_eol_s[0], main->error.to.stream); } else if (status != F_child) { - fll_print_format("%cAll operations complete.%c%c", main->output.stream, f_string_eol_s[0], f_string_eol_s[0], f_string_eol_s[0]); + fll_print_format("%cAll operations complete.%c%c", main->output.to.stream, f_string_eol_s[0], f_string_eol_s[0], f_string_eol_s[0]); } } } diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 66840e3..f0de601 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -389,7 +389,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -460,8 +460,8 @@ extern "C" { fake_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ @@ -518,7 +518,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -527,7 +527,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fake_print_help_ - extern f_status_t fake_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fake_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fake_print_help_ /** diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index d31a8ca..d11e9ed 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -168,8 +168,8 @@ extern "C" { f_string_dynamic_t destination_file = f_string_dynamic_t_initialize; f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Copying %S.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, label, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Copying %S.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, label, main.context.set.important, f_string_eol_s[0]); } macro_f_string_dynamic_t_resize(*status, path_source, source.used); @@ -186,7 +186,11 @@ extern "C" { fl_directory_recurse_t recurse = fl_directory_recurse_t_initialize; if (main.error.verbosity == f_console_verbosity_verbose) { - recurse.output = main.output; + recurse.output.stream = main.output.to.stream; + recurse.output.id = main.output.to.id; + recurse.output.flag = main.output.to.flag; + recurse.output.size_read = main.output.to.size_read; + recurse.output.size_write = main.output.to.size_write; recurse.verbose = fake_verbose_print_copy; } @@ -345,7 +349,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Copied file '%Q' to '%Q'.%c", main.output.stream, path_source, destination_file, f_string_eol_s[0]); + fll_print_format("Copied file '%Q' to '%Q'.%c", main.output.to.stream, path_source, destination_file, f_string_eol_s[0]); } } else if (F_status_is_error(*status)) { @@ -418,8 +422,8 @@ extern "C" { &path_headers, }; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Creating base build directories.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Creating base build directories.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } for (uint8_t i = 0; i < 15; ++i) { @@ -471,7 +475,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Created directory '%Q'.%c", main.output.stream, directorys[i], f_string_eol_s[0]); + fll_print_format("Created directory '%Q'.%c", main.output.to.stream, directorys[i], f_string_eol_s[0]); } } // for @@ -775,8 +779,8 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child; if (!data_build.setting.build_sources_library.used) return 0; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Compiling shared library.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Compiling shared library.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -1118,7 +1122,7 @@ extern "C" { *status = f_file_link(parameter_file_name_major, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Linked file '%S' to '%S'.%c", main.output.stream, parameter_file_path, parameter_file_name_major, f_string_eol_s[0]); + fll_print_format("Linked file '%S' to '%S'.%c", main.output.to.stream, parameter_file_path, parameter_file_name_major, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1153,7 +1157,7 @@ extern "C" { *status = f_file_link(parameter_file_name_minor, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Linked file '%S' to '%S'.%c", main.output.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s[0]); + fll_print_format("Linked file '%S' to '%S'.%c", main.output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1187,7 +1191,7 @@ extern "C" { *status = f_file_link(parameter_file_name_micro, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Linked file '%S' to '%S'.%c", main.output.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s[0]); + fll_print_format("Linked file '%S' to '%S'.%c", main.output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1221,7 +1225,7 @@ extern "C" { *status = f_file_link(parameter_file_name_nano, parameter_file_path); if (F_status_is_error_not(*status) && main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Linked file '%S' to '%S'.%c", main.output.stream, parameter_file_path, parameter_file_name_nano, f_string_eol_s[0]); + fll_print_format("Linked file '%S' to '%S'.%c", main.output.to.stream, parameter_file_path, parameter_file_name_nano, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1250,8 +1254,8 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child; if (!data_build.setting.build_sources_library.used) return 0; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Compiling static library.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Compiling static library.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -2853,8 +2857,8 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child; if (!data_build.setting.build_sources_library.used) return 0; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Compiling static objects.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Compiling static objects.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -2974,7 +2978,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Directory '%Q' created.%c", main.output.stream, destination_path, f_string_eol_s[0]); + fll_print_format("Directory '%Q' created.%c", main.output.to.stream, destination_path, f_string_eol_s[0]); } } else if (F_status_is_error(*status)) { @@ -3069,14 +3073,14 @@ extern "C" { fake_build_load_setting(*main, setting_file, &data_build.setting, &status); if (F_status_is_fine(status)) { - if (main->error.verbosity != f_console_verbosity_quiet) { - flockfile(main->output.stream); + if (main->output.verbosity != f_console_verbosity_quiet) { + flockfile(main->output.to.stream); - fl_print_format("%c%[Building project%] ", main->output.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important); - fl_print_format("%[%Q%]", main->output.stream, main->context.set.notable, data_build.setting.project_name, main->context.set.notable); - fl_print_format("%[.%]%c", main->output.stream, main->context.set.important, main->context.set.important, f_string_eol_s[0]); + fl_print_format("%c%[Building project%] ", main->output.to.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important); + fl_print_format("%[%Q%]", main->output.to.stream, main->context.set.notable, data_build.setting.project_name, main->context.set.notable); + fl_print_format("%[.%]%c", main->output.to.stream, main->context.set.important, main->context.set.important, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } @@ -3187,8 +3191,8 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child; if (!data_build.setting.build_sources_program.used) return 0; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Compiling shared program.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Compiling shared program.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -3290,8 +3294,8 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child; if (!data_build.setting.build_sources_program.used) return 0; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c%[Compiling static program.%]%c", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c%[Compiling static program.%]%c", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important, f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index 1401c31..28abd4c 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -15,14 +15,14 @@ extern "C" { f_status_t status = F_none; - if (main.error.verbosity != f_console_verbosity_quiet) { - flockfile(main.output.stream); + if (main.output.verbosity != f_console_verbosity_quiet) { + flockfile(main.output.to.stream); - fl_print_format("%c%[Deleting all files within build directory '%]", main.output.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important); - fl_print_format("%[%Q%]", main.output.stream, main.context.set.notable, main.path_build, main.context.set.notable); - fl_print_format("%[.%]%c", main.output.stream, main.context.set.important, main.context.set.important, f_string_eol_s[0]); + fl_print_format("%c%[Deleting all files within build directory '%]", main.output.to.stream, f_string_eol_s[0], main.context.set.important, main.context.set.important); + fl_print_format("%[%Q%]", main.output.to.stream, main.context.set.notable, main.path_build, main.context.set.notable); + fl_print_format("%[.%]%c", main.output.to.stream, main.context.set.important, main.context.set.important, f_string_eol_s[0]); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); } if (fake_signal_received(main)) { @@ -38,13 +38,13 @@ extern "C" { if (F_status_set_fine(status) == F_file_found_not) { if (main.error.verbosity == f_console_verbosity_verbose) { - flockfile(main.output.stream); + flockfile(main.output.to.stream); - f_print_terminated("The build directory '", main.output.stream); - fl_print_format("%[%Q%]", main.output.stream, main.context.set.notable, main.path_build, main.context.set.notable); - fl_print_format("' does not exist.%c", main.output.stream, f_string_eol_s[0]); + f_print_terminated("The build directory '", main.output.to.stream); + fl_print_format("%[%Q%]", main.output.to.stream, main.context.set.notable, main.path_build, main.context.set.notable); + fl_print_format("' does not exist.%c", main.output.to.stream, f_string_eol_s[0]); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); } status = F_none; diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index ea3de3d..eb8c56d 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -15,23 +15,23 @@ extern "C" { if (F_status_is_error(*status)) return 1; if (main.error.verbosity == f_console_verbosity_verbose) { - flockfile(main.output.stream); + flockfile(main.output.to.stream); - f_print_dynamic(program, main.output.stream); + f_print_dynamic(program, main.output.to.stream); for (f_array_length_t i = 0; i < arguments.used; ++i) { if (!arguments.array[i].used) continue; - fl_print_format(" %Q", main.output.stream, arguments.array[i]); + fl_print_format(" %Q", main.output.to.stream, arguments.array[i]); } // for - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); // flush to stdout before executing command. - fflush(main.output.stream); + fflush(main.output.to.stream); } if (fake_signal_received(main)) { diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index ca18674..10b8370 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -1106,8 +1106,8 @@ extern "C" { return F_signal; } - if (main->error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%c$[Making project.%]%c", main->output.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important, f_string_eol_s[0]); + if (main->output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%c$[Making project.%]%c", main->output.to.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important, f_string_eol_s[0]); } f_status_t status = F_none; @@ -1995,14 +1995,14 @@ extern "C" { const f_fss_named_t *section = &data_make->fakefile.array[id_section]; - if (main->error.verbosity != f_console_verbosity_quiet) { - flockfile(main->output.stream); + if (main->output.verbosity != f_console_verbosity_quiet) { + flockfile(main->output.to.stream); - fl_print_format("%c%[Processing Section '%]", main->output.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important); - fl_print_format("%[%Q%]", main->output.stream, main->context.set.notable, section->name, main->context.set.notable); - fl_print_format("%['.%]%c", main->output.stream, main->context.set.important, main->context.set.important, f_string_eol_s[0]); + fl_print_format("%c%[Processing Section '%]", main->output.to.stream, f_string_eol_s[0], main->context.set.important, main->context.set.important); + fl_print_format("%[%Q%]", main->output.to.stream, main->context.set.notable, section->name, main->context.set.notable); + fl_print_format("%['.%]%c", main->output.to.stream, main->context.set.important, main->context.set.important, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } if (!section->objects.used) { @@ -2382,13 +2382,13 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("%cBreaking as '", main->output.stream, f_string_eol_s[0]); - fl_print_format("%[%S%]", main->output.stream, main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success, main->context.set.notable); - fl_print_format("'.%c", main->output.stream, f_string_eol_s[0]); + fl_print_format("%cBreaking as '", main->output.to.stream, f_string_eol_s[0]); + fl_print_format("%[%S%]", main->output.to.stream, main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success, main->context.set.notable); + fl_print_format("'.%c", main->output.to.stream, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return 0; @@ -2443,7 +2443,7 @@ extern "C" { f_array_length_t destination_length = 0; if (main->error.verbosity == f_console_verbosity_verbose) { - recurse.output = main->output; + recurse.output = main->output.to; recurse.verbose = fake_verbose_print_clone; } @@ -2502,12 +2502,12 @@ extern "C" { *status = F_status_set_error(F_failure); } else if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("%cCloned '%[%Q%]' to '", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable); - fl_print_format("%[%S%]'.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, destination, main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%cCloned '%[%Q%]' to '", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable); + fl_print_format("%[%S%]'.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, destination, main->context.set.notable, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else if (F_status_is_error(status_file)) { @@ -2549,7 +2549,7 @@ extern "C" { macro_f_mode_t_set_default_umask(mode, main->umask); if (main->error.verbosity == f_console_verbosity_verbose) { - recurse.output = main->output; + recurse.output = main->output.to; recurse.verbose = fake_verbose_print_copy; } @@ -2608,12 +2608,12 @@ extern "C" { *status = F_status_set_error(F_failure); } else if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("%cCopied '%[%Q%]", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable); - fl_print_format("' to '%[%S%]'.%c", main->output.stream, main->context.set.notable, destination, main->context.set.notable, f_string_eol_s[0]); + fl_print_format("%cCopied '%[%Q%]", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable); + fl_print_format("' to '%[%S%]'.%c", main->output.to.stream, main->context.set.notable, destination, main->context.set.notable, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else if (F_status_is_error(status_file)) { @@ -2639,7 +2639,7 @@ extern "C" { fll_error_print(data_make->error, F_status_set_fine(*status), "f_environment_set", F_true); } else if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cDefined environment variable '%[%Q%]'.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[0], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cDefined environment variable '%[%Q%]'.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[0], main->context.set.notable, f_string_eol_s[0]); } return 0; @@ -2684,7 +2684,7 @@ extern "C" { if (F_status_set_fine(*status) == F_file_found_not) { if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cThe directory '%[%Q%]' does not exist.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cThe directory '%[%Q%]' does not exist.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); } *status = F_none; @@ -2695,7 +2695,7 @@ extern "C" { return 0; } else if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cRemoved '%[%Q%]'.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cRemoved '%[%Q%]'.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); } } else { @@ -2703,7 +2703,7 @@ extern "C" { if (F_status_set_fine(*status) == F_file_found_not) { if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cThe file '%[%Q%]' does not exist.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cThe file '%[%Q%]' does not exist.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); } *status = F_none; @@ -2714,7 +2714,7 @@ extern "C" { return 0; } else if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cRemoved '%[%Q%]'.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cRemoved '%[%Q%]'.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); } } } // for @@ -2757,7 +2757,7 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("%cExiting as '%[%S%]'.%c", main->output.stream, f_string_eol_s[0], main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success, main->context.set.notable, f_string_eol_s[0]); + fll_print_format("%cExiting as '%[%S%]'.%c", main->output.to.stream, f_string_eol_s[0], main->context.set.notable, arguments.used ? arguments.array[0].string : fake_make_operation_argument_success, main->context.set.notable, f_string_eol_s[0]); } return 0; @@ -2792,23 +2792,23 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - f_print_terminated("Set failure state to '", main->output.stream); + f_print_terminated("Set failure state to '", main->output.to.stream); if (data_make->setting_make.fail == fake_make_operation_fail_type_exit) { - fl_print_format("%[%s%]", main->output.stream, main->context.set.notable, fake_make_operation_argument_exit, main->context.set.notable); + fl_print_format("%[%s%]", main->output.to.stream, main->context.set.notable, fake_make_operation_argument_exit, main->context.set.notable); } else if (data_make->setting_make.fail == fake_make_operation_fail_type_warn) { - fl_print_format("%[%s%]", main->output.stream, main->context.set.notable, fake_make_operation_argument_warn, main->context.set.notable); + fl_print_format("%[%s%]", main->output.to.stream, main->context.set.notable, fake_make_operation_argument_warn, main->context.set.notable); } else if (data_make->setting_make.fail == fake_make_operation_fail_type_ignore) { - fl_print_format("%[%s%]", main->output.stream, main->context.set.notable, fake_make_operation_argument_ignore, main->context.set.notable); + fl_print_format("%[%s%]", main->output.to.stream, main->context.set.notable, fake_make_operation_argument_ignore, main->context.set.notable); } - fl_print_format("'.%c", main->output.stream, f_string_eol_s[0]); + fl_print_format("'.%c", main->output.to.stream, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return 0; @@ -2842,12 +2842,12 @@ extern "C" { fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_role_change", F_true, arguments.array[i].string, "change group of", fll_error_file_type_file); } else if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("Changed group of '%[%s%]", main->output.stream, main->context.set.notable, arguments.array[i], main->context.set.notable); - fl_print_format("' to %[%ul%].%c", main->output.stream, main->context.set.notable, id, main->context.set.notable, f_string_eol_s[0]); + fl_print_format("Changed group of '%[%s%]", main->output.to.stream, main->context.set.notable, arguments.array[i], main->context.set.notable); + fl_print_format("' to %[%ul%].%c", main->output.to.stream, main->context.set.notable, id, main->context.set.notable, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } // for @@ -2882,12 +2882,12 @@ extern "C" { fll_error_file_print(data_make->error, F_status_set_fine(*status), "fll_file_role_change_all", F_true, arguments.array[i].string, "change group of", fll_error_file_type_file); } else if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("Changed group of '%[%s%]", main->output.stream, main->context.set.notable, arguments.array[i], main->context.set.notable); - fl_print_format("' to %[%ul%].%c", main->output.stream, main->context.set.notable, id, main->context.set.notable, f_string_eol_s[0]); + fl_print_format("Changed group of '%[%s%]", main->output.to.stream, main->context.set.notable, arguments.array[i], main->context.set.notable); + fl_print_format("' to %[%ul%].%c", main->output.to.stream, main->context.set.notable, id, main->context.set.notable, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } // for @@ -3384,12 +3384,12 @@ extern "C" { fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_link", F_true, arguments.array[1].string, "create link", fll_error_file_type_file); } else if (main->error.verbosity == f_console_verbosity_verbose) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); - fl_print_format("Created symbolic link from '%[%Q%]", main->output.stream, main->context.set.notable, arguments.array[1], main->context.set.notable); - fl_print_format("' to %[%Q%].%c", main->output.stream, main->context.set.notable, arguments.array[0], main->context.set.notable, f_string_eol_s[0]); + fl_print_format("Created symbolic link from '%[%Q%]", main->output.to.stream, main->context.set.notable, arguments.array[1], main->context.set.notable); + fl_print_format("' to %[%Q%].%c", main->output.to.stream, main->context.set.notable, arguments.array[0], main->context.set.notable, f_string_eol_s[0]); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return 0; @@ -3431,7 +3431,7 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Changed mode of '%Q' to %#@u.%c", main->output.stream, arguments.array[i], mode, f_string_eol_s[0]); + fll_print_format("Changed mode of '%Q' to %#@u.%c", main->output.to.stream, arguments.array[i], mode, f_string_eol_s[0]); } } // for @@ -3473,7 +3473,7 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Changed mode of '%Q' to %#@u.%c", main->output.stream, arguments.array[i], mode, f_string_eol_s[0]); + fll_print_format("Changed mode of '%Q' to %#@u.%c", main->output.to.stream, arguments.array[i], mode, f_string_eol_s[0]); } } // for @@ -3489,7 +3489,7 @@ extern "C" { f_array_length_t destination_length = 0; if (main->error.verbosity == f_console_verbosity_verbose) { - recurse.output = main->output; + recurse.output = main->output.to; recurse.verbose = fake_verbose_print_move; } @@ -3597,7 +3597,7 @@ extern "C" { break; } else if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Changed owner of '%Q' to %u.%c", main->output.stream, arguments.array[i], id, f_string_eol_s[0]); + fll_print_format("Changed owner of '%Q' to %u.%c", main->output.to.stream, arguments.array[i], id, f_string_eol_s[0]); } } // for @@ -3632,7 +3632,7 @@ extern "C" { fll_error_file_print(data_make->error, F_status_set_fine(*status), "fll_file_role_change_all", F_true, arguments.array[i].string, "change owner of", fll_error_file_type_file); } else if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Changed owner of '%Q' to %u.%c", main->output.stream, arguments.array[i], id, f_string_eol_s[0]); + fll_print_format("Changed owner of '%Q' to %u.%c", main->output.to.stream, arguments.array[i], id, f_string_eol_s[0]); } } // for @@ -3661,27 +3661,27 @@ extern "C" { return 0; } - fll_print_format("Changed to project path '%[%Q%]'.%c", main->output.stream, main->context.set.notable, data_make->path_cache, main->context.set.notable, f_string_eol_s[0]); + fll_print_format("Changed to project path '%[%Q%]'.%c", main->output.to.stream, main->context.set.notable, data_make->path_cache, main->context.set.notable, f_string_eol_s[0]); } return 0; } if (operation == fake_make_operation_type_print) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < arguments.used; ++i) { - f_print_dynamic(arguments.array[i], main->output.stream); + f_print_dynamic(arguments.array[i], main->output.to.stream); if (i + 1 < arguments.used) { - f_print_character(f_string_space_s[0], main->output.stream); + f_print_character(f_string_space_s[0], main->output.to.stream); } } // for - f_print_character(f_string_space_s[0], main->output.stream); + f_print_character(f_string_space_s[0], main->output.to.stream); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return 0; } @@ -3771,7 +3771,7 @@ extern "C" { return 0; } - fll_print_format("Changed to project path '%[%Q%]'.%c", main->output.stream, main->context.set.notable, data_make->path_cache, main->context.set.notable, f_string_eol_s[0]); + fll_print_format("Changed to project path '%[%Q%]'.%c", main->output.to.stream, main->context.set.notable, data_make->path_cache, main->context.set.notable, f_string_eol_s[0]); } ++data_make->path.stack.used; @@ -3791,7 +3791,7 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Changed to project path ''.%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("Changed to project path ''.%c", main->output.to.stream, f_string_eol_s[0]); } // clear stack, except for the project root. @@ -3840,7 +3840,7 @@ extern "C" { } if (main->error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Touched '%[%Q%]'.%c", main->output.stream, main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); + fll_print_format("Touched '%[%Q%]'.%c", main->output.to.stream, main->context.set.notable, arguments.array[i], main->context.set.notable, f_string_eol_s[0]); } } // for } @@ -3876,23 +3876,23 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - flockfile(main.output.stream); + flockfile(main.output.to.stream); - f_print_dynamic_safely(program, main.output.stream); + f_print_dynamic_safely(program, main.output.to.stream); for (f_array_length_t i = 0; i < arguments.used; ++i) { if (arguments.array[i].used) { - fll_print_format(" %Q", main.output.stream, arguments.array[i]); + fll_print_format(" %Q", main.output.to.stream, arguments.array[i]); } } // for - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); // flush to stdout before executing command. - fflush(main.output.stream); + fflush(main.output.to.stream); } int return_code = 0; @@ -4561,7 +4561,6 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit, arguments.array[0], fake_make_operation_argument_exit_length) == F_equal_to_not) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn, arguments.array[0], fake_make_operation_argument_warn_length) == F_equal_to_not) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to_not) { - if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { flockfile(data_make->error.to.stream); diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index b2aa91a..ce2b185 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -19,8 +19,8 @@ extern "C" { f_status_t status = F_none; - if (main.error.verbosity != f_console_verbosity_quiet) { - fll_print_format("%cGenerating skeleton structure.%c", main.output.stream, f_string_eol_s[0], f_string_eol_s[0]); + if (main.output.verbosity != f_console_verbosity_quiet) { + fll_print_format("%cGenerating skeleton structure.%c", main.output.to.stream, f_string_eol_s[0], f_string_eol_s[0]); } { @@ -167,7 +167,7 @@ extern "C" { if (status == F_true) { if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Directory '%Q' already exists.%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("Directory '%Q' already exists.%c", main.output.to.stream, path, f_string_eol_s[0]); } return F_none; @@ -207,7 +207,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("Directory '%Q' created.%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("Directory '%Q' created.%c", main.output.to.stream, path, f_string_eol_s[0]); } } else if (F_status_is_error(status)) { @@ -231,7 +231,7 @@ extern "C" { if (status == F_true) { if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("File '%Q' already exists.%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("File '%Q' already exists.%c", main.output.to.stream, path, f_string_eol_s[0]); } return F_none; @@ -243,7 +243,7 @@ extern "C" { if (status == F_true) { if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("File '%Q' already exists (as a symbolic link).%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("File '%Q' already exists (as a symbolic link).%c", main.output.to.stream, path, f_string_eol_s[0]); } return F_none; @@ -252,7 +252,7 @@ extern "C" { if (status == F_false) { if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("File '%Q' already exists but is not a regular file (or symbolic link).%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("File '%Q' already exists but is not a regular file (or symbolic link).%c", main.output.to.stream, path, f_string_eol_s[0]); } return F_status_set_warning(F_none); @@ -284,7 +284,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("File '%Q' created.%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("File '%Q' created.%c", main.output.to.stream, path, f_string_eol_s[0]); } if (content.used) { @@ -311,7 +311,7 @@ extern "C" { } if (main.error.verbosity == f_console_verbosity_verbose) { - fll_print_format("File '%Q' pre-populated.%c", main.output.stream, path, f_string_eol_s[0]); + fll_print_format("File '%Q' pre-populated.%c", main.output.to.stream, path, f_string_eol_s[0]); } f_file_stream_close(F_true, &file); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index c4237d3..dc0e38e 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -13,32 +13,32 @@ extern "C" { #endif #ifndef _di_firewall_print_help_ - f_status_t firewall_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t firewall_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, firewall_name_long, firewall_version); + fll_program_print_help_header(file, context, firewall_name_long, firewall_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - fl_print_format("%c%c %[Available Commands:%] ", output.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); - fl_print_format("%c %[%s%] Turn on the firewall.", output.stream, f_string_eol_s[0], context.set.standout, firewall_command_start, context.set.standout); - fl_print_format("%c %[%s%] Turn off the firewall.", output.stream, f_string_eol_s[0], context.set.standout, firewall_command_stop, context.set.standout); - fl_print_format("%c %[%s%] Turn off and then turn on the firewall.", output.stream, f_string_eol_s[0], context.set.standout, firewall_command_restart, context.set.standout); - fl_print_format("%c %[%s%] Prevent all communication.", output.stream, f_string_eol_s[0], context.set.standout, firewall_command_lock, context.set.standout); - fl_print_format("%c %[%s%] Show active firewall settings.", output.stream, f_string_eol_s[0], context.set.standout, firewall_command_show, context.set.standout); + fl_print_format("%c%c %[Available Commands:%] ", file.stream, f_string_eol_s[0], f_string_eol_s[0], context.set.important, context.set.important); + fl_print_format("%c %[%s%] Turn on the firewall.", file.stream, f_string_eol_s[0], context.set.standout, firewall_command_start, context.set.standout); + fl_print_format("%c %[%s%] Turn off the firewall.", file.stream, f_string_eol_s[0], context.set.standout, firewall_command_stop, context.set.standout); + fl_print_format("%c %[%s%] Turn off and then turn on the firewall.", file.stream, f_string_eol_s[0], context.set.standout, firewall_command_restart, context.set.standout); + fl_print_format("%c %[%s%] Prevent all communication.", file.stream, f_string_eol_s[0], context.set.standout, firewall_command_lock, context.set.standout); + fl_print_format("%c %[%s%] Show active firewall settings.", file.stream, f_string_eol_s[0], context.set.standout, firewall_command_show, context.set.standout); - fll_program_print_help_usage(output, context, firewall_name, "command"); + fll_program_print_help_usage(file, context, firewall_name, "command"); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -90,18 +90,22 @@ extern "C" { } if (choice == firewall_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == firewall_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == firewall_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == firewall_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -111,14 +115,14 @@ extern "C" { } if (main->parameters[firewall_parameter_help].result == f_console_result_found) { - firewall_print_help(main->output, main->context); + firewall_print_help(main->output.to, main->context); firewall_main_delete(main); return F_none; } if (main->parameters[firewall_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, firewall_version); + fll_program_print_version(main->output.to, firewall_version); firewall_main_delete(main); return F_none; @@ -242,8 +246,8 @@ extern "C" { } if (show_nat) { - fll_print_format("%[===========================%] %[NAT%] %[============================%]%c", main->output.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); - fflush(main->output.stream); + fll_print_format("%[===========================%] %[NAT%] %[============================%]%c", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); + fflush(main->output.to.stream); parameters.used = 6; @@ -268,13 +272,13 @@ extern "C" { exit(return_code); } - fll_print_character(f_string_eol_s[0], main->output.stream); - fflush(main->output.stream); + fll_print_character(f_string_eol_s[0], main->output.to.stream); + fflush(main->output.to.stream); } if (F_status_is_error_not(status) && show_mangle) { - fll_print_format("%[==========================%] %[MANGLE%] %[==========================%]%c", main->output.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); - fflush(main->output.stream); + fll_print_format("%[==========================%] %[MANGLE%] %[==========================%]%c", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); + fflush(main->output.to.stream); parameters.used = 6; @@ -299,13 +303,13 @@ extern "C" { exit(return_code); } - fll_print_character(f_string_eol_s[0], main->output.stream); - fflush(main->output.stream); + fll_print_character(f_string_eol_s[0], main->output.to.stream); + fflush(main->output.to.stream); } if (F_status_is_error_not(status) && show_ports) { - fll_print_format("%[==========================%] %[FILTER%] %[==========================%]%c", main->output.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); - fflush(main->output.stream); + fll_print_format("%[==========================%] %[FILTER%] %[==========================%]%c", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s[0]); + fflush(main->output.to.stream); parameters.used = 4; @@ -326,8 +330,8 @@ extern "C" { exit(return_code); } - fll_print_character(f_string_eol_s[0], main->output.stream); - fflush(main->output.stream); + fll_print_character(f_string_eol_s[0], main->output.to.stream); + fflush(main->output.to.stream); } if (F_status_is_error(status)) { @@ -463,7 +467,6 @@ extern "C" { return status; } else { - if (main->error.verbosity != f_console_verbosity_quiet) { fll_print_format("%c%[%sFailed to perform lock request because the lock instructions are missing from: %s.%]%c", main->error.to.stream, f_string_eol_s[0], main->error.context, main->error.prefix, network_path firewall_file_other, main->error.context, f_string_eol_s[0]); } diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 65e23ec..35169b3 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -281,7 +281,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -296,8 +296,8 @@ extern "C" { firewall_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_dynamics_t_initialize, \ f_string_dynamics_t_initialize, \ @@ -308,7 +308,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -317,7 +317,7 @@ extern "C" { * F_none on success. */ #ifndef _di_firewall_print_help_ - extern f_status_t firewall_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t firewall_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_firewall_print_help_ /** 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 70cd5e5..49d7f1a 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 @@ -7,110 +7,110 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_help_ - f_status_t fss_basic_list_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_basic_list_read_name_long, fss_basic_list_read_version); + fll_program_print_help_header(file, context, fss_basic_list_read_name_long, fss_basic_list_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_content, fss_basic_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_columns, fss_basic_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_delimit, fss_basic_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_pipe, fss_basic_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_raw, fss_basic_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); - fll_program_print_help_option(output, context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_content, fss_basic_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_columns, fss_basic_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_delimit, fss_basic_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_pipe, fss_basic_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_raw, fss_basic_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); + fll_program_print_help_option(file, context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); - fll_program_print_help_usage(output, context, fss_basic_list_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_basic_list_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0002 Basic List standard.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0002 Basic List standard.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", file.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", output.stream, f_string_eol_s[0]); - fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", file.stream, f_string_eol_s[0]); + fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object, context.set.notable); - fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object, context.set.notable); + fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable); - fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable); - fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable); - fl_print_format(" %[%s%s%] parameter value.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable); + fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable); + fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_at, context.set.notable); + fl_print_format(" %[%s%s%] parameter value.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program may support parameters, such as %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable); - fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This is done to help ensure consistency for scripting.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program may support parameters, such as %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable); + fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This is done to help ensure consistency for scripting.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable); - fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_depth, context.set.notable); + fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable); - fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable); + fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_trim, context.set.notable); - fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_trim, context.set.notable); + fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying both the %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object, context.set.notable); - fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_content, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content printed are already escaped.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying both the %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_object, context.set.notable); + fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_content, context.set.notable, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content printed are already escaped.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] accepts the following:%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Do not apply delimits.%c", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] accepts the following:%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Do not apply delimits.%c", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable); - fl_print_format(" values %[%s%]", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none, context.set.notable); - fl_print_format(" and %[%s%],", output.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all, context.set.notable); - fl_print_format(" overrule all other delimit values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_delimit, context.set.notable); + fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_none, context.set.notable); + fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_basic_list_read_delimit_mode_name_all, context.set.notable); + fl_print_format(" overrule all other delimit values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameters %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns, context.set.notable); - fl_print_format(" and %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable); - fl_print_format(" refer to a Content column.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This is not to be confused with a depth.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameters %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_columns, context.set.notable); + fl_print_format(" and %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_read_long_select, context.set.notable); + fl_print_format(" refer to a Content column.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This is not to be confused with a depth.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -165,18 +165,22 @@ extern "C" { } if (choice == fss_basic_list_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_basic_list_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_basic_list_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_basic_list_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -186,14 +190,14 @@ extern "C" { } if (main->parameters[fss_basic_list_read_parameter_help].result == f_console_result_found) { - fss_basic_list_read_print_help(main->output, main->context); + fss_basic_list_read_print_help(main->output.to, main->context); fss_basic_list_read_main_delete(main); return status; } if (main->parameters[fss_basic_list_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_basic_list_read_version); + fll_program_print_version(main->output.to, fss_basic_list_read_version); fss_basic_list_read_main_delete(main); return status; diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index d1738c0..3bdd80f 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -209,7 +209,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -221,8 +221,8 @@ extern "C" { fss_basic_list_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -231,7 +231,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -240,7 +240,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_read_print_help_ - extern f_status_t fss_basic_list_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_basic_list_read_print_help_ /** diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 4e078b1..2f36ba1 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -240,11 +240,11 @@ extern "C" { } else if (status == F_data_not_stop || status == F_data_not_eos) { if (data->option & fss_basic_list_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -286,14 +286,14 @@ extern "C" { } if ((data->option & fss_basic_list_read_data_option_object) || (data->option & fss_basic_list_read_data_option_content) && (data->contents.array[at].used || (data->option & fss_basic_list_read_data_option_empty))) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_list_read_data_option_object) { if (data->option & fss_basic_list_read_data_option_trim) { - fl_print_trim_except_in_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, data->comments, main->output.stream); + fl_print_trim_except_in_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, data->comments, main->output.to.stream); } else { - f_print_except_in_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, data->comments, main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, data->comments, main->output.to.stream); } fss_basic_list_read_print_object_end(main); @@ -303,7 +303,7 @@ extern "C" { if (data->contents.array[at].used) { fss_basic_list_read_print_content_ignore(main); - f_print_except_in_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, data->comments, main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, data->comments, main->output.to.stream); fss_basic_list_read_print_content_ignore(main); } @@ -311,7 +311,7 @@ extern "C" { fss_basic_list_read_print_set_end(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } #endif // _di_fss_basic_list_read_print_at_ @@ -324,10 +324,10 @@ extern "C" { } if (data->option & fss_basic_list_read_data_option_trim) { - fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } else { - f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } fss_basic_list_read_print_object_end(main); @@ -338,7 +338,7 @@ extern "C" { void fss_basic_list_read_print_content_ignore(fss_basic_list_read_main_t * const main) { if (main->parameters[fss_basic_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_basic_list_read_pipe_content_ignore, main->output.stream); + f_print_character(fss_basic_list_read_pipe_content_ignore, main->output.to.stream); } } #endif // _di_fss_basic_list_read_print_content_ignore_ @@ -347,15 +347,15 @@ extern "C" { void fss_basic_list_read_print_object_end(fss_basic_list_read_main_t * const main) { if (main->parameters[fss_basic_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_basic_list_read_pipe_content_start, main->output.stream); + f_print_character(fss_basic_list_read_pipe_content_start, main->output.to.stream); } else { if (main->parameters[fss_basic_list_read_parameter_content].result == f_console_result_found) { - f_print_character(f_fss_basic_list_open, main->output.stream); - f_print_character(f_fss_basic_list_open_end, main->output.stream); + f_print_character(f_fss_basic_list_open, main->output.to.stream); + f_print_character(f_fss_basic_list_open_end, main->output.to.stream); } else { - f_print_character(f_fss_eol, main->output.stream); + f_print_character(f_fss_eol, main->output.to.stream); } } } @@ -365,22 +365,22 @@ extern "C" { void fss_basic_list_read_print_set_end(fss_basic_list_read_main_t * const main) { if (main->parameters[fss_basic_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_basic_list_read_pipe_content_end, main->output.stream); + f_print_character(fss_basic_list_read_pipe_content_end, main->output.to.stream); } } #endif // _di_fss_basic_list_read_print_set_end_ #ifndef _di_fss_basic_list_read_print_one_ void fss_basic_list_read_print_one(fss_basic_list_read_main_t * const main) { - f_print_character(f_string_ascii_1_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_1_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_basic_list_read_print_one_ #ifndef _di_fss_basic_list_read_print_zero_ void fss_basic_list_read_print_zero(fss_basic_list_read_main_t * const main) { - f_print_character(f_string_ascii_0_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_0_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_basic_list_read_print_zero_ @@ -393,11 +393,11 @@ extern "C" { // This standard does not support multiple content groups. if ((data->option & fss_basic_list_read_data_option_select) && data->select) { if (main->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -452,11 +452,11 @@ extern "C" { if (data->depths.array[0].value_at >= data->objects.used) { if (data->option & (fss_basic_list_read_data_option_columns | fss_basic_list_read_data_option_total)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -486,10 +486,10 @@ extern "C" { if (status == F_success) return F_none; } else if (data->option & fss_basic_list_read_data_option_columns) { - fll_print_format("%ul%c", main->output.stream, data->contents.array[i].used, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, data->contents.array[i].used, f_string_eol_s[0]); } else if (data->option & fss_basic_list_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->contents.array[i].used) { fss_basic_list_read_print_one(main); @@ -498,7 +498,7 @@ extern "C" { fss_basic_list_read_print_zero(main); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } else { fss_basic_list_read_print_at(i, *delimits_object, *delimits_content, main, data); @@ -511,11 +511,11 @@ extern "C" { } // for if (data->option & fss_basic_list_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -526,11 +526,11 @@ extern "C" { f_status_t fss_basic_list_read_process_columns(fss_basic_list_read_main_t * const main, fss_basic_list_read_data_t *data, bool names[]) { if (!(data->option & fss_basic_list_read_data_option_content)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -546,7 +546,7 @@ extern "C" { } } // for - fll_print_format("%ul%c", main->output.stream, max, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, max, f_string_eol_s[0]); return F_none; } @@ -557,7 +557,7 @@ extern "C" { if (data->option & fss_basic_list_read_data_option_object) { if (*line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_list_read_data_option_total) { fss_basic_list_read_print_one(main); @@ -566,7 +566,7 @@ extern "C" { fss_basic_list_read_print_at_object(main, data, at, delimits_object); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -597,16 +597,16 @@ extern "C" { if (*line == data->line) { range.stop = i; - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_list_read_data_option_total) { fss_basic_list_read_print_one(main); } else { - f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.to.stream); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -624,7 +624,7 @@ extern "C" { ++(*line); if (*line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_list_read_data_option_total) { fss_basic_list_read_print_one(main); @@ -632,11 +632,11 @@ extern "C" { else { range.stop = data->contents.array[at].array[0].stop; - f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -810,7 +810,7 @@ extern "C" { } } // for - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_list_read_data_option_line) { if (data->line < total) { @@ -821,10 +821,10 @@ extern "C" { } } else { - fl_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fl_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 6702590..78719b0 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -7,50 +7,50 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_print_help_ - f_status_t fss_basic_list_write_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_basic_list_write_name_long, fss_basic_list_write_version); + fll_program_print_help_header(file, context, fss_basic_list_write_name_long, fss_basic_list_write_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_content, fss_basic_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to output."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_double, fss_basic_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_ignore, fss_basic_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to output."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not output end of Object/Content character."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_prepend, fss_basic_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_single, fss_basic_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_option(output, context, fss_basic_list_write_short_trim, fss_basic_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_content, fss_basic_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_double, fss_basic_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_ignore, fss_basic_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_prepend, fss_basic_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_single, fss_basic_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, fss_basic_list_write_short_trim, fss_basic_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); - fll_program_print_help_usage(output, context, fss_basic_list_write_name, f_string_empty_s); + fll_program_print_help_usage(file, context, fss_basic_list_write_name, f_string_empty_s); - fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); + fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_single, context.set.notable); - fl_print_format(" and '%[%s%s%]' do nothing.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_single, context.set.notable); + fl_print_format(" and '%[%s%s%]' do nothing.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This parameter requires two values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This parameter requires two values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -102,18 +102,22 @@ extern "C" { } if (choice == fss_basic_list_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_basic_list_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_basic_list_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_basic_list_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -123,14 +127,14 @@ extern "C" { } if (main->parameters[fss_basic_list_write_parameter_help].result == f_console_result_found) { - fss_basic_list_write_print_help(main->output, main->context); + fss_basic_list_write_print_help(main->output.to, main->context); fss_basic_list_write_main_delete(main); return status; } if (main->parameters[fss_basic_list_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_basic_list_write_version); + fll_program_print_version(main->output.to, fss_basic_list_write_version); fss_basic_list_write_main_delete(main); return status; @@ -139,8 +143,10 @@ extern "C" { f_file_t output = f_file_t_initialize; output.id = f_type_descriptor_output; - output.stream = main->output.stream; + output.stream = main->output.to.stream; output.flag = f_file_flag_create | f_file_flag_write_only | f_file_flag_append; + output.size_read = main->output.to.size_read; + output.size_write = main->output.to.size_write; if (F_status_is_error_not(status)) { if (main->parameters[fss_basic_list_write_parameter_file].result == f_console_result_additional) { diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index 71cb190..97b1d08 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -144,7 +144,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; f_string_static_t prepend; @@ -157,8 +157,8 @@ extern "C" { fss_basic_list_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ @@ -168,7 +168,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -177,7 +177,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ - extern f_status_t fss_basic_list_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_basic_list_write_print_help_ /** 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 cbb3a4e..92f40cb 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -7,110 +7,110 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_help_ - f_status_t fss_basic_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_basic_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_basic_read_name_long, fss_basic_read_version); + fll_program_print_help_header(file, context, fss_basic_read_name_long, fss_basic_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); - fll_program_print_help_option(output, context, fss_basic_read_short_content, fss_basic_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); - fll_program_print_help_option(output, context, fss_basic_read_short_columns, fss_basic_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); - fll_program_print_help_option(output, context, fss_basic_read_short_delimit, fss_basic_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); - fll_program_print_help_option(output, context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); - fll_program_print_help_option(output, context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); - fll_program_print_help_option(output, context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); - fll_program_print_help_option(output, context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); - fll_program_print_help_option(output, context, fss_basic_read_short_pipe, fss_basic_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); - fll_program_print_help_option(output, context, fss_basic_read_short_raw, fss_basic_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); - fll_program_print_help_option(output, context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); - fll_program_print_help_option(output, context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); - fll_program_print_help_option(output, context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); + fll_program_print_help_option(file, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); + fll_program_print_help_option(file, context, fss_basic_read_short_content, fss_basic_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); + fll_program_print_help_option(file, context, fss_basic_read_short_columns, fss_basic_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); + fll_program_print_help_option(file, context, fss_basic_read_short_delimit, fss_basic_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); + fll_program_print_help_option(file, context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); + fll_program_print_help_option(file, context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); + fll_program_print_help_option(file, context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); + fll_program_print_help_option(file, context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); + fll_program_print_help_option(file, context, fss_basic_read_short_pipe, fss_basic_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); + fll_program_print_help_option(file, context, fss_basic_read_short_raw, fss_basic_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); + fll_program_print_help_option(file, context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); + fll_program_print_help_option(file, context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); + fll_program_print_help_option(file, context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); - fll_program_print_help_usage(output, context, fss_basic_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_basic_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0000 Basic standard.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0000 Basic standard.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", file.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", output.stream, f_string_eol_s[0]); - fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", file.stream, f_string_eol_s[0]); + fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object, context.set.notable); - fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object, context.set.notable); + fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable); - fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable); - fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable); - fl_print_format(" %[%s%s%] parameter value.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable); + fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable); + fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_at, context.set.notable); + fl_print_format(" %[%s%s%] parameter value.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program may support parameters, such as %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable); - fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This is done to help ensure consistency for scripting.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program may support parameters, such as %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable); + fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This is done to help ensure consistency for scripting.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable); - fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_depth, context.set.notable); + fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable); - fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable); + fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_trim, context.set.notable); - fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_trim, context.set.notable); + fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying both the %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object, context.set.notable); - fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_content, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content printed are already escaped.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content are separated by a space.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying both the %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_object, context.set.notable); + fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_content, context.set.notable, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content printed are already escaped.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content are separated by a space.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] accepts the following:%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Do not apply delimits.%c", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] accepts the following:%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Do not apply delimits.%c", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable); - fl_print_format(" values %[%s%]", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_none, context.set.notable); - fl_print_format(" and %[%s%],", output.stream, context.set.notable, fss_basic_read_delimit_mode_name_all, context.set.notable); - fl_print_format(" overrule all other delimit values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_delimit, context.set.notable); + fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_none, context.set.notable); + fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_basic_read_delimit_mode_name_all, context.set.notable); + fl_print_format(" overrule all other delimit values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameters %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns, context.set.notable); - fl_print_format(" and %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable); - fl_print_format(" refer to a Content column.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This is not to be confused with a depth.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameters %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_columns, context.set.notable); + fl_print_format(" and %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_read_long_select, context.set.notable); + fl_print_format(" refer to a Content column.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This is not to be confused with a depth.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -165,18 +165,22 @@ extern "C" { } if (choice == fss_basic_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_basic_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_basic_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_basic_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -186,14 +190,14 @@ extern "C" { } if (main->parameters[fss_basic_read_parameter_help].result == f_console_result_found) { - fss_basic_read_print_help(main->output, main->context); + fss_basic_read_print_help(main->output.to, main->context); fss_basic_read_main_delete(main); return status; } if (main->parameters[fss_basic_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_basic_read_version); + fll_program_print_version(main->output.to, fss_basic_read_version); fss_basic_read_main_delete(main); return status; diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index a03835c..4d1a614 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -209,7 +209,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -221,8 +221,8 @@ extern "C" { fss_basic_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -231,7 +231,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -240,7 +240,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_read_print_help_ - extern f_status_t fss_basic_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_basic_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_basic_read_print_help_ /** diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index d94c348..9abe7cd 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -259,39 +259,39 @@ extern "C" { } if ((data->option & fss_basic_read_data_option_object) || (data->option & fss_basic_read_data_option_content) && (data->contents.array[at].used || (data->option & fss_basic_read_data_option_empty))) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_read_data_option_object) { if (data->option & fss_basic_read_data_option_trim) { if (data->option & fss_basic_read_data_option_raw) { if (data->quotes.array[at]) { - f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - fl_print_trim_dynamic_partial(data->buffer, data->objects.array[at], main->output.stream); + fl_print_trim_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream); if (data->quotes.array[at]) { - f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } else { - fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } } else { if (data->option & fss_basic_read_data_option_raw) { if (data->quotes.array[at]) { - f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - f_print_dynamic_partial(data->buffer, data->objects.array[at], main->output.stream); + f_print_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream); if (data->quotes.array[at]) { - f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } else { - f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } } @@ -302,16 +302,16 @@ extern "C" { if ((data->option & fss_basic_read_data_option_content) && data->contents.array[at].used) { if (data->option & fss_basic_read_data_option_raw) { - f_print_dynamic_partial(data->buffer, data->contents.array[at].array[0], main->output.stream); + f_print_dynamic_partial(data->buffer, data->contents.array[at].array[0], main->output.to.stream); } else { - f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, main->output.to.stream); } } fss_basic_read_print_set_end(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } #endif // _di_fss_basic_read_print_at_ @@ -320,18 +320,18 @@ extern "C" { void fss_basic_read_print_object_end(fss_basic_read_main_t * const main) { if (main->parameters[fss_basic_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_basic_read_pipe_content_start, main->output.stream); + f_print_character(fss_basic_read_pipe_content_start, main->output.to.stream); } else { - f_print_character(f_fss_space, main->output.stream); + f_print_character(f_fss_space, main->output.to.stream); } } #endif // _di_fss_basic_read_print_object_end_ #ifndef _di_fss_basic_read_print_one_ void fss_basic_read_print_one(fss_basic_read_main_t * const main) { - f_print_character(f_string_ascii_1_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_1_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_basic_read_print_one_ @@ -339,18 +339,18 @@ extern "C" { void fss_basic_read_print_set_end(fss_basic_read_main_t * const main) { if (main->parameters[fss_basic_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_basic_read_pipe_content_end, main->output.stream); + f_print_character(fss_basic_read_pipe_content_end, main->output.to.stream); } else { - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } } #endif // _di_fss_basic_read_print_set_end_ #ifndef _di_fss_basic_read_print_zero_ void fss_basic_read_print_zero(fss_basic_read_main_t * const main) { - f_print_character(f_string_ascii_0_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_0_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_basic_read_print_zero_ @@ -363,11 +363,11 @@ extern "C" { // This standard does not support multiple content groups. if ((data->option & fss_basic_read_data_option_select) && data->select) { if (main->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -416,11 +416,11 @@ extern "C" { if (data->depths.array[0].value_at >= data->objects.used) { if (data->option & (fss_basic_read_data_option_columns | fss_basic_read_data_option_total)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -430,11 +430,11 @@ extern "C" { if (data->option & fss_basic_read_data_option_line) { if (data->line) { if (data->option & fss_basic_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -457,21 +457,21 @@ extern "C" { if (data->line) break; if (data->option & fss_basic_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_one(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } else { fss_basic_read_print_at(i, *delimits, except_none, main, data); } } else if (data->option & fss_basic_read_data_option_columns) { - fll_print_format("%ul%c", main->output.stream, data->contents.array[i].used, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, data->contents.array[i].used, f_string_eol_s[0]); } else if (data->option & fss_basic_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->contents.array[i].used) { fss_basic_read_print_one(main); @@ -480,7 +480,7 @@ extern "C" { fss_basic_read_print_zero(main); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } else { fss_basic_read_print_at(i, *delimits, except_none, main, data); @@ -493,11 +493,11 @@ extern "C" { } // for if (data->option & fss_basic_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -508,11 +508,11 @@ extern "C" { f_status_t fss_basic_read_process_columns(fss_basic_read_main_t * const main, fss_basic_read_data_t *data, bool names[]) { if (!(data->option & fss_basic_read_data_option_content)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -528,7 +528,7 @@ extern "C" { } } // for - fll_print_format("%ul%c", main->output.stream, max, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, max, f_string_eol_s[0]); return F_none; } @@ -550,11 +550,11 @@ extern "C" { if (!data->contents.array[i].used) { if (data->option & fss_basic_read_data_option_empty) { if (line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_basic_read_print_set_end(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); break; } @@ -696,7 +696,7 @@ extern "C" { ++total; } // for - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_basic_read_data_option_line) { if (data->line < total) { @@ -707,10 +707,10 @@ extern "C" { } } else { - fl_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fl_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index d0a684b..668545d 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -7,50 +7,50 @@ extern "C" { #endif #ifndef _di_fss_basic_write_print_help_ - f_status_t fss_basic_write_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_basic_write_name_long, fss_basic_write_version); + fll_program_print_help_header(file, context, fss_basic_write_name_long, fss_basic_write_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, fss_basic_write_short_content, fss_basic_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to output."); - fll_program_print_help_option(output, context, fss_basic_write_short_double, fss_basic_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, fss_basic_write_short_ignore, fss_basic_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); - fll_program_print_help_option(output, context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to output."); - fll_program_print_help_option(output, context, fss_basic_write_short_partial, fss_basic_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not output end of Object/Content character."); - fll_program_print_help_option(output, context, fss_basic_write_short_prepend, fss_basic_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); - fll_program_print_help_option(output, context, fss_basic_write_short_single, fss_basic_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_option(output, context, fss_basic_write_short_trim, fss_basic_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); + fll_program_print_help_option(file, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, fss_basic_write_short_content, fss_basic_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file."); + fll_program_print_help_option(file, context, fss_basic_write_short_double, fss_basic_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, fss_basic_write_short_ignore, fss_basic_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); + fll_program_print_help_option(file, context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file."); + fll_program_print_help_option(file, context, fss_basic_write_short_partial, fss_basic_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character."); + fll_program_print_help_option(file, context, fss_basic_write_short_prepend, fss_basic_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); + fll_program_print_help_option(file, context, fss_basic_write_short_single, fss_basic_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, fss_basic_write_short_trim, fss_basic_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); - fll_program_print_help_usage(output, context, fss_basic_write_name, f_string_empty_s); + fll_program_print_help_usage(file, context, fss_basic_write_name, f_string_empty_s); - fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); + fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend, context.set.notable); - fl_print_format(" does nothing.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_prepend, context.set.notable); + fl_print_format(" does nothing.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This parameter requires two values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_basic_write_long_ignore, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This parameter requires two values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -102,18 +102,22 @@ extern "C" { } if (choice == fss_basic_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_basic_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_basic_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_basic_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -123,14 +127,14 @@ extern "C" { } if (main->parameters[fss_basic_write_parameter_help].result == f_console_result_found) { - fss_basic_write_print_help(main->output, main->context); + fss_basic_write_print_help(main->output.to, main->context); fss_basic_write_main_delete(main); return status; } if (main->parameters[fss_basic_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_basic_write_version); + fll_program_print_version(main->output.to, fss_basic_write_version); fss_basic_write_main_delete(main); return status; diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index 0cda402..95e1c72 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -145,7 +145,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -157,8 +157,8 @@ extern "C" { fss_basic_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -167,7 +167,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -176,7 +176,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_write_print_help_ - extern f_status_t fss_basic_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_basic_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_basic_write_print_help_ /** 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 fd8257a..42744a8 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 @@ -7,111 +7,111 @@ extern "C" { #endif #ifndef _di_fss_embedded_list_read_print_help_ - f_status_t fss_embedded_list_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_embedded_list_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_embedded_list_read_name_long, fss_embedded_list_read_version); + fll_program_print_help_header(file, context, fss_embedded_list_read_name_long, fss_embedded_list_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_at, fss_embedded_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_content, fss_embedded_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_columns, fss_embedded_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_delimit, fss_embedded_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_depth, fss_embedded_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_empty, fss_embedded_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_line, fss_embedded_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_name, fss_embedded_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_object, fss_embedded_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_pipe, fss_embedded_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_raw, fss_embedded_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_select, fss_embedded_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_total, fss_embedded_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); - fll_program_print_help_option(output, context, fss_embedded_list_read_short_trim, fss_embedded_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_at, fss_embedded_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_content, fss_embedded_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_columns, fss_embedded_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_delimit, fss_embedded_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_depth, fss_embedded_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_empty, fss_embedded_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_line, fss_embedded_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_name, fss_embedded_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_object, fss_embedded_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_pipe, fss_embedded_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_raw, fss_embedded_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_select, fss_embedded_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_total, fss_embedded_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); + fll_program_print_help_option(file, context, fss_embedded_list_read_short_trim, fss_embedded_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); - fll_program_print_help_usage(output, context, fss_embedded_list_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_embedded_list_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0008 Embedded List standard.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0008 Embedded List standard.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", file.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", output.stream, f_string_eol_s[0]); - fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", file.stream, f_string_eol_s[0]); + fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object, context.set.notable); - fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object, context.set.notable); + fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable); - fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable); - fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable); - fl_print_format(" %[%s%s%] parameter value.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable); + fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable); + fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_at, context.set.notable); + fl_print_format(" %[%s%s%] parameter value.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program may support parameters, such as %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable); - fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This is done to help ensure consistency for scripting.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program may support parameters, such as %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable); + fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This is done to help ensure consistency for scripting.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable); - fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_depth, context.set.notable); + fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable); - fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable); + fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_trim, context.set.notable); - fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_trim, context.set.notable); + fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying both the %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object, context.set.notable); - fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_content, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content printed are already escaped.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying both the %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_object, context.set.notable); + fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_content, context.set.notable, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content printed are already escaped.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] accepts the following:%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Do not apply delimits.%c", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] accepts the following:%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Do not apply delimits.%c", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); // @todo - //fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + //fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable); - fl_print_format(" values %[%s%]", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none, context.set.notable); - fl_print_format(" and %[%s%],", output.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all, context.set.notable); - fl_print_format(" overrule all other delimit values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_delimit, context.set.notable); + fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_none, context.set.notable); + fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_embedded_list_read_delimit_mode_name_all, context.set.notable); + fl_print_format(" overrule all other delimit values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameters %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns, context.set.notable); - fl_print_format(" and %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable); - fl_print_format(" refer to a Content column.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This is not to be confused with a depth.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameters %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_columns, context.set.notable); + fl_print_format(" and %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_read_long_select, context.set.notable); + fl_print_format(" refer to a Content column.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This is not to be confused with a depth.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -163,18 +163,22 @@ extern "C" { } if (choice == fss_embedded_list_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_embedded_list_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_embedded_list_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_embedded_list_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -184,14 +188,14 @@ extern "C" { } if (main->parameters[fss_embedded_list_read_parameter_help].result == f_console_result_found) { - fss_embedded_list_read_print_help(main->output, main->context); + fss_embedded_list_read_print_help(main->output.to, main->context); fss_embedded_list_read_main_delete(main); return F_none; } if (main->parameters[fss_embedded_list_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_embedded_list_read_version); + fll_program_print_version(main->output.to, fss_embedded_list_read_version); fss_embedded_list_read_main_delete(main); return F_none; @@ -447,7 +451,7 @@ extern "C" { // Skip past empty files. if (!main->quantity.total) { if (main->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fll_print_format("0%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("0%c", main->output.to.stream, f_string_eol_s[0]); } f_file_stream_close(F_true, &file); diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h index e682cd9..fb6b979 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.h @@ -190,7 +190,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -209,8 +209,8 @@ extern "C" { fss_embedded_list_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_dynamic_t_initialize, \ f_fss_nest_t_initialize, \ @@ -224,7 +224,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -233,7 +233,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_embedded_list_read_print_help_ - extern f_status_t fss_embedded_list_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_embedded_list_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_embedded_list_read_print_help_ /** diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c index 004f9cd..a6d010a 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c @@ -250,7 +250,7 @@ extern "C" { macro_f_string_dynamic_t_delete_simple(main->buffer); if (main->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fll_print_format("0%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("0%c", main->output.to.stream, f_string_eol_s[0]); return F_none; } @@ -279,7 +279,7 @@ extern "C" { // Requested depths cannot be greater than contents depth. if (depths.used > main->nest.used) { if (main->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fll_print_format("0%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("0%c", main->output.to.stream, f_string_eol_s[0]); return F_none; } @@ -499,7 +499,7 @@ extern "C" { ++total; } // for - fll_print_format("%lu%c", main->output.stream, total, f_string_eol_s[0]); + fll_print_format("%lu%c", main->output.to.stream, total, f_string_eol_s[0]); return F_none; } @@ -510,26 +510,26 @@ extern "C" { print_object = &fl_print_trim_except_dynamic_partial; } - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (i = 0; i < items->used; ++i) { if (skip[i]) continue; - print_object(main->buffer, items->array[i].object, *objects_delimits, main->output.stream); + print_object(main->buffer, items->array[i].object, *objects_delimits, main->output.to.stream); if (main->parameters[fss_embedded_list_read_parameter_content].result == f_console_result_found) { fss_embedded_list_read_print_object_end(*main); if (items->array[i].content.used) { - f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.stream); + f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.to.stream); } } fss_embedded_list_read_print_set_end(*main); } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -566,7 +566,7 @@ extern "C" { } // for } // for - fll_print_format("%lu%c", main->output.stream, total, f_string_eol_s[0]); + fll_print_format("%lu%c", main->output.to.stream, total, f_string_eol_s[0]); return F_none; } @@ -574,7 +574,7 @@ extern "C" { if (main->parameters[fss_embedded_list_read_parameter_line].result == f_console_result_additional) { f_array_length_t line_current = 0; - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (; i < items->used; ++i) { @@ -617,23 +617,23 @@ extern "C" { if (!main->buffer.string[j]) continue; if (main->buffer.string[j] == f_string_eol_s[0]) { - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); break; } - f_print_character(main->buffer.string[j], main->output.stream); + f_print_character(main->buffer.string[j], main->output.to.stream); } // for break; } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (i = 0; i < items->used; ++i) { @@ -647,14 +647,14 @@ extern "C" { continue; } - f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.stream); + f_print_except_dynamic_partial(main->buffer, items->array[i].content.array[0], *contents_delimits, main->output.to.stream); if (main->parameters[fss_embedded_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_embedded_list_read_pipe_content_end, main->output.stream); + f_print_character(fss_embedded_list_read_pipe_content_end, main->output.to.stream); } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -664,15 +664,15 @@ extern "C" { void fss_embedded_list_read_print_object_end(const fss_embedded_list_read_main_t main) { if (main.parameters[fss_embedded_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_embedded_list_read_pipe_content_start, main.output.stream); + f_print_character(fss_embedded_list_read_pipe_content_start, main.output.to.stream); } else { if (main.parameters[fss_embedded_list_read_parameter_object].result == f_console_result_found && main.parameters[fss_embedded_list_read_parameter_content].result == f_console_result_found) { - f_print_character(f_fss_embedded_list_open, main.output.stream); - f_print_character(f_fss_embedded_list_open_end, main.output.stream); + f_print_character(f_fss_embedded_list_open, main.output.to.stream); + f_print_character(f_fss_embedded_list_open_end, main.output.to.stream); } else { - f_print_character(f_fss_eol, main.output.stream); + f_print_character(f_fss_eol, main.output.to.stream); } } } @@ -682,7 +682,7 @@ extern "C" { void fss_embedded_list_read_print_content_ignore(const fss_embedded_list_read_main_t main) { if (main.parameters[fss_embedded_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_embedded_list_read_pipe_content_ignore, main.output.stream); + f_print_character(fss_embedded_list_read_pipe_content_ignore, main.output.to.stream); } } #endif // _di_fss_embedded_list_read_print_content_ignore_ @@ -691,15 +691,15 @@ extern "C" { void fss_embedded_list_read_print_set_end(const fss_embedded_list_read_main_t main) { if (main.parameters[fss_embedded_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_embedded_list_read_pipe_content_end, main.output.stream); + f_print_character(fss_embedded_list_read_pipe_content_end, main.output.to.stream); } else { if (main.parameters[fss_embedded_list_read_parameter_object].result == f_console_result_found && main.parameters[fss_embedded_list_read_parameter_content].result == f_console_result_found) { - f_print_character(f_fss_embedded_list_close, main.output.stream); - f_print_character(f_fss_embedded_list_close_end, main.output.stream); + f_print_character(f_fss_embedded_list_close, main.output.to.stream); + f_print_character(f_fss_embedded_list_close_end, main.output.to.stream); } else { - f_print_character(f_fss_eol, main.output.stream); + f_print_character(f_fss_eol, main.output.to.stream); } } } diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index cd89afa..009abc2 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -7,53 +7,53 @@ extern "C" { #endif #ifndef _di_fss_embedded_list_write_print_help_ - f_status_t fss_embedded_list_write_print_help(const f_file_t output, const f_color_context_t context) { - - flockfile(output.stream); - - fll_program_print_help_header(output, context, fss_embedded_list_write_name_long, fss_embedded_list_write_version); - - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - - f_print_character(f_string_eol_s[0], output.stream); - - fll_program_print_help_option(output, context, fss_embedded_list_write_short_file, fss_embedded_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_content, fss_embedded_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to output."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_double, fss_embedded_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_ignore, fss_embedded_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_object, fss_embedded_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to output."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_partial, fss_embedded_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not output end of Object/Content character."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_prepend, fss_embedded_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_single, fss_embedded_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_option(output, context, fss_embedded_list_write_short_trim, fss_embedded_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); - - fll_program_print_help_usage(output, context, fss_embedded_list_write_name, f_string_empty_s); - - fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); - - fl_print_format(" The FSS-0008 (Embedded List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_single, context.set.notable); - fl_print_format(" and '%[%s%s%]' do nothing.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - - fl_print_format(" The parameter '%[%s%s%]' designates to not escape any valid nested Object or Content within some Content.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This parameter requires two values.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This parameter must be specified after a '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content, context.set.notable); - fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%s%s%]' parameter.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - - funlockfile(output.stream); + f_status_t fss_embedded_list_write_print_help(const f_file_t file, const f_color_context_t context) { + + flockfile(file.stream); + + fll_program_print_help_header(file, context, fss_embedded_list_write_name_long, fss_embedded_list_write_version); + + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + + f_print_character(f_string_eol_s[0], file.stream); + + fll_program_print_help_option(file, context, fss_embedded_list_write_short_file, fss_embedded_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_content, fss_embedded_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_double, fss_embedded_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_ignore, fss_embedded_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_object, fss_embedded_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_partial, fss_embedded_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_prepend, fss_embedded_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_single, fss_embedded_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, fss_embedded_list_write_short_trim, fss_embedded_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); + + fll_program_print_help_usage(file, context, fss_embedded_list_write_name, f_string_empty_s); + + fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); + fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); + + fl_print_format(" The FSS-0008 (Embedded List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_single, context.set.notable); + fl_print_format(" and '%[%s%s%]' do nothing.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + + fl_print_format(" The parameter '%[%s%s%]' designates to not escape any valid nested Object or Content within some Content.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This parameter requires two values.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This parameter must be specified after a '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content, context.set.notable); + fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%s%s%]' parameter.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_embedded_list_write_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + + funlockfile(file.stream); return F_none; } @@ -105,18 +105,22 @@ extern "C" { } if (choice == fss_embedded_list_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_embedded_list_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_embedded_list_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_embedded_list_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -126,14 +130,14 @@ extern "C" { } if (main->parameters[fss_embedded_list_write_parameter_help].result == f_console_result_found) { - fss_embedded_list_write_print_help(main->output, main->context); + fss_embedded_list_write_print_help(main->output.to, main->context); fss_embedded_list_write_main_delete(main); return status; } if (main->parameters[fss_embedded_list_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_embedded_list_write_version); + fll_program_print_version(main->output.to, fss_embedded_list_write_version); fss_embedded_list_write_main_delete(main); return status; diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h index 1c8a16f..37e013d 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.h @@ -145,7 +145,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; f_string_static_t prepend; @@ -158,8 +158,8 @@ extern "C" { fss_embedded_list_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ @@ -169,7 +169,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -178,7 +178,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_embedded_list_write_print_help_ - extern f_status_t fss_embedded_list_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_embedded_list_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_embedded_list_write_print_help_ /** 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 fc78896..e9aba52 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 @@ -7,110 +7,110 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_help_ - f_status_t fss_extended_list_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_extended_list_read_name_long, fss_extended_list_read_version); + fll_program_print_help_header(file, context, fss_extended_list_read_name_long, fss_extended_list_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_content, fss_extended_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_columns, fss_extended_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_delimit, fss_extended_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_pipe, fss_extended_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_raw, fss_extended_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); - fll_program_print_help_option(output, context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_content, fss_extended_list_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_columns, fss_extended_list_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_delimit, fss_extended_list_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_pipe, fss_extended_list_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_raw, fss_extended_list_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); + fll_program_print_help_option(file, context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); - fll_program_print_help_usage(output, context, fss_extended_list_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_extended_list_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0003 Extended List standard.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0003 Extended List standard.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", file.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", output.stream, f_string_eol_s[0]); - fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", file.stream, f_string_eol_s[0]); + fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object, context.set.notable); - fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object, context.set.notable); + fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable); - fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable); - fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable); - fl_print_format(" %[%s%s%] parameter value.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable); + fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable); + fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_at, context.set.notable); + fl_print_format(" %[%s%s%] parameter value.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program may support parameters, such as %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable); - fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This is done to help ensure consistency for scripting.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program may support parameters, such as %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable); + fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This is done to help ensure consistency for scripting.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable); - fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_depth, context.set.notable); + fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable); - fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable); + fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_trim, context.set.notable); - fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_trim, context.set.notable); + fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying both the %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object, context.set.notable); - fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_content, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content printed are already escaped.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying both the %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_object, context.set.notable); + fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_content, context.set.notable, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content printed are already escaped.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content are separated by an EOL.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] accepts the following:%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Do not apply delimits.%c", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] accepts the following:%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Do not apply delimits.%c", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable); - fl_print_format(" values %[%s%]", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none, context.set.notable); - fl_print_format(" and %[%s%],", output.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all, context.set.notable); - fl_print_format(" overrule all other delimit values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_delimit, context.set.notable); + fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_none, context.set.notable); + fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_extended_list_read_delimit_mode_name_all, context.set.notable); + fl_print_format(" overrule all other delimit values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameters %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns, context.set.notable); - fl_print_format(" and %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable); - fl_print_format(" refer to a Content column.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This is not to be confused with a depth.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameters %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_columns, context.set.notable); + fl_print_format(" and %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_read_long_select, context.set.notable); + fl_print_format(" refer to a Content column.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This is not to be confused with a depth.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -163,18 +163,22 @@ extern "C" { } if (choice == fss_extended_list_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_extended_list_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_extended_list_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_extended_list_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -184,14 +188,14 @@ extern "C" { } if (main->parameters[fss_extended_list_read_parameter_help].result == f_console_result_found) { - fss_extended_list_read_print_help(main->output, main->context); + fss_extended_list_read_print_help(main->output.to, main->context); fss_extended_list_read_main_delete(main); return status; } if (main->parameters[fss_extended_list_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_extended_list_read_version); + fll_program_print_version(main->output.to, fss_extended_list_read_version); fss_extended_list_read_main_delete(main); return status; diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index da5858a..8b0a90c 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -209,7 +209,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -221,8 +221,8 @@ extern "C" { fss_extended_list_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -231,7 +231,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -240,7 +240,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_list_read_print_help_ - extern f_status_t fss_extended_list_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_extended_list_read_print_help_ /** diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 9bceda3..71e4114 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -282,14 +282,14 @@ extern "C" { } if ((data->option & fss_extended_list_read_data_option_object) || ((data->option & fss_extended_list_read_data_option_content) && (data->contents.array[at].used && data->contents.array[at].array[0].start <= data->contents.array[at].array[0].stop || (data->option & fss_extended_list_read_data_option_empty)))) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_list_read_data_option_object) { if (data->option & fss_extended_list_read_data_option_trim) { - fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } else { - f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } fss_extended_list_read_print_object_end(main, data); @@ -300,7 +300,7 @@ extern "C" { if (data->contents.array[at].used && data->contents.array[at].array[0].start <= data->contents.array[at].array[0].stop) { fss_extended_list_read_print_content_ignore(main); - f_print_except_in_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, data->comments, main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, data->contents.array[at].array[0], delimits_content, data->comments, main->output.to.stream); fss_extended_list_read_print_content_ignore(main); } @@ -309,7 +309,7 @@ extern "C" { fss_extended_list_read_print_set_end(main, data); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } #endif // _di_fss_extended_list_read_print_at_ @@ -322,10 +322,10 @@ extern "C" { } if (data->option & fss_extended_list_read_data_option_trim) { - fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } else { - f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); } fss_extended_list_read_print_object_end(main, data); @@ -336,7 +336,7 @@ extern "C" { void fss_extended_list_read_print_content_ignore(fss_extended_list_read_main_t * const main) { if (main->parameters[fss_extended_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_list_read_pipe_content_ignore, main->output.stream); + f_print_character(fss_extended_list_read_pipe_content_ignore, main->output.to.stream); } } #endif // _di_fss_extended_list_read_print_content_ignore_ @@ -345,12 +345,12 @@ extern "C" { void fss_extended_list_read_print_object_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) { if (main->parameters[fss_extended_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_list_read_pipe_content_start, main->output.stream); + f_print_character(fss_extended_list_read_pipe_content_start, main->output.to.stream); } else { if ((data->option & fss_extended_list_read_data_option_object) && (data->option & fss_extended_list_read_data_option_content)) { - f_print_character(f_fss_extended_list_open, main->output.stream); - f_print_character(f_fss_extended_list_open_end, main->output.stream); + f_print_character(f_fss_extended_list_open, main->output.to.stream); + f_print_character(f_fss_extended_list_open_end, main->output.to.stream); } } } @@ -360,16 +360,16 @@ extern "C" { void fss_extended_list_read_print_set_end(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t * const data) { if (main->parameters[fss_extended_list_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_list_read_pipe_content_end, main->output.stream); + f_print_character(fss_extended_list_read_pipe_content_end, main->output.to.stream); } else { if (data->option & fss_extended_list_read_data_option_object) { if (data->option & fss_extended_list_read_data_option_content) { - f_print_character(f_fss_extended_list_close, main->output.stream); - f_print_character(f_fss_extended_list_close_end, main->output.stream); + f_print_character(f_fss_extended_list_close, main->output.to.stream); + f_print_character(f_fss_extended_list_close_end, main->output.to.stream); } else if (!(data->option & fss_extended_list_read_data_option_content)) { - f_print_character(f_fss_eol, main->output.stream); + f_print_character(f_fss_eol, main->output.to.stream); } } } @@ -378,15 +378,15 @@ extern "C" { #ifndef _di_fss_extended_list_read_print_one_ void fss_extended_list_read_print_one(fss_extended_list_read_main_t * const main) { - f_print_character(f_string_ascii_1_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_1_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_extended_list_read_print_one_ #ifndef _di_fss_extended_list_read_print_zero_ void fss_extended_list_read_print_zero(fss_extended_list_read_main_t * const main) { - f_print_character(f_string_ascii_0_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_0_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_extended_list_read_print_zero_ @@ -454,11 +454,11 @@ extern "C" { if (data->depths.array[0].value_at >= data->objects.used) { if (data->option & (fss_extended_list_read_data_option_columns | fss_extended_list_read_data_option_total)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -488,11 +488,11 @@ extern "C" { if (status == F_success) return F_none; } else if (data->option & fss_extended_list_read_data_option_columns) { - fll_print_format("%ul%c", main->output.stream, data->contents.array[i].used, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, data->contents.array[i].used, f_string_eol_s[0]); } else if (data->option & fss_extended_list_read_data_option_total) { if ((data->option & fss_extended_list_read_data_option_object) && !(data->option & fss_extended_list_read_data_option_content)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->contents.array[i].used) { fss_extended_list_read_print_one(main); @@ -501,7 +501,7 @@ extern "C" { fss_extended_list_read_print_zero(main); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } else { f_array_length_t total = 0; @@ -543,7 +543,7 @@ extern "C" { } } // for - fll_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); } } else { @@ -557,11 +557,11 @@ extern "C" { } // for if (data->option & fss_extended_list_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -572,11 +572,11 @@ extern "C" { f_status_t fss_extended_list_read_process_columns(fss_extended_list_read_main_t * const main, fss_extended_list_read_data_t *data, bool names[]) { if (!(data->option & fss_extended_list_read_data_option_content)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_list_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -592,7 +592,7 @@ extern "C" { } } // for - fll_print_format("%ul%c", main->output.stream, max, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, max, f_string_eol_s[0]); return F_none; } @@ -604,7 +604,7 @@ extern "C" { if (data->option & fss_extended_list_read_data_option_object) { if (*line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_list_read_data_option_total) { fss_extended_list_read_print_one(main); @@ -613,7 +613,7 @@ extern "C" { fss_extended_list_read_print_at_object(main, data, at, delimits_object); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -644,16 +644,16 @@ extern "C" { if (*line == data->line) { range.stop = i; - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_list_read_data_option_total) { fss_extended_list_read_print_one(main); } else { - f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.to.stream); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -671,7 +671,7 @@ extern "C" { ++(*line); if (*line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_list_read_data_option_total) { fss_extended_list_read_print_one(main); @@ -679,11 +679,11 @@ extern "C" { else { range.stop = data->contents.array[at].array[0].stop; - f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_except_in_dynamic_partial(data->buffer, range, delimits_content, data->comments, main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -862,7 +862,7 @@ extern "C" { } } // for - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_list_read_data_option_line) { if (data->line < total) { @@ -873,10 +873,10 @@ extern "C" { } } else { - fl_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fl_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index 03877f7..2cf465e 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -7,53 +7,53 @@ extern "C" { #endif #ifndef _di_fss_extended_list_write_print_help_ - f_status_t fss_extended_list_write_print_help(const f_file_t output, const f_color_context_t context) { - - flockfile(output.stream); - - fll_program_print_help_header(output, context, fss_extended_list_write_name_long, fss_extended_list_write_version); - - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - - f_print_character(f_string_eol_s[0], output.stream); - - fll_program_print_help_option(output, context, fss_extended_list_write_short_file, fss_extended_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_content, fss_extended_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to output."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_double, fss_extended_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_ignore, fss_extended_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_object, fss_extended_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to output."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_partial, fss_extended_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not output end of Object/Content character."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_prepend, fss_extended_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_single, fss_extended_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_option(output, context, fss_extended_list_write_short_trim, fss_extended_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); - - fll_program_print_help_usage(output, context, fss_extended_list_write_name, f_string_empty_s); - - fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); - - fl_print_format(" The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_single, context.set.notable); - fl_print_format(" and '%[%s%s%]' do nothing.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - - fl_print_format(" The parameter '%[%s%s%]' designates to not escape any valid nested Object or Content within some Content.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This parameter requires two values.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This parameter must be specified after a '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content, context.set.notable); - fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%s%s%]' parameter.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - - funlockfile(output.stream); + f_status_t fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context) { + + flockfile(file.stream); + + fll_program_print_help_header(file, context, fss_extended_list_write_name_long, fss_extended_list_write_version); + + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + + f_print_character(f_string_eol_s[0], file.stream); + + fll_program_print_help_option(file, context, fss_extended_list_write_short_file, fss_extended_list_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_content, fss_extended_list_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_double, fss_extended_list_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_ignore, fss_extended_list_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_object, fss_extended_list_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_partial, fss_extended_list_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_prepend, fss_extended_list_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_single, fss_extended_list_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, fss_extended_list_write_short_trim, fss_extended_list_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); + + fll_program_print_help_usage(file, context, fss_extended_list_write_name, f_string_empty_s); + + fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range (use this both before and after the range).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); + fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); + + fl_print_format(" The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_single, context.set.notable); + fl_print_format(" and '%[%s%s%]' do nothing.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_double, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + + fl_print_format(" The parameter '%[%s%s%]' designates to not escape any valid nested Object or Content within some Content.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_ignore, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This parameter requires two values.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This parameter is not used for ignoring anything from the input pipe.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This parameter must be specified after a '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content, context.set.notable); + fl_print_format(" parameter and this applies only to the Content represented by that specific '%[%s%s%]' parameter.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_list_write_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + + funlockfile(file.stream); return F_none; } @@ -105,18 +105,22 @@ extern "C" { } if (choice == fss_extended_list_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_extended_list_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_extended_list_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_extended_list_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -126,14 +130,14 @@ extern "C" { } if (main->parameters[fss_extended_list_write_parameter_help].result == f_console_result_found) { - fss_extended_list_write_print_help(main->output, main->context); + fss_extended_list_write_print_help(main->output.to, main->context); fss_extended_list_write_main_delete(main); return status; } if (main->parameters[fss_extended_list_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_extended_list_write_version); + fll_program_print_version(main->output.to, fss_extended_list_write_version); fss_extended_list_write_main_delete(main); return status; diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.h b/level_3/fss_extended_list_write/c/fss_extended_list_write.h index 2d0c913..12ca2ee 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.h +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.h @@ -145,7 +145,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -159,8 +159,8 @@ extern "C" { fss_extended_list_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ @@ -170,7 +170,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -179,7 +179,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_list_write_print_help_ - extern f_status_t fss_extended_list_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_extended_list_write_print_help_ /** 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 3f13d70..5f33fbb 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -7,110 +7,110 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_help_ - f_status_t fss_extended_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_extended_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_extended_read_name_long, fss_extended_read_version); + fll_program_print_help_header(file, context, fss_extended_read_name_long, fss_extended_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); - fll_program_print_help_option(output, context, fss_extended_read_short_content, fss_extended_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); - fll_program_print_help_option(output, context, fss_extended_read_short_columns, fss_extended_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); - fll_program_print_help_option(output, context, fss_extended_read_short_delimit, fss_extended_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); - fll_program_print_help_option(output, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); - fll_program_print_help_option(output, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); - fll_program_print_help_option(output, context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); - fll_program_print_help_option(output, context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); - fll_program_print_help_option(output, context, fss_extended_read_short_pipe, fss_extended_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); - fll_program_print_help_option(output, context, fss_extended_read_short_raw, fss_extended_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); - fll_program_print_help_option(output, context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); - fll_program_print_help_option(output, context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); - fll_program_print_help_option(output, context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); + fll_program_print_help_option(file, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric index."); + fll_program_print_help_option(file, context, fss_extended_read_short_content, fss_extended_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Content (default)."); + fll_program_print_help_option(file, context, fss_extended_read_short_columns, fss_extended_read_long_columns, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of columns."); + fll_program_print_help_option(file, context, fss_extended_read_short_delimit, fss_extended_read_long_delimit, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Designate how to handle applying delimits."); + fll_program_print_help_option(file, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object at this numeric depth."); + fll_program_print_help_option(file, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Include empty Content when processing."); + fll_program_print_help_option(file, context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Content at the given line."); + fll_program_print_help_option(file, context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Object."); + fll_program_print_help_option(file, context, fss_extended_read_short_pipe, fss_extended_read_long_pipe, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print using the special pipe format."); + fll_program_print_help_option(file, context, fss_extended_read_short_raw, fss_extended_read_long_raw, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print with the original quotes and escapes."); + fll_program_print_help_option(file, context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select sub-Content at this index."); + fll_program_print_help_option(file, context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of lines."); + fll_program_print_help_option(file, context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names on select or print."); - fll_program_print_help_usage(output, context, fss_extended_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_extended_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0001 Extended standard.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program will print the Content associated with the given Object and Content main based on the FSS-0001 Extended standard.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" All numeric positions (indexes) start at 0 instead of 1.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" For example, a file of 17 lines would range from 0 to 16.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" When using the %[%s%s%] option, an order of operations is enforced on the parameters.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", output.stream, f_string_eol_s[0]); + fl_print_format(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", file.stream, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object index at the specified depth.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: A new depth within the specified depth, indexed from the root.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%s%]: An Object name at the specified depth.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); - fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", output.stream, f_string_eol_s[0]); - fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] must be in numeric order, but values in between may be skipped.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable, f_string_eol_s[0]); + fl_print_format(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", file.stream, f_string_eol_s[0]); + fl_print_format(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] selects a Content column.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" Specify both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object, context.set.notable); - fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Specify both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object, context.set.notable); + fl_print_format(" and the %[%s%s%] parameters to get the total objects.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_total, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When both %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable); - fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable); - fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable); - fl_print_format(" %[%s%s%] parameter value.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When both %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable); + fl_print_format(" and %[%s%s%] parameters are specified (at the same depth),", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable); + fl_print_format(" the %[%s%s%] parameter value will be treated as a position relative to the specified", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_at, context.set.notable); + fl_print_format(" %[%s%s%] parameter value.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_name, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program may support parameters, such as %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable); - fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This is done to help ensure consistency for scripting.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program may support parameters, such as %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable); + fl_print_format(" or %[%s%s%], even if not supported by the standard.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This is done to help ensure consistency for scripting.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable); - fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", output.stream, f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_depth, context.set.notable); + fl_print_format(" if the standard doesn't support nested Content, then only a depth of 0 would be valid.%c", file.stream, f_string_eol_s[0]); - fl_print_format(" For parameters like %[%s%s%],", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable); - fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" For parameters like %[%s%s%],", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable); + fl_print_format(" if the standard doesn't support multiple Content groups, then only a select of 0 would be valid.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_trim, context.set.notable); - fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_trim, context.set.notable); + fl_print_format(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying both the %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object, context.set.notable); - fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_content, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content printed are already escaped.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Both the Object and Content are separated by a space.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying both the %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_object, context.set.notable); + fl_print_format(" parameter and the %[%s%s%] parameter, the entire Object and Content are printed, including the formatting.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_content, context.set.notable, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content printed are already escaped.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Both the Object and Content are separated by a space.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameter %[%s%s%] accepts the following:%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Do not apply delimits.%c", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameter %[%s%s%] accepts the following:%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Do not apply delimits.%c", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: (default) Apply all delimits.%c", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - %[%s%]: Apply delimits for Objects.%c", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_object, context.set.notable, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater: apply delimits for Content at the specified depth.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" - A number, 0 or greater, followed by a %[%s%]: (such as '1+') apply delimits for Content at the specified depth and any greater depth (numerically).%c", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_greater, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" - A number, 0 or lesser, followed by a %[%s%]: (such as '1-') apply delimits for Content at the specified depth and any lesser depth (numerically).%c%c", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_lesser, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter may be specified multiple times to customize the delimit behavior.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable); - fl_print_format(" values %[%s%]", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable); - fl_print_format(" and %[%s%],", output.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable); - fl_print_format(" overrule all other delimit values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_delimit, context.set.notable); + fl_print_format(" values %[%s%]", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_none, context.set.notable); + fl_print_format(" and %[%s%],", file.stream, context.set.notable, fss_extended_read_delimit_mode_name_all, context.set.notable); + fl_print_format(" overrule all other delimit values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The parameters %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns, context.set.notable); - fl_print_format(" and %[%s%s%]", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable); - fl_print_format(" refer to a Content column.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This is not to be confused with a depth.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The parameters %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_columns, context.set.notable); + fl_print_format(" and %[%s%s%]", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_read_long_select, context.set.notable); + fl_print_format(" refer to a Content column.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" The word \"column\" is being loosely defined to refer to a specific Content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This is not to be confused with a depth.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -164,18 +164,22 @@ extern "C" { } if (choice == fss_extended_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_extended_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_extended_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_extended_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -185,14 +189,14 @@ extern "C" { } if (main->parameters[fss_extended_read_parameter_help].result == f_console_result_found) { - fss_extended_read_print_help(main->output, main->context); + fss_extended_read_print_help(main->output.to, main->context); fss_extended_read_main_delete(main); return status; } if (main->parameters[fss_extended_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_extended_read_version); + fll_program_print_version(main->output.to, fss_extended_read_version); fss_extended_read_main_delete(main); return status; diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index deb5132..cceca82 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -210,7 +210,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -222,8 +222,8 @@ extern "C" { fss_extended_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -232,7 +232,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -241,7 +241,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_read_print_help_ - extern f_status_t fss_extended_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_extended_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_extended_read_print_help_ /** diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index 9cd1107..312f0d6 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -287,30 +287,30 @@ extern "C" { return; } - flockfile(main->output.stream); + flockfile(main->output.to.stream); if ((data->option & fss_extended_read_data_option_object) || (data->option & fss_extended_read_data_option_content) && (data->contents.array[at].used || (data->option & fss_extended_read_data_option_empty))) { if (data->option & fss_extended_read_data_option_object) { if (data->option & fss_extended_read_data_option_trim) { if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } else { if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } @@ -327,13 +327,13 @@ extern "C" { content_printed = F_true; if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[data->select]) { - f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to.stream); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[data->select]) { - f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } } @@ -347,13 +347,13 @@ extern "C" { content_printed = F_true; if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } - f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.stream); + f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to.stream); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } if (i + 1 < data->contents.array[at].used && data->contents.array[at].array[i + 1].start <= data->contents.array[at].array[i + 1].stop) { @@ -367,7 +367,7 @@ extern "C" { fss_extended_read_print_set_end(main); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } #endif // _di_fss_extended_read_print_at_ @@ -377,33 +377,33 @@ extern "C" { if (data->option & fss_extended_read_data_option_select) { if (data->option & fss_extended_read_data_option_object) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_one(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } if (data->select < data->contents.array[at].used) { if (data->contents.array[at].array[data->select].start <= data->contents.array[at].array[data->select].stop || (data->option & fss_extended_read_data_option_empty)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_one(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } } } else if ((data->option & fss_extended_read_data_option_object) || (data->option & fss_extended_read_data_option_empty)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_one(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -411,11 +411,11 @@ extern "C" { for (f_array_length_t j = 0; j < data->contents.array[at].used; ++j) { if (data->contents.array[at].array[j].start <= data->contents.array[at].array[j].stop) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_one(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_success; } @@ -430,10 +430,10 @@ extern "C" { void fss_extended_read_print_content_end(fss_extended_read_main_t * const main) { if (main->parameters[fss_extended_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_read_pipe_content_start, main->output.stream); + f_print_character(fss_extended_read_pipe_content_start, main->output.to.stream); } else { - f_print_character(f_fss_space, main->output.stream); + f_print_character(f_fss_space, main->output.to.stream); } } #endif // _di_fss_extended_read_print_content_end_ @@ -442,18 +442,18 @@ extern "C" { void fss_extended_read_print_object_end(fss_extended_read_main_t * const main) { if (main->parameters[fss_extended_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_read_pipe_content_end, main->output.stream); + f_print_character(fss_extended_read_pipe_content_end, main->output.to.stream); } else { - f_print_character(f_fss_space, main->output.stream); + f_print_character(f_fss_space, main->output.to.stream); } } #endif // _di_fss_extended_read_print_object_end_ #ifndef _di_fss_extended_read_print_one_ void fss_extended_read_print_one(fss_extended_read_main_t * const main) { - f_print_character(f_string_ascii_1_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_1_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_extended_read_print_one_ @@ -461,18 +461,18 @@ extern "C" { void fss_extended_read_print_set_end(fss_extended_read_main_t * const main) { if (main->parameters[fss_extended_read_parameter_pipe].result == f_console_result_found) { - f_print_character(fss_extended_read_pipe_content_end, main->output.stream); + f_print_character(fss_extended_read_pipe_content_end, main->output.to.stream); } else { - f_print_character(f_fss_eol, main->output.stream); + f_print_character(f_fss_eol, main->output.to.stream); } } #endif // _di_fss_extended_read_print_set_end_ #ifndef _di_fss_extended_read_print_zero_ void fss_extended_read_print_zero(fss_extended_read_main_t * const main) { - f_print_character(f_string_ascii_0_s[0], main->output.stream); - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_ascii_0_s[0], main->output.to.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } #endif // _di_fss_extended_read_print_zero_ @@ -531,11 +531,11 @@ extern "C" { if (data->depths.array[0].value_at >= data->objects.used) { if (data->option & (fss_extended_read_data_option_columns | fss_extended_read_data_option_total)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -545,11 +545,11 @@ extern "C" { if (data->option & fss_extended_read_data_option_line) { if (data->line) { if (data->option & fss_extended_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -584,18 +584,18 @@ extern "C" { } else { if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } fss_extended_read_print_at(i, *delimits_object, *delimits_content, main, data); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_object.array[at]) { - f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } } else if (data->option & fss_extended_read_data_option_columns) { - fll_print_format("%ul%c", main->output.stream, data->contents.array[i].used, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, data->contents.array[i].used, f_string_eol_s[0]); } else if (data->option & fss_extended_read_data_option_total) { if (fss_extended_read_print_at_total(i, main, data) == F_none) { @@ -604,13 +604,13 @@ extern "C" { } else { if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } fss_extended_read_print_at(i, *delimits_object, *delimits_content, main, data); if ((data->option & fss_extended_read_data_option_raw) && data->quotes_content.array[at].array[i]) { - f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.stream); + f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single ? f_fss_quote_single_s[0] : f_fss_quote_double_s[0], main->output.to.stream); } } @@ -621,11 +621,11 @@ extern "C" { } // for if (data->option & fss_extended_read_data_option_total) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } return F_none; @@ -636,11 +636,11 @@ extern "C" { f_status_t fss_extended_read_process_columns(fss_extended_read_main_t * const main, fss_extended_read_data_t *data, bool names[]) { if (!(data->option & fss_extended_read_data_option_content)) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_zero(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } @@ -656,7 +656,7 @@ extern "C" { } } // for - fll_print_format("%ul%c", main->output.stream, max, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, max, f_string_eol_s[0]); return F_none; } @@ -684,11 +684,11 @@ extern "C" { if (!data->contents.array[i].used) { if (data->option & fss_extended_read_data_option_empty) { if (line == data->line) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); fss_extended_read_print_set_end(main); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); break; } @@ -859,7 +859,7 @@ extern "C" { } // for } - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (data->option & fss_extended_read_data_option_line) { if (data->line < total) { @@ -870,10 +870,10 @@ extern "C" { } } else { - fl_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fl_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); return F_none; } diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index e814243..ec97268 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -7,50 +7,50 @@ extern "C" { #endif #ifndef _di_fss_extended_write_print_help_ - f_status_t fss_extended_write_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_extended_write_name_long, fss_extended_write_version); + fll_program_print_help_header(file, context, fss_extended_write_name_long, fss_extended_write_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, fss_extended_write_short_content, fss_extended_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to output."); - fll_program_print_help_option(output, context, fss_extended_write_short_double, fss_extended_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, fss_extended_write_short_ignore, fss_extended_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); - fll_program_print_help_option(output, context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to output."); - fll_program_print_help_option(output, context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not output end of Object/Content character."); - fll_program_print_help_option(output, context, fss_extended_write_short_prepend, fss_extended_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); - fll_program_print_help_option(output, context, fss_extended_write_short_single, fss_extended_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_option(output, context, fss_extended_write_short_trim, fss_extended_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); + fll_program_print_help_option(file, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, fss_extended_write_short_content, fss_extended_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The Content to file."); + fll_program_print_help_option(file, context, fss_extended_write_short_double, fss_extended_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, fss_extended_write_short_ignore, fss_extended_write_long_ignore, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Ignore a given range within a Content."); + fll_program_print_help_option(file, context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The Object to file."); + fll_program_print_help_option(file, context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Do not file end of Object/Content character."); + fll_program_print_help_option(file, context, fss_extended_write_short_prepend, fss_extended_write_long_prepend, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Prepend the given whitespace characters to the start of each multi-line Content."); + fll_program_print_help_option(file, context, fss_extended_write_short_single, fss_extended_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, fss_extended_write_short_trim, fss_extended_write_long_trim, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Trim Object names."); - fll_program_print_help_usage(output, context, fss_extended_write_name, f_string_empty_s); + fll_program_print_help_usage(file, context, fss_extended_write_name, f_string_empty_s); - fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The pipe uses the Backspace character '%[\\b%]' (%[U+0008%]) to designate the start of a Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Form Feed character '%[\\f%]' (%[U+000C%]) to designate the end of the last Content.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The pipe uses the Vertical Line character '%[\\v%]' (%[U+000B%]) is used to ignore a Content range, which does nothing in this program.%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" For the pipe, an Object is terminated by either a Backspace character '%[\\b%]' (%[U+0008%])", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); + fl_print_format(" or a Form Feed character '%[\\f%]' (%[U+000C%]).%c", file.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" The end of the pipe represents the end of any Object or Content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '%[%s%s%]'", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend, context.set.notable); - fl_print_format(" does nothing.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '%[%s%s%]'", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_prepend, context.set.notable); + fl_print_format(" does nothing.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore, context.set.notable, f_string_eol_s[0]); - fl_print_format(" This parameter requires two values.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" This program does not use the parameter '%[%s%s%]', which therefore does nothing.%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_extended_write_long_ignore, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This parameter requires two values.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -102,18 +102,22 @@ extern "C" { } if (choice == fss_extended_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_extended_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_extended_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_extended_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -123,14 +127,14 @@ extern "C" { } if (main->parameters[fss_extended_write_parameter_help].result == f_console_result_found) { - fss_extended_write_print_help(main->output, main->context); + fss_extended_write_print_help(main->output.to, main->context); fss_extended_write_main_delete(main); return status; } if (main->parameters[fss_extended_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_extended_write_version); + fll_program_print_version(main->output.to, fss_extended_write_version); fss_extended_write_main_delete(main); return status; diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index df9c47d..b7b05e1 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -144,7 +144,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; f_string_static_t prepend; @@ -157,8 +157,8 @@ extern "C" { fss_extended_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_static_t_initialize, \ f_color_context_t_initialize, \ @@ -168,7 +168,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -177,7 +177,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_write_print_help_ - extern f_status_t fss_extended_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_extended_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_extended_write_print_help_ /** diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index 07182b6..dd4602b 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -7,51 +7,51 @@ extern "C" { #endif #ifndef _di_fss_identify_print_help_ - f_status_t fss_identify_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_identify_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_identify_name_long, fss_identify_version); + fll_program_print_help_header(file, context, fss_identify_name_long, fss_identify_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_identify_short_content, fss_identify_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the Identifier content (the 4-digit hexidecimal type code)."); - fll_program_print_help_option(output, context, fss_identify_short_object, fss_identify_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Identifier object (the name)."); + fll_program_print_help_option(file, context, fss_identify_short_content, fss_identify_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the Identifier content (the 4-digit hexidecimal type code)."); + fll_program_print_help_option(file, context, fss_identify_short_object, fss_identify_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the Identifier object (the name)."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_identify_short_line, fss_identify_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Identifier at the given line."); - fll_program_print_help_option(output, context, fss_identify_short_name, fss_identify_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); - fll_program_print_help_option(output, context, fss_identify_short_total, fss_identify_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the total Identifiers found."); + fll_program_print_help_option(file, context, fss_identify_short_line, fss_identify_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the Identifier at the given line."); + fll_program_print_help_option(file, context, fss_identify_short_name, fss_identify_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select Object with this name."); + fll_program_print_help_option(file, context, fss_identify_short_total, fss_identify_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the total Identifiers found."); - fll_program_print_help_usage(output, context, fss_identify_name, "filename(s)"); + fll_program_print_help_usage(file, context, fss_identify_name, "filename(s)"); - fl_print_format(" The %[%s%s%] parameter refers to the output lines and not the lines in a given file.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The %[%s%s%] parameter refers to the file lines and not the lines in a given file.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_line, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" If neither the %[%s%s%] nor", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable); - fl_print_format(" %[%s%s%] are specified, then the default behavior is to print both.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" If neither the %[%s%s%] nor", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable); + fl_print_format(" %[%s%s%] are specified, then the default behavior is to print both.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When specifying the %[%s%s%] parameter, neither the", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_total, context.set.notable); - fl_print_format(" %[%s%s%] nor the", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable); - fl_print_format(" %[%s%s%] parameter may be specified.%c%c", output.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When specifying the %[%s%s%] parameter, neither the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_total, context.set.notable); + fl_print_format(" %[%s%s%] nor the", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_object, context.set.notable); + fl_print_format(" %[%s%s%] parameter may be specified.%c%c", file.stream, context.set.notable, f_console_symbol_long_enable_s, fss_identify_long_content, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" An FSS file is identified by the following format: '%[# Object-Content%]'", output.stream, context.set.notable, context.set.notable); - fl_print_format(" where the Object, is a machine-name representing the name and may only consist of \"word\" characters and the Content is a 4-digit hexidecimal number representing a particular variant of the Object.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" This identifier, if provided, must exist on the first line in a file and must begin with the pound character: '#'.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Whitespace must follow this pound character.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" There may be multiple Object and Content pairs, separated by whitspace, such as: \"# fss-0002 fss-0000 iki-0002\".%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" An FSS file is identified by the following format: '%[# Object-Content%]'", file.stream, context.set.notable, context.set.notable); + fl_print_format(" where the Object, is a machine-name representing the name and may only consist of \"word\" characters and the Content is a 4-digit hexidecimal number representing a particular variant of the Object.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" This identifier, if provided, must exist on the first line in a file and must begin with the pound character: '#'.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Whitespace must follow this pound character.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" There may be multiple Object and Content pairs, separated by whitspace, such as: \"# fss-0002 fss-0000 iki-0002\".%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -110,18 +110,22 @@ extern "C" { } if (choice == fss_identify_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_identify_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_identify_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_identify_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -131,7 +135,7 @@ extern "C" { } if (main->parameters[fss_identify_parameter_help].result == f_console_result_found) { - fss_identify_print_help(main->output, main->context); + fss_identify_print_help(main->output.to, main->context); fss_identify_main_delete(main); @@ -139,7 +143,7 @@ extern "C" { } if (main->parameters[fss_identify_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_identify_version); + fll_program_print_version(main->output.to, fss_identify_version); fss_identify_main_delete(main); @@ -321,7 +325,7 @@ extern "C" { if (F_status_is_error_not(status)) { if (main->parameters[fss_identify_parameter_total].result == f_console_result_found) { - fll_print_format("%ul%c", main->output.stream, data.total, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, data.total, f_string_eol_s[0]); } } diff --git a/level_3/fss_identify/c/fss_identify.h b/level_3/fss_identify/c/fss_identify.h index ecf227e..a2ebd67 100644 --- a/level_3/fss_identify/c/fss_identify.h +++ b/level_3/fss_identify/c/fss_identify.h @@ -128,7 +128,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -140,8 +140,8 @@ extern "C" { fss_identify_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -150,7 +150,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -159,7 +159,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_identify_print_help_ - extern f_status_t fss_identify_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_identify_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_identify_print_help_ /** diff --git a/level_3/fss_identify/c/private-fss_identify.c b/level_3/fss_identify/c/private-fss_identify.c index cc6e19f..8214dd0 100644 --- a/level_3/fss_identify/c/private-fss_identify.c +++ b/level_3/fss_identify/c/private-fss_identify.c @@ -55,23 +55,23 @@ extern "C" { #ifndef _di_fss_identify_print_ void fss_identify_print(const fss_identify_main_t main, f_fll_id_t id) { - flockfile(main.output.stream); + flockfile(main.output.to.stream); if (main.parameters[fss_identify_parameter_object].result == f_console_result_found || main.parameters[fss_identify_parameter_content].result != f_console_result_found) { - f_print(id.name, id.used, main.output.stream); + f_print(id.name, id.used, main.output.to.stream); if (main.parameters[fss_identify_parameter_object].result != f_console_result_found || main.parameters[fss_identify_parameter_content].result == f_console_result_found) { - f_print_character(f_fss_type_header_part5, main.output.stream); + f_print_character(f_fss_type_header_part5, main.output.to.stream); } } if (main.parameters[fss_identify_parameter_object].result != f_console_result_found || main.parameters[fss_identify_parameter_content].result == f_console_result_found) { - fl_print_format("%04_ui", main.output.stream, id.type); + fl_print_format("%04_ui", main.output.to.stream, id.type); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); - funlockfile(main.output.stream); + funlockfile(main.output.to.stream); } #endif // _di_fss_identify_print_ diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index 7f588f2..c6df46a 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -7,32 +7,32 @@ extern "C" { #endif #ifndef _di_fss_status_code_print_help_ - f_status_t fss_status_code_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t fss_status_code_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, fss_status_code_name_long, fss_status_code_version); + fll_program_print_help_header(file, context, fss_status_code_name_long, fss_status_code_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise."); - fll_program_print_help_option(output, context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise."); - fll_program_print_help_option(output, context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise."); - fll_program_print_help_option(output, context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number."); + fll_program_print_help_option(file, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise."); + fll_program_print_help_option(file, context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise."); + fll_program_print_help_option(file, context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise."); + fll_program_print_help_option(file, context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number."); - fll_program_print_help_usage(output, context, fss_status_code_name, "status code(s)"); + fll_program_print_help_usage(file, context, fss_status_code_name, "status code(s)"); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -84,18 +84,22 @@ extern "C" { } if (choice == fss_status_code_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == fss_status_code_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == fss_status_code_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == fss_status_code_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -105,14 +109,14 @@ extern "C" { } if (main->parameters[fss_status_code_parameter_help].result == f_console_result_found) { - fss_status_code_print_help(main->output, main->context); + fss_status_code_print_help(main->output.to, main->context); fss_status_code_main_delete(main); return F_none; } if (main->parameters[fss_status_code_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, fss_status_code_version); + fll_program_print_version(main->output.to, fss_status_code_version); fss_status_code_main_delete(main); return F_none; @@ -178,7 +182,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { @@ -189,7 +193,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else if (main->parameters[fss_status_code_parameter_number].result == f_console_result_found) { @@ -198,7 +202,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { @@ -209,7 +213,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else { @@ -218,7 +222,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = fss_status_code_process_normal(*main, arguments.argv[main->remaining.array[i]]); @@ -228,7 +232,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index abe0f6f..fba93ca 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -121,7 +121,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -133,8 +133,8 @@ extern "C" { fss_status_code_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -143,7 +143,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -152,7 +152,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_status_code_print_help_ - extern f_status_t fss_status_code_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t fss_status_code_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_fss_status_code_print_help_ /** diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index 4f94074..9eef232 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.c +++ b/level_3/fss_status_code/c/private-fss_status_code.c @@ -16,33 +16,33 @@ extern "C" { if (main.parameters[fss_status_code_parameter_is_error].result == f_console_result_found) { if (F_status_is_error(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } else if (main.parameters[fss_status_code_parameter_is_warning].result == f_console_result_found) { if (F_status_is_warning(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } else if (main.parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { if (F_status_is_fine(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } return F_none; @@ -62,13 +62,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(value, range, &number); if (status == F_none) { - fl_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid name%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid main%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return status; } @@ -85,10 +85,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown name%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[failed to convert%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; @@ -96,12 +96,12 @@ extern "C" { } if (status == F_data) { - fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown code%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return F_none; } - fl_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]); + fl_print_format("%ui%c", main.output.to.stream, code, f_string_eol_s[0]); return F_none; } @@ -122,16 +122,16 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown code%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[failed to convert%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; } - fl_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]); + fl_print_format("%S%c", main.output.to.stream, string, f_string_eol_s[0]); return F_none; } @@ -145,17 +145,17 @@ extern "C" { f_status_t status = fl_conversion_string_to_number_unsigned(value, range, number); if (*number > F_status_size_max_with_signal) { - fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[out of range%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[out of range%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid number%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 775b7e8..92ac33a 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -7,59 +7,59 @@ extern "C" { #endif #ifndef _di_iki_read_print_help_ - f_status_t iki_read_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t iki_read_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, iki_read_name_long, iki_read_version); + fll_program_print_help_header(file, context, iki_read_name_long, iki_read_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variable at this numeric index."); - fll_program_print_help_option(output, context, iki_read_short_line, iki_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the variables at the given line within the file."); - fll_program_print_help_option(output, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variables with this name."); - fll_program_print_help_option(output, context, iki_read_short_whole, iki_read_long_whole, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print all of the data instead of just the IKI variable data."); + fll_program_print_help_option(file, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variable at this numeric index."); + fll_program_print_help_option(file, context, iki_read_short_line, iki_read_long_line, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print only the variables at the given line within the file."); + fll_program_print_help_option(file, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Select variables with this name."); + fll_program_print_help_option(file, context, iki_read_short_whole, iki_read_long_whole, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print all of the data instead of just the IKI variable data."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the variable content (default)."); - fll_program_print_help_option(output, context, iki_read_short_literal, iki_read_long_literal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the entire variable (aka: object, content, and syntax)."); - fll_program_print_help_option(output, context, iki_read_short_object, iki_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the variable name (aka: object)."); - fll_program_print_help_option(output, context, iki_read_short_total, iki_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of variables."); + fll_program_print_help_option(file, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the variable content (default)."); + fll_program_print_help_option(file, context, iki_read_short_literal, iki_read_long_literal, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print the entire variable (aka: object, content, and syntax)."); + fll_program_print_help_option(file, context, iki_read_short_object, iki_read_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the variable name (aka: object)."); + fll_program_print_help_option(file, context, iki_read_short_total, iki_read_long_total, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print the total number of variables."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Substitute the entire variable for the given name and content value with the given string."); + fll_program_print_help_option(file, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Substitute the entire variable for the given name and content value with the given string."); - fll_program_print_help_usage(output, context, iki_read_name, "filename(s)"); + fll_program_print_help_usage(file, context, iki_read_name, "filename(s)"); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will find and print variables, vocabularies, or content following the IKI standard, without focusing on any particular vocabulary specification.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" This program will find and print variables, vocabularies, or content following the IKI standard, without focusing on any particular vocabulary specification.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" This %[%s%s%] option, requires 3 additional parameters:", output.stream, context.set.notable, f_console_symbol_long_enable_s, iki_read_long_substitute, context.set.notable); - fl_print_format(" %[<%]%s%[>%]", output.stream, context.set.notable, context.set.notable, iki_read_substitution_vocabulary, context.set.notable, context.set.notable); - fl_print_format(" %[<%]%s%[>%]", output.stream, context.set.notable, context.set.notable, iki_read_substitution_replace, context.set.notable, context.set.notable); - fl_print_format(" %[<%]%s%[>%].%c", output.stream, context.set.notable, context.set.notable, iki_read_substitution_with, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" This %[%s%s%] option, requires 3 additional parameters:", file.stream, context.set.notable, f_console_symbol_long_enable_s, iki_read_long_substitute, context.set.notable); + fl_print_format(" %[<%]%s%[>%]", file.stream, context.set.notable, context.set.notable, iki_read_substitution_vocabulary, context.set.notable, context.set.notable); + fl_print_format(" %[<%]%s%[>%]", file.stream, context.set.notable, context.set.notable, iki_read_substitution_replace, context.set.notable, context.set.notable); + fl_print_format(" %[<%]%s%[>%].%c", file.stream, context.set.notable, context.set.notable, iki_read_substitution_with, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%]: The name of the vocabulary whose content is to be substituted.%c", output.stream, context.set.notable, iki_read_substitution_vocabulary, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%]: The content matching this exact string will be substituted.%c", output.stream, context.set.notable, iki_read_substitution_replace, context.set.notable, f_string_eol_s[0]); - fl_print_format(" %[%s%]: The new string to use as the substitute.%c%c", output.stream, context.set.notable, iki_read_substitution_with, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" %[%s%]: The name of the vocabulary whose content is to be substituted.%c", file.stream, context.set.notable, iki_read_substitution_vocabulary, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%]: The content matching this exact string will be substituted.%c", file.stream, context.set.notable, iki_read_substitution_replace, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[%s%]: The new string to use as the substitute.%c%c", file.stream, context.set.notable, iki_read_substitution_with, context.set.notable, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The vocabulary and replacement are case-sensitive and must exactly match.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The vocabulary and replacement are case-sensitive and must exactly match.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" The default behavior is to only display content portion of the IKI variable.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" The default behavior is to only display content portion of the IKI variable.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -119,18 +119,22 @@ extern "C" { } if (choice == iki_read_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == iki_read_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == iki_read_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == iki_read_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -140,14 +144,14 @@ extern "C" { } if (main->parameters[iki_read_parameter_help].result == f_console_result_found) { - iki_read_print_help(main->output, main->context); + iki_read_print_help(main->output.to, main->context); iki_read_main_delete(main); return F_none; } if (main->parameters[iki_read_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, iki_read_version); + fll_program_print_version(main->output.to, iki_read_version); iki_read_main_delete(main); return F_none; diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index 8530a85..073bc8c 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -198,7 +198,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -219,8 +219,8 @@ extern "C" { iki_read_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ 0, \ 0, \ @@ -234,7 +234,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -243,7 +243,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_read_print_help_ - extern f_status_t iki_read_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t iki_read_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_iki_read_print_help_ /** diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 2c8925e..a717c91 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -171,7 +171,7 @@ extern "C" { buffer_range->stop = name.used - 1; - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (j = 0; j < vocabulary->used; ++j) { @@ -188,14 +188,14 @@ extern "C" { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.stream); + f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.to.stream); } - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } // for macro_f_string_dynamic_t_delete_simple(name); @@ -206,18 +206,18 @@ extern "C" { else if (ranges->used) { if (main->parameters[iki_read_parameter_at].result == f_console_result_additional) { if (main->at < ranges->used) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); if (substitutionss[main->at].used) { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[main->at], main->at, content_only); } else { - f_print_dynamic_partial(main->buffer, ranges->array[main->at], main->output.stream); + f_print_dynamic_partial(main->buffer, ranges->array[main->at], main->output.to.stream); } - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); status = F_none; } @@ -226,7 +226,7 @@ extern "C" { } } else { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < ranges->used; ++i) { @@ -234,13 +234,13 @@ extern "C" { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[i], i, content_only); } else { - f_print_dynamic_partial(main->buffer, ranges->array[i], main->output.stream); + f_print_dynamic_partial(main->buffer, ranges->array[i], main->output.to.stream); } - f_print_character(f_string_eol_s[0], main->output.stream); + f_print_character(f_string_eol_s[0], main->output.to.stream); } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); status = F_none; } @@ -276,7 +276,7 @@ extern "C" { } if (!variable->used) { - fll_print_dynamic_partial(main->buffer, buffer_range, main->output.stream); + fll_print_dynamic_partial(main->buffer, buffer_range, main->output.to.stream); return F_none; } @@ -367,7 +367,7 @@ extern "C" { range = buffer_range; name_range.start = 0; - flockfile(main->output.stream); + flockfile(main->output.to.stream); while (i <= range.stop && j < stop) { @@ -375,7 +375,7 @@ extern "C" { range.start = i; range.stop = variable->array[j].start - 1; - f_print_dynamic_partial(main->buffer, range, main->output.stream); + f_print_dynamic_partial(main->buffer, range, main->output.to.stream); range.start = variable->array[j].stop + 1; range.stop = buffer_range.stop; @@ -402,7 +402,7 @@ extern "C" { iki_read_substitutions_print(*main, *variable, *content, *variable, substitutionss[j], j, F_false); } else { - f_print_dynamic_partial(main->buffer, variable->array[j], main->output.stream); + f_print_dynamic_partial(main->buffer, variable->array[j], main->output.to.stream); } } else { @@ -410,7 +410,7 @@ extern "C" { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.stream); + f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.to.stream); } } } @@ -419,7 +419,7 @@ extern "C" { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.stream); + f_print_dynamic_partial(main->buffer, ranges->array[j], main->output.to.stream); } } @@ -429,10 +429,10 @@ extern "C" { if (i <= buffer_range.stop) { range.start = i; - f_print_dynamic_partial(main->buffer, range, main->output.stream); + f_print_dynamic_partial(main->buffer, range, main->output.to.stream); } - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } for (f_array_length_t i = 0; i < variable->used; ++i) { @@ -454,13 +454,13 @@ extern "C" { if (status == F_true) { if (range.start > main->buffer.used) { - fll_print_format("0%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("0%c", main->output.to.stream, f_string_eol_s[0]); return F_none; } } else if (status == F_data_not) { - fll_print_format("0%c", main->output.stream, f_string_eol_s[0]); + fll_print_format("0%c", main->output.to.stream, f_string_eol_s[0]); return F_none; } @@ -528,7 +528,7 @@ extern "C" { } } - fll_print_format("%ul%c", main->output.stream, total, f_string_eol_s[0]); + fll_print_format("%ul%c", main->output.to.stream, total, f_string_eol_s[0]); return F_none; } @@ -605,24 +605,24 @@ extern "C" { if (status == F_equal_to) { if (content_only) { - f_print_dynamic(substitutions.array[i].with, main.output.stream); + f_print_dynamic(substitutions.array[i].with, main.output.to.stream); } else { range.start = variable.array[index].start; range.stop = content.array[index].start - 1; - f_print_dynamic_partial(main.buffer, range, main.output.stream); + f_print_dynamic_partial(main.buffer, range, main.output.to.stream); - f_print_dynamic(substitutions.array[i].with, main.output.stream); + f_print_dynamic(substitutions.array[i].with, main.output.to.stream); range.start = content.array[index].stop + 1; range.stop = variable.array[index].stop; - f_print_dynamic_partial(main.buffer, range, main.output.stream); + f_print_dynamic_partial(main.buffer, range, main.output.to.stream); } } else { - f_print_dynamic_partial(main.buffer, ranges.array[index], main.output.stream); + f_print_dynamic_partial(main.buffer, ranges.array[index], main.output.to.stream); } } #endif // _di_iki_read_substitutions_print_ diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 9145961..207f87d 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -7,41 +7,41 @@ extern "C" { #endif #ifndef _di_iki_write_print_help_ - f_status_t iki_write_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t iki_write_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, iki_write_name_long, iki_write_version); + fll_program_print_help_header(file, context, iki_write_name_long, iki_write_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send output to."); - fll_program_print_help_option(output, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The content to output."); - fll_program_print_help_option(output, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); - fll_program_print_help_option(output, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The object to output."); - fll_program_print_help_option(output, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); + fll_program_print_help_option(file, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Specify a file to send file to."); + fll_program_print_help_option(file, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "The content to file."); + fll_program_print_help_option(file, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use double quotes (default)."); + fll_program_print_help_option(file, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " The object to file."); + fll_program_print_help_option(file, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Use single quotes."); - fll_program_print_help_usage(output, context, iki_write_name, f_string_empty_s); + fll_program_print_help_usage(file, context, iki_write_name, f_string_empty_s); - fl_print_format(" %[Notes:%]%c", output.stream, context.set.important, context.set.important, f_string_eol_s[0]); - fl_print_format(" This program will accept object and content strings to generate an IKI string, such as %[object:\"content\"%].%c", output.stream, context.set.notable, context.set.notable, f_string_eol_s[0]); + fl_print_format(" %[Notes:%]%c", file.stream, context.set.important, context.set.important, f_string_eol_s[0]); + fl_print_format(" This program will accept object and content strings to generate an IKI string, such as %[object:\"content\"%].%c", file.stream, context.set.notable, context.set.notable, f_string_eol_s[0]); - fl_print_format(" Each object must have a content (and each content must have an object).%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" Each object must have a content (and each content must have an object).%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - fl_print_format(" When piping main to this program, a single end of line (\\n) must be used to separate each object from each content.%c", output.stream, f_string_eol_s[0]); - fl_print_format(" Furthermore, each object must be followed by a content.%c%c", output.stream, f_string_eol_s[0], f_string_eol_s[0]); + fl_print_format(" When piping main to this program, a single end of line (\\n) must be used to separate each object from each content.%c", file.stream, f_string_eol_s[0]); + fl_print_format(" Furthermore, each object must be followed by a content.%c%c", file.stream, f_string_eol_s[0], f_string_eol_s[0]); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -100,18 +100,22 @@ extern "C" { } if (choice == iki_write_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == iki_write_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == iki_write_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == iki_write_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -121,24 +125,24 @@ extern "C" { } if (main->parameters[iki_write_parameter_help].result == f_console_result_found) { - iki_write_print_help(main->output, main->context); + iki_write_print_help(main->output.to, main->context); iki_write_main_delete(main); return F_none; } if (main->parameters[iki_write_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, iki_write_version); + fll_program_print_version(main->output.to, iki_write_version); iki_write_main_delete(main); return F_none; } - f_file_t output = f_file_t_initialize; + f_file_t file = f_file_t_initialize; - output.id = f_type_descriptor_output; - output.stream = f_type_output; - output.flag = f_file_flag_create | f_file_flag_write_only | f_file_flag_append; + file.id = f_type_descriptor_output; + file.stream = f_type_output; + file.flag = f_file_flag_create | f_file_flag_write_only | f_file_flag_append; if (F_status_is_error_not(status)) { if (main->parameters[iki_write_parameter_file].result == f_console_result_additional) { @@ -158,10 +162,10 @@ extern "C" { else { const f_array_length_t location = main->parameters[iki_write_parameter_file].values.array[0]; - output.id = -1; - output.stream = 0; + file.id = -1; + file.stream = 0; - status = f_file_stream_open(arguments.argv[location], 0, &output); + status = f_file_stream_open(arguments.argv[location], 0, &file); if (F_status_is_error(status)) { fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_open", F_true, arguments.argv[location], "open", fll_error_file_type_file); @@ -345,10 +349,10 @@ extern "C" { } } - status = iki_write_process(*main, output, object, content, quote, &escaped); + status = iki_write_process(*main, file, object, content, quote, &escaped); if (F_status_is_error(status)) break; - fll_print_character(f_string_eol_s[0], output.stream); + fll_print_character(f_string_eol_s[0], file.stream); object_ended = F_false; } @@ -405,15 +409,15 @@ extern "C" { content.used = strnlen(content.string, f_console_parameter_size); content.size = content.used; - status = iki_write_process(*main, output, object, content, quote, &escaped); + status = iki_write_process(*main, file, object, content, quote, &escaped); if (F_status_is_error(status)) break; - fll_print_character(f_string_eol_s[0], output.stream); + fll_print_character(f_string_eol_s[0], file.stream); } // for // ensure there is always a newline at the end, unless in quiet mode. if (F_status_is_error_not(status) && main->error.verbosity != f_console_verbosity_quiet && main->parameters[iki_write_parameter_file].result == f_console_result_none) { - fll_print_character(f_string_eol_s[0], output.stream); + fll_print_character(f_string_eol_s[0], file.stream); } } @@ -421,8 +425,8 @@ extern "C" { } if (main->parameters[iki_write_parameter_file].result == f_console_result_additional) { - if (output.id != -1) { - f_file_stream_close(F_true, &output); + if (file.id != -1) { + f_file_stream_close(F_true, &file); } } diff --git a/level_3/iki_write/c/iki_write.h b/level_3/iki_write/c/iki_write.h index a89ba7b..e85ba22 100644 --- a/level_3/iki_write/c/iki_write.h +++ b/level_3/iki_write/c/iki_write.h @@ -133,7 +133,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -147,8 +147,8 @@ extern "C" { iki_write_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_string_dynamic_t_initialize, \ f_color_context_t_initialize, \ @@ -158,7 +158,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -167,7 +167,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_write_print_help_ - extern f_status_t iki_write_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t iki_write_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_iki_write_print_help_ /** diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index 3bf8850..67c224f 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -18,33 +18,33 @@ extern "C" { if (main.parameters[status_code_parameter_is_error].result == f_console_result_found) { if (F_status_is_error(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } else if (main.parameters[status_code_parameter_is_warning].result == f_console_result_found) { if (F_status_is_warning(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } else if (main.parameters[status_code_parameter_is_fine].result == f_console_result_found) { if (F_status_is_fine(number)) { - f_print_terminated(FL_status_string_true, main.output.stream); + f_print_terminated(FL_status_string_true, main.output.to.stream); } else { - f_print_terminated(FL_status_string_false, main.output.stream); + f_print_terminated(FL_status_string_false, main.output.to.stream); } - f_print_character(f_string_eol_s[0], main.output.stream); + f_print_character(f_string_eol_s[0], main.output.to.stream); } return F_none; @@ -64,13 +64,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(value, range, &number); if (status == F_none) { - fl_print_format("%[invalid name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid name%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_print_format("%[invalid main%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid main%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return status; } @@ -82,22 +82,22 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_print_format("%[unknown name%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown name%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[failed to convert%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; } if (status == F_data) { - fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown code%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return F_none; } - fl_print_format("%ui%c", main.output.stream, code, f_string_eol_s[0]); + fl_print_format("%ui%c", main.output.to.stream, code, f_string_eol_s[0]); return F_none; } @@ -120,16 +120,16 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_print_format("%[unknown code%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[unknown code%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[failed to convert%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[failed to convert%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; } - fl_print_format("%S%c", main.output.stream, string, f_string_eol_s[0]); + fl_print_format("%S%c", main.output.to.stream, string, f_string_eol_s[0]); return F_none; } @@ -143,17 +143,17 @@ extern "C" { f_status_t status = fl_conversion_string_to_number_unsigned(value, range, number); if (*number > F_status_size_max_with_signal) { - fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[out of range%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_print_format("%[out of range%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[out of range%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } else { - fl_print_format("%[invalid number%]%c", main.output.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); + fl_print_format("%[invalid number%]%c", main.output.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0]); } return status; diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 47c7643..3f5a1d2 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -7,32 +7,32 @@ extern "C" { #endif #ifndef _di_status_code_print_help_ - f_status_t status_code_print_help(const f_file_t output, const f_color_context_t context) { + f_status_t status_code_print_help(const f_file_t file, const f_color_context_t context) { - flockfile(output.stream); + flockfile(file.stream); - fll_program_print_help_header(output, context, status_code_name_long, status_code_version); + fll_program_print_help_header(file, context, status_code_name_long, status_code_version); - fll_program_print_help_option(output, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); - fll_program_print_help_option(output, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(output, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not output in color."); - fll_program_print_help_option(output, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(output, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); + fll_program_print_help_option(file, context, f_console_standard_short_help_s, f_console_standard_long_help_s, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print this help message."); + fll_program_print_help_option(file, context, f_console_standard_short_dark_s, f_console_standard_long_dark_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_light_s, f_console_standard_long_light_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(file, context, f_console_standard_short_no_color_s, f_console_standard_long_no_color_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, "Do not file in color."); + fll_program_print_help_option(file, context, f_console_standard_short_quiet_s, f_console_standard_long_quiet_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Decrease verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_normal_s, f_console_standard_long_normal_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Set verbosity to normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_verbose_s, f_console_standard_long_verbose_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Increase verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_debug_s, f_console_standard_long_debug_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Enable debugging, inceasing verbosity beyond normal file."); + fll_program_print_help_option(file, context, f_console_standard_short_version_s, f_console_standard_long_version_s, f_console_symbol_short_disable_s, f_console_symbol_long_disable_s, " Print only the version number."); - f_print_character(f_string_eol_s[0], output.stream); + f_print_character(f_string_eol_s[0], file.stream); - fll_program_print_help_option(output, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise."); - fll_program_print_help_option(output, context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise."); - fll_program_print_help_option(output, context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise."); - fll_program_print_help_option(output, context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number."); + fll_program_print_help_option(file, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is not an error, F_false otherwise."); + fll_program_print_help_option(file, context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, "Print F_true if the error code is a warning, F_false otherwise."); + fll_program_print_help_option(file, context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Print F_true if the error code is an error, F_false otherwise."); + fll_program_print_help_option(file, context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable_s, f_console_symbol_long_enable_s, " Convert status code name to number."); - fll_program_print_help_usage(output, context, status_code_name, "status code(s)"); + fll_program_print_help_usage(file, context, status_code_name, "status code(s)"); - funlockfile(output.stream); + funlockfile(file.stream); return F_none; } @@ -84,18 +84,22 @@ extern "C" { } if (choice == status_code_parameter_verbosity_quiet) { + main->output.verbosity = f_console_verbosity_quiet; main->error.verbosity = f_console_verbosity_quiet; main->warning.verbosity = f_console_verbosity_quiet; } else if (choice == status_code_parameter_verbosity_normal) { + main->output.verbosity = f_console_verbosity_normal; main->error.verbosity = f_console_verbosity_normal; main->warning.verbosity = f_console_verbosity_normal; } else if (choice == status_code_parameter_verbosity_verbose) { + main->output.verbosity = f_console_verbosity_verbose; main->error.verbosity = f_console_verbosity_verbose; main->warning.verbosity = f_console_verbosity_verbose; } else if (choice == status_code_parameter_verbosity_debug) { + main->output.verbosity = f_console_verbosity_debug; main->error.verbosity = f_console_verbosity_debug; main->warning.verbosity = f_console_verbosity_debug; } @@ -105,14 +109,14 @@ extern "C" { } if (main->parameters[status_code_parameter_help].result == f_console_result_found) { - status_code_print_help(main->output, main->context); + status_code_print_help(main->output.to, main->context); status_code_main_delete(main); return F_none; } if (main->parameters[status_code_parameter_version].result == f_console_result_found) { - fll_program_print_version(main->output, status_code_version); + fll_program_print_version(main->output.to, status_code_version); status_code_main_delete(main); return F_none; @@ -178,7 +182,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { @@ -189,7 +193,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else if (main->parameters[status_code_parameter_number].result == f_console_result_found) { @@ -198,7 +202,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { @@ -209,7 +213,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } else { @@ -218,7 +222,7 @@ extern "C" { } if (main->remaining.used > 0) { - flockfile(main->output.stream); + flockfile(main->output.to.stream); for (f_array_length_t i = 0; i < main->remaining.used; ++i) { @@ -229,7 +233,7 @@ extern "C" { } } // for - funlockfile(main->output.stream); + funlockfile(main->output.to.stream); } } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index 04ddc42..27224be 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -120,7 +120,7 @@ extern "C" { f_array_lengths_t remaining; bool process_pipe; - f_file_t output; + fl_print_t output; fl_print_t error; fl_print_t warning; @@ -132,8 +132,8 @@ extern "C" { status_code_console_parameter_t_initialize, \ f_array_lengths_t_initialize, \ F_false, \ - macro_f_file_t_initialize2(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \ fl_print_t_initialize, \ + macro_fl_print_t_initialize_error(), \ macro_fl_print_t_initialize_warning(), \ f_color_context_t_initialize, \ } @@ -142,7 +142,7 @@ extern "C" { /** * Print help. * - * @param output + * @param file * The file to print to. * @param context * The color context settings. @@ -151,7 +151,7 @@ extern "C" { * F_none on success. */ #ifndef _di_status_code_print_help_ - extern f_status_t status_code_print_help(const f_file_t output, const f_color_context_t context); + extern f_status_t status_code_print_help(const f_file_t file, const f_color_context_t context); #endif // _di_status_code_print_help_ /** -- 1.8.3.1