From 3b06fdf329c137ff12a4bff82843b2c229e8a513 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 22 Oct 2020 20:28:41 -0500 Subject: [PATCH] Bugfix: consistently use the data.output file for standard output printing. There are still places that need to be converted from f_type_output and printf() to use this data.output file. With this change, the data.output will be used and can more readily be updated to point to some file other than standard output. The fss_*_read programs are not updated with this commit due to having additional changes. These changes will also be applied to those programs in another commit. --- level_3/byte_dump/c/byte_dump.c | 88 +++++------ level_3/byte_dump/c/byte_dump.h | 4 +- level_3/fake/c/fake.c | 164 ++++++++++----------- level_3/fake/c/fake.h | 5 +- level_3/fake/c/private-build.c | 8 +- level_3/fake/c/private-make.c | 8 +- level_3/firewall/c/firewall.c | 94 ++++++------ level_3/firewall/c/firewall.h | 4 +- level_3/firewall/c/private-firewall.c | 6 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 152 +++++++++---------- .../fss_basic_list_write/c/fss_basic_list_write.h | 4 +- level_3/fss_basic_write/c/fss_basic_write.c | 146 +++++++++--------- level_3/fss_basic_write/c/fss_basic_write.h | 4 +- .../c/fss_extended_list_write.c | 162 ++++++++++---------- .../c/fss_extended_list_write.h | 4 +- level_3/fss_extended_write/c/fss_extended_write.c | 146 +++++++++--------- level_3/fss_extended_write/c/fss_extended_write.h | 4 +- level_3/fss_status_code/c/fss_status_code.c | 34 ++--- level_3/fss_status_code/c/fss_status_code.h | 4 +- .../fss_status_code/c/private-fss_status_code.c | 20 +-- level_3/iki_read/c/iki_read.c | 108 +++++++------- level_3/iki_read/c/iki_read.h | 4 +- level_3/iki_read/c/private-iki_read.c | 26 ++-- level_3/iki_write/c/iki_write.c | 58 ++++---- level_3/iki_write/c/iki_write.h | 4 +- level_3/init/c/init.c | 39 ++--- level_3/init/c/init.h | 8 +- level_3/init/c/private-init.c | 10 +- level_3/status_code/c/private-status_code.c | 20 +-- level_3/status_code/c/status_code.c | 34 ++--- level_3/status_code/c/status_code.h | 4 +- 31 files changed, 681 insertions(+), 695 deletions(-) diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 1ef2742..049170c 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -6,70 +6,70 @@ extern "C" { #endif #ifndef _di_byte_dump_print_help_ - f_return_status byte_dump_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status byte_dump_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, byte_dump_name_long, byte_dump_version); + fll_program_print_help_header(output, context, byte_dump_name_long, byte_dump_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - fprintf(file.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation."); - fll_program_print_help_option(file, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation."); - fll_program_print_help_option(file, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation."); - fll_program_print_help_option(file, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation."); - fll_program_print_help_option(file, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation."); + fll_program_print_help_option(output, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation."); + fll_program_print_help_option(output, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation."); + fll_program_print_help_option(output, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation."); + fll_program_print_help_option(output, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation."); + fll_program_print_help_option(output, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation."); - fprintf(file.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Set number of columns of Bytes to display."); + fll_program_print_help_option(output, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Set number of columns of Bytes to display."); - fprintf(file.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders."); + fll_program_print_help_option(output, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders."); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - fl_color_print(file.stream, context.set.important, " Special Options: "); + fl_color_print(output.stream, context.set.important, " Special Options: "); - fll_program_print_help_option_long(file, context, byte_dump_long_normal, f_console_symbol_long_enable, " 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, " Display spaces for ASCII control codes."); - fll_program_print_help_option_long(file, context, byte_dump_long_classic, f_console_symbol_long_enable, "Display periods for ASCII control codes."); + fll_program_print_help_option_long(output, context, byte_dump_long_normal, f_console_symbol_long_enable, " 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, " Display spaces for ASCII control codes."); + fll_program_print_help_option_long(output, context, byte_dump_long_classic, f_console_symbol_long_enable, "Display periods for ASCII control codes."); - fll_program_print_help_usage(file, context, byte_dump_name, "filename(s)"); + fll_program_print_help_usage(output, context, byte_dump_name, "filename(s)"); - fprintf(file.stream, " When using the "); - fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_text); - fprintf(file.stream, " option, some UTF-8 characters may be replaced by your instance and cause display alignment issues."); + fprintf(output.stream, " When using the "); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_text); + fprintf(output.stream, " option, some UTF-8 characters may be replaced by your instance and cause display alignment issues."); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - fprintf(file.stream, " Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the "); - fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder); - fprintf(file.stream, " option is used)."); + fprintf(output.stream, " Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the "); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder); + fprintf(output.stream, " option is used)."); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - fprintf(file.stream, " UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues."); + fprintf(output.stream, " UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues."); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - fprintf(file.stream, " When "); - fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fprintf(file.stream, " is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range."); + fprintf(output.stream, " When "); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); + fprintf(output.stream, " is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range."); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); return F_none; } diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index d81902e..1084765 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -245,7 +245,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -254,7 +254,7 @@ extern "C" { * F_none on success. */ #ifndef _di_byte_dump_print_help_ - extern f_return_status byte_dump_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status byte_dump_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_byte_dump_print_help_ /** diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 2513637..348b886 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -11,88 +11,88 @@ extern "C" { #endif #ifndef _di_fake_print_help_ - f_return_status fake_print_help(const f_file_t file, const f_color_context_t context) { - - fll_program_print_help_header(file, context, fake_name_long, fake_version); - - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - - fprintf(file.stream, "%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fake_short_define, fake_long_define, f_console_symbol_short_enable, f_console_symbol_long_enable, " Override defines from settings file with this define."); - fll_program_print_help_option(file, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this fakefile."); - fll_program_print_help_option(file, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Process name for storing build states."); - fll_program_print_help_option(file, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this settings file."); - - fprintf(file.stream, "%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Use includes/libraries/programs from this directory instead of system."); - - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - - fl_color_print(file.stream, context.set.important, " Special Options: "); - - fll_program_print_help_option_long(file, context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files."); - fll_program_print_help_option_long(file, context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files."); - fll_program_print_help_option_long(file, context, fake_long_shared_disabled, f_console_symbol_long_enable, "Forcibly do not build shared files."); - fll_program_print_help_option_long(file, context, fake_long_shared_enabled, f_console_symbol_long_enable, " Forcibly do build shared files."); - fll_program_print_help_option_long(file, context, fake_long_static_disabled, f_console_symbol_long_enable, "Forcibly do not build static files."); - fll_program_print_help_option_long(file, context, fake_long_static_enabled, f_console_symbol_long_enable, " Forcibly do build static files."); - - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - - fl_color_print(file.stream, context.set.important, " Operations: "); - - 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(file, context, fake_name, "operation"); - - fprintf(file.stream, " When performing the "); - fl_color_print(file.stream, context.set.notable, "%s", fake_other_operation_build); - fprintf(file.stream, " operation, the "); - fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fprintf(file.stream, " parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global."); - fprintf(file.stream, "%c", f_string_eol[0]); - - fprintf(file.stream, " For example, when a "); - fl_color_print(file.stream, context.set.notable, "%s", fake_long_mode); - fprintf(file.stream, " of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level')."); - - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); - - fprintf(file.stream, " When specifying the "); - fl_color_print(file.stream, context.set.notable, "%s", fake_long_fakefile); - fprintf(file.stream, " or the "); - fl_color_print(file.stream, context.set.notable, "%s", fake_long_settings); - fprintf(file.stream, " parameters, the filenames are relative to the data build directory, unless a path is used."); - fprintf(file.stream, "%c", f_string_eol[0]); - - fprintf(file.stream, " For example, with '"); - fl_color_print(file.stream, context.set.notable, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); - fprintf(file.stream, "' the fakefile at '"); - fl_color_print(file.stream, context.set.notable, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build); - fprintf(file.stream, " would be used, however with '"); - fl_color_print(file.stream, context.set.notable, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); - fprintf(file.stream, "' the fakefile at '"); - fl_color_print(file.stream, context.set.notable, "./my_fakefile", fake_default_path_data, fake_default_path_build); - fprintf(file.stream, " would be used."); - - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + f_return_status fake_print_help(const f_file_t output, const f_color_context_t context) { + + fll_program_print_help_header(output, context, fake_name_long, fake_version); + + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fake_short_define, fake_long_define, f_console_symbol_short_enable, f_console_symbol_long_enable, " Override defines from settings file with this define."); + fll_program_print_help_option(output, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this fakefile."); + fll_program_print_help_option(output, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Process name for storing build states."); + fll_program_print_help_option(output, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this settings file."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Use includes/libraries/programs from this directory instead of system."); + + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + + fl_color_print(output.stream, context.set.important, " Special Options: "); + + fll_program_print_help_option_long(output, context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files."); + fll_program_print_help_option_long(output, context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files."); + fll_program_print_help_option_long(output, context, fake_long_shared_disabled, f_console_symbol_long_enable, "Forcibly do not build shared files."); + fll_program_print_help_option_long(output, context, fake_long_shared_enabled, f_console_symbol_long_enable, " Forcibly do build shared files."); + fll_program_print_help_option_long(output, context, fake_long_static_disabled, f_console_symbol_long_enable, "Forcibly do not build static files."); + fll_program_print_help_option_long(output, context, fake_long_static_enabled, f_console_symbol_long_enable, " Forcibly do build static files."); + + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + + fl_color_print(output.stream, context.set.important, " Operations: "); + + 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_usage(output, context, fake_name, "operation"); + + fprintf(output.stream, " When performing the "); + fl_color_print(output.stream, context.set.notable, "%s", fake_other_operation_build); + fprintf(output.stream, " operation, the "); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); + fprintf(output.stream, " parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global."); + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " For example, when a "); + fl_color_print(output.stream, context.set.notable, "%s", fake_long_mode); + fprintf(output.stream, " of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level')."); + + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + + fprintf(output.stream, " When specifying the "); + fl_color_print(output.stream, context.set.notable, "%s", fake_long_fakefile); + fprintf(output.stream, " or the "); + fl_color_print(output.stream, context.set.notable, "%s", fake_long_settings); + fprintf(output.stream, " parameters, the filenames are relative to the data build directory, unless a path is used."); + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " For example, with '"); + fl_color_print(output.stream, context.set.notable, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); + fprintf(output.stream, "' the fakefile at '"); + fl_color_print(output.stream, context.set.notable, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build); + fprintf(output.stream, " would be used, however with '"); + fl_color_print(output.stream, context.set.notable, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); + fprintf(output.stream, "' the fakefile at '"); + fl_color_print(output.stream, context.set.notable, "./my_fakefile", fake_default_path_data, fake_default_path_build); + fprintf(output.stream, " would be used."); + + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); return F_none; } diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index 12f2e11..5aaf430 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -380,7 +380,6 @@ extern "C" { mode_t umask; f_signal_t signal; - f_string_dynamics_t define; f_string_dynamic_t fakefile; f_string_dynamics_t mode; @@ -498,7 +497,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -507,7 +506,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fake_print_help_ - extern f_return_status fake_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fake_print_help(const f_file_t output, 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 d4f7782..2cb22f4 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1311,7 +1311,7 @@ extern "C" { f_string_range_t range = f_macro_string_range_t_initialize(buffer.used); f_fss_delimits_t delimits = f_fss_delimits_t_initialize; - *status = fll_fss_extended_read(&buffer, &range, &objects, &contents, 0, 0, &delimits); + *status = fll_fss_extended_read(&buffer, &range, &objects, &contents, 0, 0, &delimits, 0); if (F_status_is_error(*status)) { fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_settings.string, range, F_true); @@ -2493,9 +2493,9 @@ extern "C" { fl_color_print(data.output.stream, data.context.set.important, "Building project%c", data_build.setting.project_name.used ? ' ' : 0); if (data_build.setting.project_name.used) { - fl_color_print_code(f_type_output, data.context.notable); - f_print_dynamic(f_type_output, data_build.setting.project_name); - fl_color_print_code(f_type_output, data.context.reset); + fl_color_print_code(data.output.stream, data.context.notable); + f_print_dynamic(data.output.stream, data_build.setting.project_name); + fl_color_print_code(data.output.stream, data.context.reset); } fl_color_print(data.output.stream, data.context.set.important, ".%c", f_string_eol[0]); diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 1777c03..b70314d 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -205,7 +205,7 @@ extern "C" { f_string_range_t range = f_macro_string_range_t_initialize(data_make->buffer.used); f_fss_delimits_t delimits = f_fss_delimits_t_initialize; - *status = fll_fss_basic_list_read(&data_make->buffer, &range, &list_objects, &list_contents, &delimits); + *status = fll_fss_basic_list_read(&data_make->buffer, &range, &list_objects, &list_contents, &delimits, 0); if (F_status_is_error(*status)) { fake_print_error_fss(data, *status, "fll_fss_basic_list_read", data.file_data_build_fakefile.string, range, F_true); @@ -272,7 +272,7 @@ extern "C" { delimits.used = 0; content_range = list_contents.array[i].array[0]; - *status = fll_fss_extended_read(&data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits); + *status = fll_fss_extended_read(&data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0); if (F_status_is_error(*status)) { fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true); @@ -304,7 +304,7 @@ extern "C" { delimits.used = 0; content_range = list_contents.array[i].array[0]; - *status = fll_fss_extended_read(&data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits); + *status = fll_fss_extended_read(&data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0); if (F_status_is_error(*status)) { fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data.file_data_build_fakefile.string, content_range, F_true); @@ -3573,7 +3573,7 @@ extern "C" { if (operation == fake_make_operation_type_print) { for (f_array_length_t i = 0; i < arguments.used; i++) { - f_print_dynamic(f_type_output, arguments.array[i]); + f_print_dynamic(data.output.stream, arguments.array[i]); if (i + 1 < arguments.used) { fprintf(data.output.stream, " "); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 3c394f4..ba83361 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -12,44 +12,44 @@ extern "C" { #endif #ifndef _di_firewall_print_help_ - f_return_status firewall_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status firewall_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, firewall_name_long, firewall_version); + fll_program_print_help_header(output, context, firewall_name_long, firewall_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c%c", f_string_eol[0], f_string_eol[0]); - fl_color_print(f_type_output, context.set.important, " Available Commands: "); + fprintf(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fl_color_print(output.stream, context.set.important, " Available Commands: "); - printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.set.standout, firewall_command_start); - printf(" Turn on the firewall"); + fprintf(output.stream, "%c ", f_string_eol[0]); + fl_color_print(output.stream, context.set.standout, firewall_command_start); + fprintf(output.stream, " Turn on the firewall"); - printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.set.standout, firewall_command_stop); - printf(" Turn off the firewall"); + fprintf(output.stream, "%c ", f_string_eol[0]); + fl_color_print(output.stream, context.set.standout, firewall_command_stop); + fprintf(output.stream, " Turn off the firewall"); - printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.set.standout, firewall_command_restart); - printf(" Turn off and then turn on the firewall"); + fprintf(output.stream, "%c ", f_string_eol[0]); + fl_color_print(output.stream, context.set.standout, firewall_command_restart); + fprintf(output.stream, " Turn off and then turn on the firewall"); - printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.set.standout, firewall_command_lock); - printf(" Prevent all communication"); + fprintf(output.stream, "%c ", f_string_eol[0]); + fl_color_print(output.stream, context.set.standout, firewall_command_lock); + fprintf(output.stream, " Prevent all communication"); - printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.set.standout, firewall_command_show); - printf(" Show active firewall settings"); + fprintf(output.stream, "%c ", f_string_eol[0]); + fl_color_print(output.stream, context.set.standout, firewall_command_show); + fprintf(output.stream, " Show active firewall settings"); - fll_program_print_help_usage(file, context, firewall_name, "command"); + fll_program_print_help_usage(output, context, firewall_name, "command"); return F_none; } @@ -230,10 +230,10 @@ extern "C" { } if (show_nat) { - fl_color_print(f_type_output, data->context.set.standout, "=========================== "); - fl_color_print(f_type_output, data->context.set.title, "NAT"); - fl_color_print(f_type_output, data->context.set.standout, " ============================%c", f_string_eol[0]); - fflush(f_type_output); + fl_color_print(data->output.stream, data->context.set.standout, "=========================== "); + fl_color_print(data->output.stream, data->context.set.title, "NAT"); + fl_color_print(data->output.stream, data->context.set.standout, " ============================%c", f_string_eol[0]); + fflush(data->output.stream); parameters.used = 6; @@ -253,15 +253,15 @@ extern "C" { status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); - fprintf(f_type_output, "\n"); - fflush(f_type_output); + fprintf(data->output.stream, "\n"); + fflush(data->output.stream); } if (F_status_is_error_not(status) && show_mangle) { - fl_color_print(f_type_output, data->context.set.standout, "========================== "); - fl_color_print(f_type_output, data->context.set.title, "MANGLE"); - fl_color_print(f_type_output, data->context.set.standout, " ==========================%c", f_string_eol[0]); - fflush(f_type_output); + fl_color_print(data->output.stream, data->context.set.standout, "========================== "); + fl_color_print(data->output.stream, data->context.set.title, "MANGLE"); + fl_color_print(data->output.stream, data->context.set.standout, " ==========================%c", f_string_eol[0]); + fflush(data->output.stream); parameters.used = 6; @@ -281,15 +281,15 @@ extern "C" { status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); - fprintf(f_type_output, "\n"); - fflush(f_type_output); + fprintf(data->output.stream, "\n"); + fflush(data->output.stream); } if (F_status_is_error_not(status) && show_ports) { - fl_color_print(f_type_output, data->context.set.standout, "========================== "); - fl_color_print(f_type_output, data->context.set.title, "FILTER"); - fl_color_print(f_type_output, data->context.set.standout, " ==========================%c", f_string_eol[0]); - fflush(f_type_output); + fl_color_print(data->output.stream, data->context.set.standout, "========================== "); + fl_color_print(data->output.stream, data->context.set.title, "FILTER"); + fl_color_print(data->output.stream, data->context.set.standout, " ==========================%c", f_string_eol[0]); + fflush(data->output.stream); parameters.used = 4; @@ -305,8 +305,8 @@ extern "C" { status = fll_execute_program((f_string_t) firewall_tool_iptables, parameters, 0, &return_code); - fprintf(f_type_output, "\n"); - fflush(f_type_output); + fprintf(data->output.stream, "\n"); + fflush(data->output.stream); } if (F_status_is_error(status)) { diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 65876b8..48a0044 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -294,7 +294,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -303,7 +303,7 @@ extern "C" { * F_none on success. */ #ifndef _di_firewall_print_help_ - extern f_return_status firewall_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status firewall_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_firewall_print_help_ /** diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 2883d7d..60d2468 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -651,7 +651,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con { f_string_range_t input = f_macro_string_range_t_initialize(local_buffer.used); - status = fll_fss_basic_read(&local_buffer, &input, &basic_objects, &basic_contents, 0, &delimits); + status = fll_fss_basic_read(&local_buffer, &input, &basic_objects, &basic_contents, 0, &delimits, 0); } if (F_status_set_error(status)) { @@ -1398,7 +1398,7 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti { f_string_range_t input = f_macro_string_range_t_initialize(local->buffer.used); - status = fll_fss_basic_list_read(&local->buffer, &input, &local->chain_objects, &local->chain_contents, &delimits); + status = fll_fss_basic_list_read(&local->buffer, &input, &local->chain_objects, &local->chain_contents, &delimits, 0); } if (F_status_is_error(status)) { @@ -1433,7 +1433,7 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti f_return_status firewall_process_rules(f_string_range_t *range, firewall_local_data_t *local, firewall_data_t *data) { f_fss_delimits_t delimits = f_fss_delimits_t_initialize; - f_status_t status = fll_fss_extended_read(&local->buffer, range, &local->rule_objects, &local->rule_contents, 0, 0, &delimits); + f_status_t status = fll_fss_extended_read(&local->buffer, range, &local->rule_objects, &local->rule_contents, 0, 0, &delimits, 0); if (F_status_is_error_not(status)) { status = fl_fss_apply_delimit(delimits, &local->buffer); 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 df8c058..3506599 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 @@ -6,80 +6,80 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_print_help_ - f_return_status fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) { - - fll_program_print_help_header(file, context, fss_basic_list_write_name_long, fss_basic_list_write_version); - - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - - printf("%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output 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, f_console_symbol_long_enable, "The Content to output."); - fll_program_print_help_option(file, context, fss_basic_list_write_short_double, fss_basic_list_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " The Object to output."); - fll_program_print_help_option(file, context, fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); - - fll_program_print_help_usage(file, context, fss_basic_list_write_name, ""); - - printf(" The pipe uses the Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") to designate the start of a Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(") to designate the end of the last Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Vertical Line character '"); - fl_color_print(f_type_output, context.set.notable, "\\v"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000B"); - printf(") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); - - printf(" For the pipe, an Object is terminated by either a Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") or a Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(").%c", f_string_eol[0]); - - printf(" The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_single); - printf("' and '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_double); - printf("' do nothing.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" This program does not use the parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_ignore); - printf("', which therefore does nothing.%c", f_string_eol[0]); - printf(" This parameter requires two values.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); + f_return_status fss_basic_list_write_print_help(const f_file_t output, const f_color_context_t context) { + + fll_program_print_help_header(output, context, fss_basic_list_write_name_long, fss_basic_list_write_version); + + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); + + fll_program_print_help_usage(output, context, fss_basic_list_write_name, ""); + + fprintf(output.stream, " The pipe uses the Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") to designate the start of a Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ") to designate the end of the last Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Vertical Line character '"); + fl_color_print(output.stream, context.set.notable, "\\v"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000B"); + fprintf(output.stream, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); + + fprintf(output.stream, " For the pipe, an Object is terminated by either a Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") or a Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ").%c", f_string_eol[0]); + + fprintf(output.stream, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " The FSS-0002 (Basic List) specification does not support quoted names, therefore the parameters '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_single); + fprintf(output.stream, "' and '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_double); + fprintf(output.stream, "' do nothing.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " This program does not use the parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_ignore); + fprintf(output.stream, "', which therefore does nothing.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } @@ -154,7 +154,7 @@ extern "C" { f_file_t output = f_file_t_initialize; output.id = f_type_descriptor_output; - output.stream = f_type_output; + output.stream = data->output.stream; output.flag = f_file_flag_create | f_file_flag_write_only | f_file_flag_append; if (F_status_is_error_not(status)) { @@ -453,7 +453,7 @@ extern "C" { } else if (data->error.verbosity != f_console_verbosity_quiet && data->parameters[fss_basic_list_write_parameter_file].result == f_console_result_none) { // ensure there is always a newline at the end, unless in quiet mode. - fprintf(f_type_output, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol[0]); } } 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 052ca19..b42cf8b 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 @@ -154,7 +154,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -163,7 +163,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ - extern f_return_status fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fss_basic_list_write_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_fss_basic_list_write_print_help_ /** 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 88c4b9b..e1bb15b 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_basic_write_print_help_ - f_return_status fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) { - - fll_program_print_help_header(file, context, fss_basic_write_name_long, fss_basic_write_version); - - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - - printf("%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(file, context, fss_basic_write_short_content, fss_basic_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The Content to output."); - fll_program_print_help_option(file, context, fss_basic_write_short_double, fss_basic_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " The Object to output."); - fll_program_print_help_option(file, context, fss_basic_write_short_partial, fss_basic_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); - - fll_program_print_help_usage(file, context, fss_basic_write_name, ""); - - printf(" The pipe uses the Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") to designate the start of a Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(") to designate the end of the last Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Vertical Line character '"); - fl_color_print(f_type_output, context.set.notable, "\\v"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000B"); - printf(") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); - - printf(" For the pipe, an Object is terminated by either a Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") or a Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(").%c", f_string_eol[0]); - - printf(" The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_prepend); - printf("' does nothing.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" This program does not use the parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_ignore); - printf("', which therefore does nothing.%c", f_string_eol[0]); - printf(" This parameter requires two values.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); + f_return_status fss_basic_write_print_help(const f_file_t output, const f_color_context_t context) { + + fll_program_print_help_header(output, context, fss_basic_write_name_long, fss_basic_write_version); + + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); + + fll_program_print_help_usage(output, context, fss_basic_write_name, ""); + + fprintf(output.stream, " The pipe uses the Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") to designate the start of a Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ") to designate the end of the last Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Vertical Line character '"); + fl_color_print(output.stream, context.set.notable, "\\v"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000B"); + fprintf(output.stream, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); + + fprintf(output.stream, " For the pipe, an Object is terminated by either a Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") or a Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ").%c", f_string_eol[0]); + + fprintf(output.stream, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " The FSS-0000 (Basic) specification does not support multi-line Content, therefore the parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_prepend); + fprintf(output.stream, "' does nothing.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " This program does not use the parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_ignore); + fprintf(output.stream, "', which therefore does nothing.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } @@ -452,7 +452,7 @@ extern "C" { } else if (data->error.verbosity != f_console_verbosity_quiet && data->parameters[fss_basic_write_parameter_file].result == f_console_result_none) { // ensure there is always a newline at the end, unless in quiet mode. - fprintf(f_type_output, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol[0]); } } 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 697db51..a31a2dc 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -153,7 +153,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -162,7 +162,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_write_print_help_ - extern f_return_status fss_basic_write_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fss_basic_write_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_fss_basic_write_print_help_ /** 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 6b66c36..7746174 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 @@ -6,86 +6,86 @@ extern "C" { #endif #ifndef _di_fss_extended_list_write_print_help_ - f_return_status fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context) { - - 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, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - - printf("%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fss_extended_list_write_short_file, fss_extended_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output 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, f_console_symbol_long_enable, "The Content to output."); - fll_program_print_help_option(file, context, fss_extended_list_write_short_double, fss_extended_list_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " The Object to output."); - fll_program_print_help_option(file, context, fss_extended_list_write_short_partial, fss_extended_list_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); - - fll_program_print_help_usage(file, context, fss_extended_list_write_name, ""); - - printf(" The pipe uses the Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") to designate the start of a Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(") to designate the end of the last Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Vertical Line character '"); - fl_color_print(f_type_output, context.set.notable, "\\v"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000B"); - printf(") is used to ignore a content range (use this both before and after the range).%c", f_string_eol[0]); - - printf(" For the pipe, an Object is terminated by either a Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") or a Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(").%c", f_string_eol[0]); - - printf(" The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_single); - printf("' and '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_double); - printf("' do nothing.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" The parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_ignore); - printf("' designates to not escape any valid nested Object or Content within some Content.%c", f_string_eol[0]); - printf(" This parameter requires two values.%c", f_string_eol[0]); - printf(" This parameter is not used for ignoring anything from the input pipe.%c", f_string_eol[0]); - printf(" This parameter must be specified after a '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); - printf("' parameter and this applies only to the Content represented by that specific '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); - printf("' parameter.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); + f_return_status fss_extended_list_write_print_help(const f_file_t output, const f_color_context_t context) { + + 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, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fss_extended_list_write_short_file, fss_extended_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); + + fll_program_print_help_usage(output, context, fss_extended_list_write_name, ""); + + fprintf(output.stream, " The pipe uses the Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") to designate the start of a Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ") to designate the end of the last Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Vertical Line character '"); + fl_color_print(output.stream, context.set.notable, "\\v"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000B"); + fprintf(output.stream, ") is used to ignore a content range (use this both before and after the range).%c", f_string_eol[0]); + + fprintf(output.stream, " For the pipe, an Object is terminated by either a Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") or a Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ").%c", f_string_eol[0]); + + fprintf(output.stream, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " The FSS-0003 (Extended List) specification does not support quoted names, therefore the parameters '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_single); + fprintf(output.stream, "' and '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_double); + fprintf(output.stream, "' do nothing.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " The parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_ignore); + fprintf(output.stream, "' designates to not escape any valid nested Object or Content within some Content.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter is not used for ignoring anything from the input pipe.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter must be specified after a '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); + fprintf(output.stream, "' parameter and this applies only to the Content represented by that specific '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); + fprintf(output.stream, "' parameter.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } @@ -469,7 +469,7 @@ extern "C" { else if (data->error.verbosity != f_console_verbosity_quiet && data->parameters[fss_extended_list_write_parameter_file].result == f_console_result_none) { // ensure there is always a newline at the end, unless in quiet mode. - fprintf(f_type_output, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol[0]); } } 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 2946920..d0e983a 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 @@ -155,7 +155,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -164,7 +164,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_list_write_print_help_ - extern f_return_status fss_extended_list_write_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fss_extended_list_write_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_fss_extended_list_write_print_help_ /** 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 cbed51d..1536aac 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_extended_write_print_help_ - f_return_status fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) { - - fll_program_print_help_header(file, context, fss_extended_write_name_long, fss_extended_write_version); - - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - - printf("%c", f_string_eol[0]); - - fll_program_print_help_option(file, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(file, context, fss_extended_write_short_content, fss_extended_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The Content to output."); - fll_program_print_help_option(file, context, fss_extended_write_short_double, fss_extended_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " The Object to output."); - fll_program_print_help_option(file, context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); - - fll_program_print_help_usage(file, context, fss_extended_write_name, ""); - - printf(" The pipe uses the Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") to designate the start of a Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(") to designate the end of the last Content.%c", f_string_eol[0]); - - printf(" The pipe uses the Vertical Line character '"); - fl_color_print(f_type_output, context.set.notable, "\\v"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000B"); - printf(") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); - - printf(" For the pipe, an Object is terminated by either a Backspace character '"); - fl_color_print(f_type_output, context.set.notable, "\\b"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+0008"); - printf(") or a Form Feed character '"); - fl_color_print(f_type_output, context.set.notable, "\\f"); - printf("' ("); - fl_color_print(f_type_output, context.set.notable, "U+000C"); - printf(").%c", f_string_eol[0]); - - printf(" The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_prepend); - printf("' does nothing.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); - - printf(" This program does not use the parameter '"); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_ignore); - printf("', which therefore does nothing.%c", f_string_eol[0]); - printf(" This parameter requires two values.%c", f_string_eol[0]); - - printf("%c", f_string_eol[0]); + f_return_status fss_extended_write_print_help(const f_file_t output, const f_color_context_t context) { + + fll_program_print_help_header(output, context, fss_extended_write_name_long, fss_extended_write_version); + + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fll_program_print_help_option(output, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Trim object names."); + + fll_program_print_help_usage(output, context, fss_extended_write_name, ""); + + fprintf(output.stream, " The pipe uses the Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") to designate the start of a Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ") to designate the end of the last Content.%c", f_string_eol[0]); + + fprintf(output.stream, " The pipe uses the Vertical Line character '"); + fl_color_print(output.stream, context.set.notable, "\\v"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000B"); + fprintf(output.stream, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol[0]); + + fprintf(output.stream, " For the pipe, an Object is terminated by either a Backspace character '"); + fl_color_print(output.stream, context.set.notable, "\\b"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+0008"); + fprintf(output.stream, ") or a Form Feed character '"); + fl_color_print(output.stream, context.set.notable, "\\f"); + fprintf(output.stream, "' ("); + fl_color_print(output.stream, context.set.notable, "U+000C"); + fprintf(output.stream, ").%c", f_string_eol[0]); + + fprintf(output.stream, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " The FSS-0001 (Extended) specification does not support multi-line Content, therefore the parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_prepend); + fprintf(output.stream, "' does nothing.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); + + fprintf(output.stream, " This program does not use the parameter '"); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_ignore); + fprintf(output.stream, "', which therefore does nothing.%c", f_string_eol[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol[0]); + + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } @@ -527,7 +527,7 @@ extern "C" { } else if (data->error.verbosity != f_console_verbosity_quiet && data->parameters[fss_extended_write_parameter_file].result == f_console_result_none) { // ensure there is always a newline at the end, unless in quiet mode. - fprintf(f_type_output, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol[0]); } } 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 d32667f..1cdfe66 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -154,7 +154,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -163,7 +163,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_write_print_help_ - extern f_return_status fss_extended_write_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fss_extended_write_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_fss_extended_write_print_help_ /** 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 ba42cfd..8c23059 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -6,28 +6,28 @@ extern "C" { #endif #ifndef _di_fss_status_code_print_help_ - f_return_status fss_status_code_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status fss_status_code_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, fss_status_code_name_long, fss_status_code_version); + fll_program_print_help_header(output, context, fss_status_code_name_long, fss_status_code_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Convert status code name to number."); + fll_program_print_help_option(output, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Convert status code name to number."); - fll_program_print_help_usage(file, context, fss_status_code_name, "status code(s)"); + fll_program_print_help_usage(output, context, fss_status_code_name, "status code(s)"); return F_none; } 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 cf937ca..7e5df36 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -129,7 +129,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -138,7 +138,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_status_code_print_help_ - extern f_return_status fss_status_code_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status fss_status_code_print_help(const f_file_t output, 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 7045191..a98d4f1 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 @@ -53,13 +53,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(value, &number, range); if (status == F_none) { - fl_color_print(f_type_output, data.context.set.error, "invalid name%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid name%c", f_string_eol[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print(f_type_output, data.context.set.error, "invalid data%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid data%c", f_string_eol[0]); return status; } @@ -76,10 +76,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print(f_type_output, data.context.set.error, "unknown name%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "unknown name%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "failed to convert%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "failed to convert%c", f_string_eol[0]); } return status; @@ -87,7 +87,7 @@ extern "C" { } if (status == F_data) { - fl_color_print(f_type_output, data.context.set.warning, "unknown code%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.warning, "unknown code%c", f_string_eol[0]); return F_none; } @@ -112,10 +112,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print(f_type_output, data.context.set.error, "unknown code%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "unknown code%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "failed to convert%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "failed to convert%c", f_string_eol[0]); } return status; @@ -134,17 +134,17 @@ extern "C" { f_status_t status = fl_conversion_string_to_number_unsigned(value, number, range); if (*number > F_status_size_max_with_signal) { - fl_color_print(f_type_output, data.context.set.error, "out of range%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "out of range%c", f_string_eol[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print(f_type_output, data.context.set.error, "out of range%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "out of range%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "invalid number%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid number%c", f_string_eol[0]); } return status; diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index d495a95..f6d9687 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -6,83 +6,83 @@ extern "C" { #endif #ifndef _di_iki_read_print_help_ - f_return_status iki_read_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status iki_read_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, iki_read_name_long, iki_read_version); + fll_program_print_help_header(output, context, iki_read_name_long, iki_read_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Print only the variables at the given line."); - fll_program_print_help_option(file, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "Print all of the data instead of just the variable data."); + fll_program_print_help_option(output, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Print only the variables at the given line."); + fll_program_print_help_option(output, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "Print all of the data instead of just the variable data."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Print the total number of variables."); + fll_program_print_help_option(output, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Print the total number of variables."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable, f_console_symbol_long_enable, "Substitute the entire variable for the given name and content value with the given string."); + fll_program_print_help_option(output, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable, f_console_symbol_long_enable, "Substitute the entire variable for the given name and content value with the given string."); - fll_program_print_help_usage(file, context, iki_read_name, "filename(s)"); + fll_program_print_help_usage(output, context, iki_read_name, "filename(s)"); - fl_color_print(f_type_output, context.set.important, " Notes:"); + fl_color_print(output.stream, context.set.important, " Notes:"); - printf("%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0], f_string_eol[0]); - printf(" This program will find and print variables, vocabularies, or content following the IKI standard, without focusing on any particular vocabulary specification.%c", f_string_eol[0]); + fprintf(output.stream, " This program will find and print variables, vocabularies, or content following the IKI standard, without focusing on any particular vocabulary specification.%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - printf(" The "); - fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); - printf(" option, requires 3 additional parameters: "); + fprintf(output.stream, " The "); + fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); + fprintf(output.stream, " option, requires 3 additional parameters: "); - fl_color_print(f_type_output, context.set.notable, "<"); - printf("%s", iki_read_substitution_vocabulary); - fl_color_print(f_type_output, context.set.notable, ">"); - printf(" "); - fl_color_print(f_type_output, context.set.notable, "<"); - printf("%s", iki_read_substitution_replace); - fl_color_print(f_type_output, context.set.notable, ">"); - printf(" "); - fl_color_print(f_type_output, context.set.notable, "<"); - printf("%s", iki_read_substitution_with); - fl_color_print(f_type_output, context.set.notable, ">"); - printf(".%c", f_string_eol[0]); + fl_color_print(output.stream, context.set.notable, "<"); + fprintf(output.stream, "%s", iki_read_substitution_vocabulary); + fl_color_print(output.stream, context.set.notable, ">"); + fprintf(output.stream, " "); + fl_color_print(output.stream, context.set.notable, "<"); + fprintf(output.stream, "%s", iki_read_substitution_replace); + fl_color_print(output.stream, context.set.notable, ">"); + fprintf(output.stream, " "); + fl_color_print(output.stream, context.set.notable, "<"); + fprintf(output.stream, "%s", iki_read_substitution_with); + fl_color_print(output.stream, context.set.notable, ">"); + fprintf(output.stream, ".%c", f_string_eol[0]); - fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_vocabulary); - printf(": The name of the vocabulary whose content is to be substituted.%c", f_string_eol[0]); + fl_color_print(output.stream, context.set.notable, " %s", iki_read_substitution_vocabulary); + fprintf(output.stream, ": The name of the vocabulary whose content is to be substituted.%c", f_string_eol[0]); - fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_replace); - printf(": The content matching this exact string will be substituted.%c", f_string_eol[0]); + fl_color_print(output.stream, context.set.notable, " %s", iki_read_substitution_replace); + fprintf(output.stream, ": The content matching this exact string will be substituted.%c", f_string_eol[0]); - fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_with); - printf(": The new string to use as the substitute.%c", f_string_eol[0]); + fl_color_print(output.stream, context.set.notable, " %s", iki_read_substitution_with); + fprintf(output.stream, ": The new string to use as the substitute.%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - printf(" The vocabulary and replacement are case-sensitive and must exactly match.%c", f_string_eol[0]); + fprintf(output.stream, " The vocabulary and replacement are case-sensitive and must exactly match.%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - printf(" The default behavior is to only display content portion of the IKI variable.%c", f_string_eol[0]); + fprintf(output.stream, " The default behavior is to only display content portion of the IKI variable.%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index de698fc..d0ea1db 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -270,7 +270,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -279,7 +279,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_read_print_help_ - extern f_return_status iki_read_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status iki_read_print_help(const f_file_t output, 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 e34a1a6..544f175 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -170,7 +170,7 @@ extern "C" { iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(f_type_output, data->buffer, ranges->array[j]); + f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[j]); } printf("%c", f_string_eol[0]); @@ -193,7 +193,7 @@ extern "C" { iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[i], i, content_only); } else { - f_print_dynamic_partial(f_type_output, data->buffer, ranges->array[i]); + f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[i]); } printf("%c", f_string_eol[0]); @@ -226,7 +226,7 @@ extern "C" { } if (!variable->used) { - f_print_dynamic_partial(f_type_output, data->buffer, buffer_range); + f_print_dynamic_partial(data->output.stream, data->buffer, buffer_range); return F_none; } @@ -321,7 +321,7 @@ extern "C" { range.start = i; range.stop = variable->array[j].start - 1; - f_print_dynamic_partial(f_type_output, data->buffer, range); + f_print_dynamic_partial(data->output.stream, data->buffer, range); range.start = variable->array[j].stop + 1; range.stop = buffer_range.stop; @@ -348,7 +348,7 @@ extern "C" { iki_read_substitutions_print(*data, *variable, *content, *variable, substitutionss[j], j, F_false); } else { - f_print_dynamic_partial(f_type_output, data->buffer, variable->array[j]); + f_print_dynamic_partial(data->output.stream, data->buffer, variable->array[j]); } } else { @@ -356,7 +356,7 @@ extern "C" { iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(f_type_output, data->buffer, ranges->array[j]); + f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[j]); } } } @@ -365,7 +365,7 @@ extern "C" { iki_read_substitutions_print(*data, *variable, *content, *ranges, substitutionss[j], j, content_only); } else { - f_print_dynamic_partial(f_type_output, data->buffer, ranges->array[j]); + f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[j]); } } @@ -375,7 +375,7 @@ extern "C" { if (i <= buffer_range.stop) { range.start = i; - f_print_dynamic_partial(f_type_output, data->buffer, range); + f_print_dynamic_partial(data->output.stream, data->buffer, range); } } @@ -529,24 +529,24 @@ extern "C" { if (status == F_equal_to) { if (content_only) { - f_print_dynamic(f_type_output, substitutions.array[i].with); + f_print_dynamic(data.output.stream, substitutions.array[i].with); } else { range.start = variable.array[index].start; range.stop = content.array[index].start - 1; - f_print_dynamic_partial(f_type_output, data.buffer, range); + f_print_dynamic_partial(data.output.stream, data.buffer, range); - f_print_dynamic(f_type_output, substitutions.array[i].with); + f_print_dynamic(data.output.stream, substitutions.array[i].with); range.start = content.array[index].stop + 1; range.stop = variable.array[index].stop; - f_print_dynamic_partial(f_type_output, data.buffer, range); + f_print_dynamic_partial(data.output.stream, data.buffer, range); } } else { - f_print_dynamic_partial(f_type_output, data.buffer, ranges.array[index]); + f_print_dynamic_partial(data.output.stream, data.buffer, ranges.array[index]); } } #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 9fd68b8..a0d5114 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -6,46 +6,46 @@ extern "C" { #endif #ifndef _di_iki_write_print_help_ - f_return_status iki_write_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status iki_write_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, iki_write_name_long, iki_write_version); + fll_program_print_help_header(output, context, iki_write_name_long, iki_write_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to."); - fll_program_print_help_option(file, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The content to output."); - fll_program_print_help_option(file, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default)."); - fll_program_print_help_option(file, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output."); - fll_program_print_help_option(file, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); + fll_program_print_help_option(output, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "The content to output."); + fll_program_print_help_option(output, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default)."); + fll_program_print_help_option(output, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output."); + fll_program_print_help_option(output, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes."); - fll_program_print_help_usage(file, context, iki_write_name, ""); + fll_program_print_help_usage(output, context, iki_write_name, ""); - fl_color_print(f_type_output, context.set.important, " Notes:"); + fl_color_print(output.stream, context.set.important, " Notes:"); - printf("%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0], f_string_eol[0]); - printf(" This program will accept object and content strings to generate an IKI string, such as: "); - fl_color_print(f_type_output, context.set.notable, "object:\"content\""); - printf(".%c", f_string_eol[0]); + fprintf(output.stream, " This program will accept object and content strings to generate an IKI string, such as: "); + fl_color_print(output.stream, context.set.notable, "object:\"content\""); + fprintf(output.stream, ".%c", f_string_eol[0]); - printf(" Each object must have a content (and each content must have an object).%c", f_string_eol[0]); + fprintf(output.stream, " Each object must have a content (and each content must have an object).%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - printf(" When piping data to this program, a single end of line (\\n) must be used to separate each object from each content.%c", f_string_eol[0]); - printf(" Furthermore, each object must be followed by a content.%c", f_string_eol[0]); + fprintf(output.stream, " When piping data to this program, a single end of line (\\n) must be used to separate each object from each content.%c", f_string_eol[0]); + fprintf(output.stream, " Furthermore, each object must be followed by a content.%c", f_string_eol[0]); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); return F_none; } @@ -378,7 +378,7 @@ extern "C" { // ensure there is always a newline at the end, unless in quiet mode. if (F_status_is_error_not(status) && data->error.verbosity != f_console_verbosity_quiet && data->parameters[iki_write_parameter_file].result == f_console_result_none) { - fprintf(f_type_output, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol[0]); } } diff --git a/level_3/iki_write/c/iki_write.h b/level_3/iki_write/c/iki_write.h index 6331d00..430ab1f 100644 --- a/level_3/iki_write/c/iki_write.h +++ b/level_3/iki_write/c/iki_write.h @@ -145,7 +145,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -154,7 +154,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_write_print_help_ - extern f_return_status iki_write_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status iki_write_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_iki_write_print_help_ /** diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 0ecdf30..a1f4cb0 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -14,36 +14,27 @@ extern "C" { #endif -// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors -#ifndef _di_init_print_version_ - f_return_status init_print_version(const init_data_t data) { - printf("%s\n", init_version); - - return F_none; - } -#endif // _di_init_print_version_ - #ifndef _di_init_print_help_ - f_return_status init_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status init_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, init_name_long, init_version); + fll_program_print_help_header(output, context, init_name_long, init_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations."); - fll_program_print_help_option(file, context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument."); + fll_program_print_help_option(output, context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations."); + fll_program_print_help_option(output, context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument."); - fll_program_print_help_usage(file, context, init_name, ""); + fll_program_print_help_usage(output, context, init_name, ""); return F_none; } diff --git a/level_3/init/c/init.h b/level_3/init/c/init.h index b10c6e9..51fceb3 100644 --- a/level_3/init/c/init.h +++ b/level_3/init/c/init.h @@ -289,14 +289,10 @@ extern "C" { } #endif // _di_init_data_t_ -#ifndef _di_init_print_version_ - extern f_return_status init_print_version(const init_data_t data); -#endif // _di_init_print_version_ - /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -305,7 +301,7 @@ extern "C" { * F_none on success. */ #ifndef _di_init_print_help_ - extern f_return_status init_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status init_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_init_print_help_ /** diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 738c77a..07dc4e7 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -72,7 +72,7 @@ { f_string_range_t input = f_macro_string_range_t_initialize(buffer->used); - status = fll_fss_basic_list_read(buffer, &input, objects, contents, &delimits); + status = fll_fss_basic_list_read(buffer, &input, objects, contents, &delimits, 0); } if (F_status_is_error(status)) { @@ -112,7 +112,7 @@ f_fss_delimits_t delimits = f_fss_delimits_t_initialize; // @todo: resume replacing code below. - status = fll_fss_extended_read(&buffer, input, &local->rule_objects, &local->rule_contents, 0, 0, &delimits); + status = fll_fss_extended_read(&buffer, input, &local->rule_objects, &local->rule_contents, 0, 0, &delimits, 0); if (F_status_is_error_not(*status)) { status = fl_fss_apply_delimit(delimits, &buffer); @@ -530,7 +530,7 @@ location.stop = objects.array[position].stop; delimits.used = 0; - status = fll_fss_extended_read(&buffer, &location, &objects, &contents, 0, 0, &delimits); + status = fll_fss_extended_read(&buffer, &location, &objects, &contents, 0, 0, &delimits, 0); if (F_status_is_error_not(*status)) { status = fl_fss_apply_delimit(delimits, &buffer); @@ -544,7 +544,7 @@ /* delimits.used = 0; - status = fll_fss_extended_read(&buffer, &location, &objects, &contents, 0, 0, &delimits); + status = fll_fss_extended_read(&buffer, &location, &objects, &contents, 0, 0, &delimits, 0); if (F_status_is_error_not(status)) { status = fl_fss_apply_delimit(delimits, &buffer); @@ -571,7 +571,7 @@ f_status_t status = F_none; delimits.used = 0; - status = fll_fss_extended_read(buffer, location, objects, contents, 0, 0, &delimits); + status = fll_fss_extended_read(buffer, location, objects, contents, 0, 0, &delimits, 0); if (F_status_is_error_not(status)) { status = fl_fss_apply_delimit(delimits, &buffer); diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index c44d8de..41760cf 100644 --- a/level_3/status_code/c/private-status_code.c +++ b/level_3/status_code/c/private-status_code.c @@ -55,13 +55,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(value, &number, range); if (status == F_none) { - fl_color_print(f_type_output, data.context.set.error, "invalid name%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid name%c", f_string_eol[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print(f_type_output, data.context.set.error, "invalid data%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid data%c", f_string_eol[0]); return status; } @@ -73,17 +73,17 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print(f_type_output, data.context.set.error, "unknown name%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "unknown name%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "failed to convert%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "failed to convert%c", f_string_eol[0]); } return status; } if (status == F_data) { - fl_color_print(f_type_output, data.context.set.warning, "unknown code%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.warning, "unknown code%c", f_string_eol[0]); return F_none; } @@ -110,10 +110,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print(f_type_output, data.context.set.error, "unknown code%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "unknown code%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "failed to convert%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "failed to convert%c", f_string_eol[0]); } return status; @@ -132,17 +132,17 @@ extern "C" { f_status_t status = fl_conversion_string_to_number_unsigned(value, number, range); if (*number > F_status_size_max_with_signal) { - fl_color_print(f_type_output, data.context.set.error, "out of range%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "out of range%c", f_string_eol[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print(f_type_output, data.context.set.error, "out of range%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "out of range%c", f_string_eol[0]); } else { - fl_color_print(f_type_output, data.context.set.error, "invalid number%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.error, "invalid number%c", f_string_eol[0]); } return status; diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 38df492..0bdd4c0 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -6,28 +6,28 @@ extern "C" { #endif #ifndef _di_status_code_print_help_ - f_return_status status_code_print_help(const f_file_t file, const f_color_context_t context) { + f_return_status status_code_print_help(const f_file_t output, const f_color_context_t context) { - fll_program_print_help_header(file, context, status_code_name_long, status_code_version); + fll_program_print_help_header(output, context, status_code_name_long, status_code_version); - fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); - fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); - fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); - fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); - fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); + fll_program_print_help_option(output, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); + fll_program_print_help_option(output, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds."); + fll_program_print_help_option(output, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color."); + fll_program_print_help_option(output, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output."); + fll_program_print_help_option(output, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number."); - printf("%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol[0]); - fll_program_print_help_option(file, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Convert status code name to number."); + fll_program_print_help_option(output, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, "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, f_console_symbol_long_enable, " 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, f_console_symbol_long_enable, " Convert status code name to number."); - fll_program_print_help_usage(file, context, status_code_name, "status code(s)"); + fll_program_print_help_usage(output, context, status_code_name, "status code(s)"); return F_none; } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index fbf2d30..2e8ee0e 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -128,7 +128,7 @@ extern "C" { /** * Print help. * - * @param file + * @param output * The file to print to. * @param context * The color context settings. @@ -137,7 +137,7 @@ extern "C" { * F_none on success. */ #ifndef _di_status_code_print_help_ - extern f_return_status status_code_print_help(const f_file_t file, const f_color_context_t context); + extern f_return_status status_code_print_help(const f_file_t output, const f_color_context_t context); #endif // _di_status_code_print_help_ /** -- 1.8.3.1