From: Kevin Day Date: Sat, 2 Jan 2021 04:09:20 +0000 (-0600) Subject: Cleanup: provide empty static strings and use the static strings more often. X-Git-Tag: 0.5.3~139 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=4baa609bc3712d478596d1d3914a5732ab72b6d6;p=fll Cleanup: provide empty static strings and use the static strings more often. --- diff --git a/level_0/f_color/c/color.h b/level_0/f_color/c/color.h index eda04bf..8fd3aeb 100644 --- a/level_0/f_color/c/color.h +++ b/level_0/f_color/c/color.h @@ -266,17 +266,19 @@ extern "C" { #define f_color_set_t_initialize { 0, 0 } + #define f_macro_color_set_t_initialize(before, after) { before, after } + #define f_macro_color_set_t_clear(set) \ set.before = 0; \ set.after = 0; #endif // _di_f_color_set_t_ /** - * Set the context and notable to this to safely allow for fprintf uses when there is no color to be used. + * Provide a global (static) color set of global (static) empty strings. */ -#ifndef _di_f_color_set_string_null_s_ - const static f_string_static_t f_color_set_string_null_s = f_macro_string_static_t_initialize(f_string_empty_s, 0); -#endif // _di_f_color_set_string_null_s_ +#ifndef _di_f_color_set_string_empty_s_ + const static f_color_set_t f_color_set_empty_s = f_macro_color_set_t_initialize(&f_string_static_empty_s, &f_string_static_empty_s); +#endif // _di_f_color_set_string_empty_s_ /** * Provide a set of color contexts. @@ -306,6 +308,8 @@ extern "C" { #define f_color_set_context_t_initialize { f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize } + #define f_macro_color_set_context_t_initialize(warning, error, title, notable, important, standout, normal, normal_reset) { warning, error, title, notable, important, standout, normal, normal_reset } + #define f_macro_color_set_context_t_clear(set) \ f_macro_color_set_t_clear(set.warning); \ f_macro_color_set_t_clear(set.error); \ diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index 58a55f9..5034235 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -45,6 +45,10 @@ extern "C" { const static f_string_t f_string_placeholder_s = f_string_placeholder; #endif // _di_f_string_has_placeholder_ +#ifndef _di_f_string_static_empty_s_ + const static f_string_static_t f_string_static_empty_s = f_macro_string_static_t_initialize(f_string_empty_s, 0); +#endif // _di_f_string_static_empty_s_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_string/c/string.c b/level_1/fl_string/c/string.c index 0a9fcf0..ab7c9ed 100644 --- a/level_1/fl_string/c/string.c +++ b/level_1/fl_string/c/string.c @@ -1002,7 +1002,7 @@ extern "C" { if (!string) return F_data_not; if (range->start > range->stop) return F_data_not_stop; - while (string[range->start] != f_string_eol[0]) { + while (string[range->start] != f_string_eol_s[0]) { range->start++; if (range->start > range->stop) return F_none_stop; @@ -1023,7 +1023,7 @@ extern "C" { while (string[range->start] != seek_to_this) { - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; range->start++; @@ -1058,7 +1058,7 @@ extern "C" { if (!width) { width = 1; - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; if (seek_width == width) { if (string[range->start] == seek_to_this) return F_none; @@ -1107,7 +1107,7 @@ extern "C" { while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); @@ -1151,7 +1151,7 @@ extern "C" { while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); @@ -1782,7 +1782,7 @@ extern "C" { if (range->start > range->stop) return F_data_not_stop; while (string[range->start] != seek_to) { - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; range->start++; @@ -1817,7 +1817,7 @@ extern "C" { if (!width) { width = 1; - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; if (seek_width == width) { if (string[range->start] == seek_to) return F_none; @@ -1859,7 +1859,7 @@ extern "C" { while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) { if (F_status_is_error(status)) return status; - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); @@ -1905,7 +1905,7 @@ extern "C" { return status; } - if (string[range->start] == f_string_eol[0]) return F_none_eol; + if (string[range->start] == f_string_eol_s[0]) return F_none_eol; width = f_macro_utf_byte_width_is(string[range->start]); diff --git a/level_2/fll_error/c/error.c b/level_2/fll_error/c/error.c index 3baa775..226bcc3 100644 --- a/level_2/fll_error/c/error.c +++ b/level_2/fll_error/c/error.c @@ -24,10 +24,10 @@ extern "C" { if (status == F_access_denied) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sAccess denied while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sAccess denied while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -35,10 +35,10 @@ extern "C" { if (status == F_access_group) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -46,10 +46,10 @@ extern "C" { if (status == F_access_owner) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -57,10 +57,10 @@ extern "C" { if (status == F_directory) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid directory while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid directory while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -68,10 +68,10 @@ extern "C" { if (status == F_directory_empty_not) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s' is not empty.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s' is not empty.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -79,10 +79,10 @@ extern "C" { if (status == F_file_closed) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s' is not open.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s' is not open.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -90,10 +90,10 @@ extern "C" { if (status == F_file_found) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s' already exists.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s' already exists.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -101,45 +101,45 @@ extern "C" { if (status == F_file_found_not) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to find %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sFailed to find %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; } if (status == F_file_open) { - fprintf(error.to.stream, "%s%sUnable to open the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%s%sUnable to open the %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); return F_false; } if (status == F_file_descriptor) { - fprintf(error.to.stream, "%s%sFile descriptor error while trying to open the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%s%sFile descriptor error while trying to open the %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); return F_false; } if (status == F_number_underflow) { - fprintf(error.to.stream, "%s%sInteger underflow while trying to buffer the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%s%sInteger underflow while trying to buffer the %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); return F_false; } if (status == F_file_read) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sA read error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sA read error occurred while accessing the %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -147,10 +147,10 @@ extern "C" { if (status == F_file_seek) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sA seek error occurred while accessing the %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sA seek error occurred while accessing the %s '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -158,10 +158,10 @@ extern "C" { if (status == F_loop) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sLoop while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sLoop while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -169,10 +169,10 @@ extern "C" { if (status == F_name) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid %s name '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid %s name '", error.context.before->string, error.prefix, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -180,10 +180,10 @@ extern "C" { if (status == F_number_overflow) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sOverflow while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sOverflow while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -191,14 +191,14 @@ extern "C" { if (status == F_parameter) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); fprintf(error.to.stream, " for the %s '", type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -206,10 +206,10 @@ extern "C" { if (status == F_prohibited) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sProhibited by system while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sProhibited by system while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -218,10 +218,10 @@ extern "C" { if (type == fll_error_file_type_file) { if (status == F_file_type_not_directory) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid or missing directory in path while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid or missing directory in path while trying to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -231,10 +231,10 @@ extern "C" { if (type == fll_error_file_type_file || type == fll_error_file_type_directory) { if (status == F_directory_found_not) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s' due to an invalid directory in the path.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s' due to an invalid directory in the path.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -243,10 +243,10 @@ extern "C" { if (type == fll_error_file_type_directory) { if (status == F_failure) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s, operation, type_name); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix, operation, type_name); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -263,10 +263,10 @@ extern "C" { if (status == F_data_not) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument for the parameter '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument for the parameter '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s' must not be an empty string.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s' must not be an empty string.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -274,12 +274,12 @@ extern "C" { if (status == F_number) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is not a valid number for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -287,12 +287,12 @@ extern "C" { if (status == F_number_negative) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is negative, which is not allowed for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -300,12 +300,12 @@ extern "C" { if (status == F_number_overflow) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is too large for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -313,12 +313,12 @@ extern "C" { if (status == F_number_positive) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is positive, which is not allowed for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -326,12 +326,12 @@ extern "C" { if (status == F_number_underflow) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string); fprintf(error.to.stream, "%s' is too small for the parameter '", error.context.before->string); fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string); - fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, "%s'.%s%c", error.context.before->string, error.context.after->string, f_string_eol_s[0]); } return F_false; diff --git a/level_2/fll_error/c/private-error.c b/level_2/fll_error/c/private-error.c index 84700d1..2bcd8a5 100644 --- a/level_2/fll_error/c/private-error.c +++ b/level_2/fll_error/c/private-error.c @@ -10,12 +10,12 @@ extern "C" { if (status == F_array_too_large) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum array length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sMaximum array length reached while processing ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -23,12 +23,12 @@ extern "C" { if (status == F_buffer_too_large) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum buffer length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sMaximum buffer length reached while processing ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -36,12 +36,12 @@ extern "C" { if (status == F_memory_allocation || status == F_memory_reallocation || status == F_memory_not) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sUnable to allocate memory in function ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sUnable to allocate memory in function ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -49,12 +49,12 @@ extern "C" { if (status == F_parameter) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -62,12 +62,12 @@ extern "C" { if (status == F_string_too_large) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sMaximum string length reached while processing ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sMaximum string length reached while processing ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -75,12 +75,12 @@ extern "C" { if (status == F_utf) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid UTF-8 character while calling ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -88,12 +88,12 @@ extern "C" { if (status == F_complete_not_utf) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%sInvalid (incomplete) UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%sInvalid (incomplete) UTF-8 character while calling ", error.context.before->string, error.prefix); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } return F_false; @@ -101,14 +101,14 @@ extern "C" { if (fallback && error.verbosity != f_console_verbosity_quiet) { if (error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); - fprintf(error.to.stream, "%s%s(", error.context.before->string, error.prefix ? error.prefix : f_string_empty_s); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); + fprintf(error.to.stream, "%s%s(", error.context.before->string, error.prefix); fprintf(error.to.stream, "%s%s%llu%s", error.context.after->string, error.notable.before->string, status, error.notable.after->string); fprintf(error.to.stream, "%s)", error.context.before->string); private_fll_error_print_function(error, function); - fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]); + fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol_s[0]); } } diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 921dd6d..08201fc 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -7,13 +7,13 @@ extern "C" { #ifndef _di_fll_program_print_help_header_ f_return_status fll_program_print_help_header(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t version) { - fprintf(file.stream, "%c", f_string_eol[0]); + fprintf(file.stream, "%c", f_string_eol_s[0]); fl_color_print(file.stream, context.set.title, " %s", name); - fprintf(file.stream, "%c", f_string_eol[0]); + fprintf(file.stream, "%c", f_string_eol_s[0]); fl_color_print(file.stream, context.set.notable, " Version %s", version); - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(file.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(file.stream, context.set.important, " Available Options: "); return F_none; @@ -23,7 +23,7 @@ extern "C" { #ifndef _di_fll_program_print_help_option_ f_return_status fll_program_print_help_option(const f_file_t file, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description) { - fprintf(file.stream, "%c %s", f_string_eol[0], symbol_short); + fprintf(file.stream, "%c %s", f_string_eol_s[0], symbol_short); fl_color_print(file.stream, context.set.standout, option_short); fprintf(file.stream, ", %s", symbol_long); @@ -38,7 +38,7 @@ extern "C" { #ifndef _di_fll_program_print_help_option_long_ f_return_status fll_program_print_help_option_long(const f_file_t file, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) { - fprintf(file.stream, "%c %s", f_string_eol[0], symbol_long); + fprintf(file.stream, "%c %s", f_string_eol_s[0], symbol_long); fl_color_print(file.stream, context.set.standout, option_long); fprintf(file.stream, " %s", description); @@ -50,7 +50,7 @@ extern "C" { #ifndef _di_fll_program_print_help_option_other_ f_return_status fll_program_print_help_option_other(const f_file_t file, const f_color_context_t context, const f_string_t option_other, const f_string_t description) { - fprintf(file.stream, "%c ", f_string_eol[0]); + fprintf(file.stream, "%c ", f_string_eol_s[0]); fl_color_print(file.stream, context.set.standout, option_other); fprintf(file.stream, " %s", description); @@ -62,10 +62,10 @@ extern "C" { #ifndef _di_fll_program_print_help_usage_ f_return_status fll_program_print_help_usage(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t parameters) { - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(file.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(file.stream, context.set.important, " Usage:"); - fprintf(file.stream, "%c ", f_string_eol[0]); + fprintf(file.stream, "%c ", f_string_eol_s[0]); fl_color_print(file.stream, context.set.standout, name); fprintf(file.stream, " "); @@ -82,7 +82,7 @@ extern "C" { fl_color_print(file.stream, context.set.notable, "]"); } - fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(file.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); return F_none; } @@ -91,7 +91,7 @@ extern "C" { #ifndef _di_fll_program_print_version_ f_return_status fll_program_print_version(const f_file_t file, const f_string_t version) { - fprintf(file.stream, "%s%c", version, f_string_eol[0]); + fprintf(file.stream, "%s%c", version, f_string_eol_s[0]); return F_none; } diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 31f1dac..80885cc 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); @@ -28,18 +28,18 @@ extern "C" { 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(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(output.stream, context.set.important, " Special Options: "); @@ -53,23 +53,23 @@ extern "C" { 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(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); 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(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); 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(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); 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(output.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); return F_none; } @@ -89,8 +89,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fll_error_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true); @@ -208,7 +223,7 @@ extern "C" { if (data->parameters[byte_dump_parameter_width].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -228,7 +243,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "0"); fl_color_print(data->error.to.stream, data->context.set.error, " and "); fl_color_print(data->error.to.stream, data->context.set.notable, "251"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -240,7 +255,7 @@ extern "C" { if (data->parameters[byte_dump_parameter_first].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -260,7 +275,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "0"); fl_color_print(data->error.to.stream, data->context.set.error, " and "); fl_color_print(data->error.to.stream, data->context.set.notable, "%llu", f_number_t_size_unsigned); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -272,7 +287,7 @@ extern "C" { if (data->parameters[byte_dump_parameter_last].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -292,7 +307,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "0"); fl_color_print(data->error.to.stream, data->context.set.error, " and "); fl_color_print(data->error.to.stream, data->context.set.notable, "%llu", f_number_t_size_unsigned); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); fl_color_print(data->error.to.stream, data->context.set.error, "' value cannot be greater than the parameter '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fl_color_print(data->error.to.stream, data->context.set.error, "' value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' value.%c", f_string_eol_s[0]); byte_dump_delete_data(data); return F_status_set_error(status); @@ -322,7 +337,7 @@ extern "C" { file.id = f_type_descriptor_input; - printf("%c", f_string_eol[0]); + printf("%c", f_string_eol_s[0]); fl_color_print(data->output.stream, data->context.set.title, "Piped Byte Dump: (in "); if (data->mode == byte_dump_mode_hexidecimal) { @@ -341,7 +356,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.title, "Decimal"); } - fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol[0]); + fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol_s[0]); status = byte_dump_file(*data, "-", file); @@ -392,7 +407,7 @@ extern "C" { return status; } - printf("%c", f_string_eol[0]); + printf("%c", f_string_eol_s[0]); fl_color_print(data->output.stream, data->context.set.title, "Byte Dump of: "); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.argv[data->remaining.array[counter]]); fl_color_print(data->output.stream, data->context.set.title, " (in "); @@ -413,7 +428,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.title, "Decimal"); } - fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol[0]); + fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol_s[0]); status = byte_dump_file(*data, arguments.argv[data->remaining.array[counter]], file); @@ -432,7 +447,7 @@ extern "C" { } } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more filenames.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more filenames.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 32318cb..eb86b57 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -202,11 +202,11 @@ extern "C" { byte_dump_print_text(data, characters, invalid, &previous, &offset); } else { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); // make sure to flush standard out to help prevent standard error from causing poblems. fflush(data.output.stream); @@ -215,7 +215,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "Invalid UTF-8 codes were detected for file '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", file_name); fl_color_print(data.error.to.stream, data.context.set.error, "'."); - fprintf(data.error.to.stream, "%c%c", f_string_eol[0], f_string_eol[0]); + fprintf(data.error.to.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); } if (size < 0) { @@ -223,7 +223,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.error, "%sread() failed for '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", file_name); fl_color_print(data.error.to.stream, data.context.set.error, "'."); - fprintf(data.error.to.stream, "%c%x", f_string_eol[0], f_string_eol[0]); + fprintf(data.error.to.stream, "%c%x", f_string_eol_s[0], f_string_eol_s[0]); status = F_status_set_error(F_failure); } @@ -399,7 +399,7 @@ extern "C" { byte_dump_print_text(data, characters, invalid, previous, offset); } else { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } cell->column = 0; @@ -828,7 +828,7 @@ extern "C" { } fl_color_print(data.output.stream, data.context.set.notable, " |"); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } #endif // _di_byte_dump_file_ diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index 0048352..f592ca8 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -47,38 +47,26 @@ extern "C" { data->warning.notable = data->context.set.notable; } else { - data->context.set.warning.before = &f_color_set_string_null_s; - data->context.set.warning.after = &f_color_set_string_null_s; - data->context.set.error.before = &f_color_set_string_null_s; - data->context.set.error.after = &f_color_set_string_null_s; - data->context.set.title.before = &f_color_set_string_null_s; - data->context.set.title.after = &f_color_set_string_null_s; - data->context.set.notable.before = &f_color_set_string_null_s; - data->context.set.notable.after = &f_color_set_string_null_s; - data->context.set.important.before = &f_color_set_string_null_s; - data->context.set.important.after = &f_color_set_string_null_s; - data->context.set.standout.before = &f_color_set_string_null_s; - data->context.set.standout.after = &f_color_set_string_null_s; - data->context.set.normal.before = &f_color_set_string_null_s; - data->context.set.normal.after = &f_color_set_string_null_s; - data->context.set.normal_reset.before = &f_color_set_string_null_s; - data->context.set.normal_reset.after = &f_color_set_string_null_s; - - data->error.context.before = &f_color_set_string_null_s; - data->error.context.after = &f_color_set_string_null_s; - data->error.notable.before = &f_color_set_string_null_s; - data->error.notable.after = &f_color_set_string_null_s; - - data->warning.context.before = &f_color_set_string_null_s; - data->warning.context.after = &f_color_set_string_null_s; - data->warning.notable.before = &f_color_set_string_null_s; - data->warning.notable.after = &f_color_set_string_null_s; + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + + data->warning.context = f_color_set_empty_s; + data->warning.notable = f_color_set_empty_s; } if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } control_delete_data(data); @@ -135,7 +123,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 88c1ab7..30d38e7 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -41,7 +41,7 @@ extern "C" { fprintf(output.stream, " operation and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, controller_long_validate); fprintf(output.stream, " operation are specified, then additional information on each would be executed rule is printed."); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -68,32 +68,20 @@ extern "C" { data->warning.notable = data->context.set.notable; } else { - data->context.set.warning.before = &f_color_set_string_null_s; - data->context.set.warning.after = &f_color_set_string_null_s; - data->context.set.error.before = &f_color_set_string_null_s; - data->context.set.error.after = &f_color_set_string_null_s; - data->context.set.title.before = &f_color_set_string_null_s; - data->context.set.title.after = &f_color_set_string_null_s; - data->context.set.notable.before = &f_color_set_string_null_s; - data->context.set.notable.after = &f_color_set_string_null_s; - data->context.set.important.before = &f_color_set_string_null_s; - data->context.set.important.after = &f_color_set_string_null_s; - data->context.set.standout.before = &f_color_set_string_null_s; - data->context.set.standout.after = &f_color_set_string_null_s; - data->context.set.normal.before = &f_color_set_string_null_s; - data->context.set.normal.after = &f_color_set_string_null_s; - data->context.set.normal_reset.before = &f_color_set_string_null_s; - data->context.set.normal_reset.after = &f_color_set_string_null_s; - - data->error.context.before = &f_color_set_string_null_s; - data->error.context.after = &f_color_set_string_null_s; - data->error.notable.before = &f_color_set_string_null_s; - data->error.notable.after = &f_color_set_string_null_s; - - data->warning.context.before = &f_color_set_string_null_s; - data->warning.context.after = &f_color_set_string_null_s; - data->warning.notable.before = &f_color_set_string_null_s; - data->warning.notable.after = &f_color_set_string_null_s; + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + + data->warning.context = f_color_set_empty_s; + data->warning.notable = f_color_set_empty_s; } if (F_status_is_error(status)) { diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 97814f2..bcba5a5 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -25,7 +25,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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."); @@ -33,14 +33,14 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(output.stream, context.set.important, " Special Options: "); @@ -51,7 +51,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(output.stream, context.set.important, " Operations: "); @@ -67,20 +67,20 @@ extern "C" { 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, "%c", f_string_eol_s[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, "%c%c", f_string_eol_s[0], f_string_eol_s[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, "%c", f_string_eol_s[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); @@ -92,7 +92,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); return F_none; } @@ -112,8 +112,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); @@ -326,10 +341,10 @@ extern "C" { } else if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->error.context, "%sThe operation '", fll_error_print_error); fl_color_print(data->error.to.stream, data->error.notable, "%s", operations_name); - fl_color_print(data->error.to.stream, data->error.context, "' failed.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->error.context, "' failed.%c", f_string_eol_s[0]); } break; @@ -339,18 +354,18 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status) || status == F_signal) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } else if (status != F_child) { - fprintf(data->output.stream, "%cAll operations complete.%c%c", f_string_eol[0], f_string_eol[0], f_string_eol[0]); + fprintf(data->output.stream, "%cAll operations complete.%c%c", f_string_eol_s[0], f_string_eol_s[0], f_string_eol_s[0]); } } } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data->error.to.stream, data->error.context, "%sYou failed to specify an operation.%c", fll_error_print_error, f_string_eol[0]); - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data->error.to.stream, data->error.context, "%sYou failed to specify an operation.%c", fll_error_print_error, f_string_eol_s[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 036022b..98e8304 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -180,9 +180,9 @@ extern "C" { f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Copying %s.", label); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_macro_string_dynamic_t_new(*status, path_source, source.used); @@ -357,7 +357,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Copied file '%s' to '%s'.%c", path_source.string, destination_file.string, f_string_eol[0]); + fprintf(data.output.stream, "Copied file '%s' to '%s'.%c", path_source.string, destination_file.string, f_string_eol_s[0]); } } else if (F_status_is_error(*status)) { @@ -430,9 +430,9 @@ extern "C" { }; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Creating base build directories."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } for (uint8_t i = 0; i < 15; i++) { @@ -457,7 +457,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Created directory '%s'.%c", directorys[i]->string, f_string_eol[0]); + fprintf(data.output.stream, "Created directory '%s'.%c", directorys[i]->string, f_string_eol_s[0]); } } // for @@ -679,11 +679,11 @@ extern "C" { if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_failure) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.error.context, "%sFailed to execute script: ", data.error.prefix); fl_color_print(data.error.to.stream, data.error.notable, "%s", path.string); fl_color_print(data.error.to.stream, data.error.context, "."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } } else { @@ -753,9 +753,9 @@ extern "C" { if (!data_build.setting.build_sources_library.used) return 0; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Compiling shared library."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -983,7 +983,7 @@ extern "C" { *status = f_file_link(parameter_file_name_micro, parameter_file_path); if (F_status_is_error_not(*status) && data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_micro, f_string_eol[0]); + fprintf(data.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_micro, f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1035,7 +1035,7 @@ extern "C" { fprintf(data.output.stream, "%s", parameter_file_name_micro); } - fprintf(data.output.stream, "'.%c", f_string_eol[0]); + fprintf(data.output.stream, "'.%c", f_string_eol_s[0]); } else if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found) { @@ -1070,9 +1070,9 @@ extern "C" { if (!data_build.setting.build_sources_library.used) return 0; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Compiling static library."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -1243,13 +1243,13 @@ extern "C" { if (environment->used + data_build.setting.environment.used > environment->size) { if (environment->used + data_build.setting.environment.used > f_array_length_t_size) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe values for the setting '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", fake_build_setting_name_environment); fl_color_print(data.error.to.stream, data.context.set.error, "' of setting file '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", data.file_data_build_settings.string); fl_color_print(data.error.to.stream, data.context.set.error, "' is too large."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } *status = F_status_set_error(F_array_too_large); @@ -1340,13 +1340,13 @@ extern "C" { for (uint8_t i = 0; i < 1; i++) { if (!settings[i]->used) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe setting '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", names[i]); fl_color_print(data.error.to.stream, data.context.set.error, "' is required but is not specified in the settings file '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", setting_file.used ? path_file : data.file_data_build_settings.string); fl_color_print(data.error.to.stream, data.context.set.error, "'."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); failed = F_true; } @@ -1577,13 +1577,13 @@ extern "C" { if (found == F_false) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe specified mode '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", modes->array[i].string); fl_color_print(data.error.to.stream, data.context.set.error, "' is not a valid mode, according to '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file); fl_color_print(data.error.to.stream, data.context.set.error, "'."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } error_printed = F_true; @@ -1656,11 +1656,11 @@ extern "C" { if (*status == F_status_set_error(F_string_too_large)) { if (data.error.verbosity != f_console_verbosity_quiet) { // @todo update FSS functions to return which setting index the problem happened on. - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sA setting in the build setting file '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file); fl_color_print(data.error.to.stream, data.context.set.error, "' is too long."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } } else if (!error_printed) { @@ -1855,7 +1855,7 @@ extern "C" { if (settings_single_source[i]->used > 1) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe setting '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]); fl_color_print(data.output.stream, data.context.set.warning, "' in the file '"); @@ -1863,7 +1863,7 @@ extern "C" { fl_color_print(data.output.stream, data.context.set.warning, "' may only have a single property, only using the first: '"); fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_source[i]->array[0].string); fl_color_print(data.output.stream, data.context.set.warning, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } @@ -1878,7 +1878,7 @@ extern "C" { *settings_single_bool[i] = F_true; if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe setting '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]); fl_color_print(data.output.stream, data.context.set.warning, "' in the file '"); @@ -1890,7 +1890,7 @@ extern "C" { fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '"); fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_common_setting_bool_yes); fl_color_print(data.output.stream, data.context.set.warning, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } } @@ -1908,7 +1908,7 @@ extern "C" { *settings_single_language[i] = fake_build_language_type_c; if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe setting '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]); fl_color_print(data.output.stream, data.context.set.warning, "' in the file '"); @@ -1922,7 +1922,7 @@ extern "C" { fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '"); fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_language_c); fl_color_print(data.output.stream, data.context.set.warning, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } } @@ -1940,7 +1940,7 @@ extern "C" { *settings_single_version[i] = fake_build_version_type_major; if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe setting '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]); fl_color_print(data.output.stream, data.context.set.warning, "' in the file '"); @@ -1954,7 +1954,7 @@ extern "C" { fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '"); fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_version_major); fl_color_print(data.output.stream, data.context.set.warning, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } } @@ -2077,7 +2077,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.error, "%sthe parameters '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled); fl_color_print(data.output.stream, data.context.set.error, "' and '"); @@ -2092,7 +2092,7 @@ extern "C" { } fl_color_print(data.output.stream, data.context.set.error, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } else { @@ -2117,7 +2117,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.error, "%sthe parameters '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled); fl_color_print(data.output.stream, data.context.set.error, "' and '"); @@ -2132,7 +2132,7 @@ extern "C" { } fl_color_print(data.output.stream, data.context.set.error, "'."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } } else { @@ -2148,7 +2148,7 @@ extern "C" { if (setting->build_language == fake_build_language_type_c || setting->build_language == fake_build_language_type_cpp) { if (setting->build_shared == F_false && setting->build_static == F_false) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe build settings '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", fake_build_setting_name_build_shared); fl_color_print(data.error.to.stream, data.context.set.error, "' and '"); @@ -2163,7 +2163,7 @@ extern "C" { } fl_color_print(data.error.to.stream, data.context.set.error, "'."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -2319,9 +2319,9 @@ extern "C" { if (!data_build.setting.build_sources_library.used) return 0; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Compiling static objects."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -2407,11 +2407,11 @@ extern "C" { if (*status == F_false) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe path '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination_path.string); fl_color_print(data.error.to.stream, data.context.set.error, "' exists but is not a directory."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -2422,11 +2422,11 @@ extern "C" { if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found_not) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe path '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination_path.string); fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } else { fll_error_file_print(data.error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path.string, "create", fll_error_file_type_directory); @@ -2436,7 +2436,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Directory '%s' created.%c", destination_path.string, f_string_eol[0]); + fprintf(data.output.stream, "Directory '%s' created.%c", destination_path.string, f_string_eol_s[0]); } } else if (F_status_is_error(*status)) { @@ -2532,7 +2532,7 @@ extern "C" { if (F_status_is_fine(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); 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) { @@ -2542,7 +2542,7 @@ extern "C" { } fl_color_print(data->output.stream, data->context.set.important, "."); - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -2661,9 +2661,9 @@ extern "C" { if (!data_build.setting.build_sources_program.used) return 0; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Compiling shared program."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -2763,9 +2763,9 @@ extern "C" { if (!data_build.setting.build_sources_program.used) return 0; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Compiling static program."); - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; diff --git a/level_3/fake/c/private-clean.c b/level_3/fake/c/private-clean.c index 8a5a3a6..2e60817 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -14,10 +14,10 @@ extern "C" { f_status_t status = F_none; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.important, "Deleting all files within build directory '"); fl_color_print(data.output.stream, data.context.set.notable, "%s", data.path_build.string); - fl_color_print(data.output.stream, data.context.set.important, "'.%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.important, "'.%c", f_string_eol_s[0]); } if (fake_signal_received(data)) { @@ -33,7 +33,7 @@ extern "C" { if (F_status_set_fine(status) == F_file_found_not) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "The build directory '%s' does not exist.%c", data.path_build.string, f_string_eol[0]); + fprintf(data.output.stream, "The build directory '%s' does not exist.%c", data.path_build.string, f_string_eol_s[0]); } status = F_none; @@ -56,7 +56,7 @@ extern "C" { if (!result) { // @todo in order to get this working, the recursive function that calls this needs to be rewritten with more flexibility or provide a higher-level equivalent function. - printf("Removed '%s'.%c", path, f_string_eol[0]); + printf("Removed '%s'.%c", path, f_string_eol_s[0]); } return result; diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 1e25980..d979456 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -21,7 +21,7 @@ extern "C" { fprintf(data.output.stream, " %s", arguments.array[i].string); } // for - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); // flush to stdout before executing command. fflush(data.output.stream); @@ -66,10 +66,10 @@ extern "C" { if (F_status_set_fine(*status) == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to find program '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", program.used ? program.string : f_string_empty_s); - fl_color_print(data.error.to.stream, data.context.set.error, "' for executing.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' for executing.%c", f_string_eol_s[0]); } } else { @@ -649,10 +649,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -660,12 +660,12 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process); fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.argv[location]); - fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol_s[0]); } return F_status_set_error(F_parameter); @@ -678,10 +678,10 @@ extern "C" { if (F_status_is_error(status)) { if (status == F_status_set_error(F_string_too_large)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print(data->error.to.stream, data->context.set.error, "' is too long.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' is too long.%c", f_string_eol_s[0]); } } else { @@ -697,10 +697,10 @@ extern "C" { if (length == 0 || status == F_data_not) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty and must not contain only whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty and must not contain only whitespace.%c", f_string_eol_s[0]); } } } @@ -775,10 +775,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -789,10 +789,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "f_macro_string_dynamic_t_new", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to load default for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -809,10 +809,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -832,10 +832,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "f_utf_is_word", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -843,12 +843,12 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s", data->define.array[i].string); - fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word characters.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word characters.%c", f_string_eol_s[0]); } return F_status_set_error(F_parameter); @@ -866,10 +866,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -889,10 +889,10 @@ extern "C" { if (F_status_is_error(status)) { if (fll_error_print(data->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to process the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol_s[0]); } return status; @@ -900,12 +900,12 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s", data->mode.array[i].string); - fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol_s[0]); } return F_status_set_error(F_parameter); @@ -942,9 +942,9 @@ extern "C" { case F_signal_termination: if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } return F_true; @@ -1017,10 +1017,10 @@ extern "C" { } } else if (parameters_required[i]) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sNo valid path for the (required) directory parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print(data.error.to.stream, data.context.set.error, "' was found.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was found.%c", f_string_eol_s[0]); return F_status_set_error(F_directory_found_not); } @@ -1032,19 +1032,19 @@ extern "C" { #ifndef _di_fake_verbose_print_clone_ void fake_verbose_print_clone(const f_file_t output, const f_string_t source, const f_string_t destination) { - fprintf(output.stream, "Cloned '%s' to '%s'.%c", source, destination, f_string_eol[0]); + fprintf(output.stream, "Cloned '%s' to '%s'.%c", source, destination, f_string_eol_s[0]); } #endif // _di_fake_verbose_print_clone_ #ifndef _di_fake_verbose_print_copy_ void fake_verbose_print_copy(const f_file_t output, const f_string_t source, const f_string_t destination) { - fprintf(output.stream, "Copied '%s' to '%s'.%c", source, destination, f_string_eol[0]); + fprintf(output.stream, "Copied '%s' to '%s'.%c", source, destination, f_string_eol_s[0]); } #endif // _di_fake_verbose_print_copy_ #ifndef _di_fake_verbose_print_move_ void fake_verbose_print_move(const f_file_t output, const f_string_t source, const f_string_t destination) { - fprintf(output.stream, "Moved '%s' to '%s'.%c", source, destination, f_string_eol[0]); + fprintf(output.stream, "Moved '%s' to '%s'.%c", source, destination, f_string_eol_s[0]); } #endif // _di_fake_verbose_print_move_ diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 5b5a586..606956b 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -63,10 +63,10 @@ extern "C" { } else if (status == F_exist_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, error.context, "%sThe group name '", error.prefix); fl_color_print(error.to.stream, error.notable, "%s", buffer.string); - fl_color_print(error.to.stream, error.context, "' was not found.%c", f_string_eol[0]); + fl_color_print(error.to.stream, error.context, "' was not found.%c", f_string_eol_s[0]); } return F_status_set_error(F_failure); @@ -80,10 +80,10 @@ extern "C" { } else if (number > f_type_size_32_unsigned) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, error.context, "%sThe number '", error.prefix); fl_color_print(error.to.stream, error.notable, "%llu", number); - fl_color_print(error.to.stream, error.context, "' is too large.%c", f_string_eol[0]); + fl_color_print(error.to.stream, error.context, "' is too large.%c", f_string_eol_s[0]); } } @@ -104,10 +104,10 @@ extern "C" { if (F_status_is_error(status)) { if (data.error.verbosity != f_console_verbosity_quiet) { if (F_status_set_fine(status) == F_syntax) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, error.context, "%sThe mode '", error.prefix); fl_color_print(error.to.stream, error.notable, "%s", buffer.string); - fl_color_print(error.to.stream, error.context, "' is invalid.%c", f_string_eol[0]); + fl_color_print(error.to.stream, error.context, "' is invalid.%c", f_string_eol_s[0]); } else { fll_error_print(error, status, "f_file_mode_from_string", F_true); @@ -141,10 +141,10 @@ extern "C" { } else if (status == F_exist_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, error.context, "%sThe user '", error.prefix); fl_color_print(error.to.stream, error.notable, "%s", buffer.string); - fl_color_print(error.to.stream, error.context, "' was not found.%c", f_string_eol[0]); + fl_color_print(error.to.stream, error.context, "' was not found.%c", f_string_eol_s[0]); } return F_status_set_error(F_failure); @@ -158,10 +158,10 @@ extern "C" { } else if (number > f_type_size_32_unsigned) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, error.context, "%sThe number '", error.prefix); fl_color_print(error.to.stream, error.notable, "%llu", number); - fl_color_print(error.to.stream, error.context, "' is too large.%c", f_string_eol[0]); + fl_color_print(error.to.stream, error.context, "' is too large.%c", f_string_eol_s[0]); } } @@ -189,7 +189,7 @@ extern "C" { if (!data_make->buffer.used) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe fakefile '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", data.file_data_build_fakefile.string); fl_color_print(data.output.stream, data.context.set.warning, "' is empty."); @@ -335,12 +335,12 @@ extern "C" { if (missing_main) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.error.context, "%sThe fakefile '", data.error.prefix); fl_color_print(data.error.to.stream, data.error.notable, "%s", data.file_data_build_fakefile.string); fl_color_print(data.error.to.stream, data.error.context, "' is missing the required '"); fl_color_print(data.error.to.stream, data.error.notable, "%s", fake_make_section_main); - fl_color_print(data.error.to.stream, data.error.context, "' object.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.error.context, "' object.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -469,17 +469,17 @@ extern "C" { data_make->setting_build.environment.used++; } else if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sThe environment name '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", name_define.string); - fl_color_print(data.output.stream, data.context.set.warning, "' is already added.%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.warning, "' is already added.%c", f_string_eol_s[0]); } } else if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sThe environment name '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", name_define.string); - fl_color_print(data.output.stream, data.context.set.warning, "' is invalid, ignoring.%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.warning, "' is invalid, ignoring.%c", f_string_eol_s[0]); } name_define.used = 0; @@ -731,14 +731,14 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid characters in the define setting name '", fll_error_print_error); fl_color_print_code(data.error.to.stream, *data.error.notable.before); f_print_dynamic(data.error.to.stream, define.array[i].name); fl_color_print_code(data.error.to.stream, *data.error.notable.after); - fl_color_print(data.error.to.stream, data.context.set.error, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is %c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is %c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -1055,8 +1055,8 @@ extern "C" { } if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->output.stream, "%c", f_string_eol[0]); - fl_color_print(data->output.stream, data->context.set.important, "Making project.%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); + fl_color_print(data->output.stream, data->context.set.important, "Making project.%c", f_string_eol_s[0]); } f_status_t status = F_none; @@ -1149,12 +1149,12 @@ extern "C" { f_status_t status_path = f_path_change_at(data_make.path.top.id); if (F_status_is_error(status_path) && data->error.verbosity == f_console_verbosity_verbose) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fl_color_print(data->output.stream, data->context.set.warning, "%sFailed change back to orignal path '", fll_error_print_warning); fl_color_print(data->output.stream, data->context.set.notable, "%s", data_make.path.stack.array[0].string); fl_color_print(data->output.stream, data->context.set.warning, "', status code = "); fl_color_print(data->output.stream, data->context.set.notable, "%llu", F_status_set_fine(status_path)); - fl_color_print(data->output.stream, data->context.set.warning, ".%c", f_string_eol[0]); + fl_color_print(data->output.stream, data->context.set.warning, ".%c", f_string_eol_s[0]); } } @@ -1921,7 +1921,7 @@ extern "C" { const f_fss_named_t *section = &data_make->fakefile.array[id_section]; if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fl_color_print(data->output.stream, data->context.set.important, "Processing Section '"); @@ -1929,7 +1929,7 @@ extern "C" { f_print_dynamic_partial(data->output.stream, data_make->buffer, section->name); fl_color_print_code(data->output.stream, *data->context.set.notable.after); - fl_color_print(data->output.stream, data->context.set.important, "'.%c", f_string_eol[0]); + fl_color_print(data->output.stream, data->context.set.important, "'.%c", f_string_eol_s[0]); } if (!section->objects.used) { @@ -2251,10 +2251,10 @@ extern "C" { type_name = fake_make_operation_else; } - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sIncomplete '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", type_name); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' at end of section.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' at end of section.%c", f_string_eol_s[0]); } fake_print_message_section_operation_failed(*data, data_make->error, data_make->buffer, section->name, section->objects.array[section->objects.used - 1]); @@ -2312,7 +2312,7 @@ extern "C" { if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "Breaking as '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -2427,7 +2427,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", destination); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } } else if (F_status_is_error(status_file)) { @@ -2531,7 +2531,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", destination); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } } else if (F_status_is_error(status_file)) { @@ -2559,7 +2559,7 @@ extern "C" { else if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "Defined environment variable '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[0].string); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -2577,10 +2577,10 @@ extern "C" { if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found_not) { if (data->error.verbosity == f_console_verbosity_verbose) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fl_color_print(data->output.stream, data->context.set.warning, "%sthe file '", fll_error_print_warning); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); - fl_color_print(data->output.stream, data->context.set.warning, "' was not found.%c", f_string_eol[0]); + fl_color_print(data->output.stream, data->context.set.warning, "' was not found.%c", f_string_eol_s[0]); } *status = F_none; @@ -2602,7 +2602,7 @@ extern "C" { if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "The directory '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); - fprintf(data->output.stream, "' does not exist.%c", f_string_eol[0]); + fprintf(data->output.stream, "' does not exist.%c", f_string_eol_s[0]); } *status = F_none; @@ -2615,7 +2615,7 @@ extern "C" { else if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "Removed '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } } else { @@ -2625,7 +2625,7 @@ extern "C" { if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "The file '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); - fprintf(data->output.stream, "' does not exist.%c", f_string_eol[0]); + fprintf(data->output.stream, "' does not exist.%c", f_string_eol_s[0]); } *status = F_none; @@ -2638,7 +2638,7 @@ extern "C" { else if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "Removed '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } } } // for @@ -2681,7 +2681,7 @@ extern "C" { if (data->error.verbosity == f_console_verbosity_verbose) { fprintf(data->output.stream, "Exiting as '"); fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -2724,7 +2724,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.notable, "%s", fake_make_operation_argument_ignore); } - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -2762,7 +2762,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->output.stream, data->context.set.notable, "%llu", id); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -2801,7 +2801,7 @@ extern "C" { fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->output.stream, data->context.set.notable, "%llu", id); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -3265,17 +3265,17 @@ extern "C" { *operation_if = fake_make_operation_if_type_false_always_next; if (data->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); if ((i == 1 && number_left > f_number_t_size_unsigned) || (i > 1 && number_right > f_number_t_size_unsigned)) { fl_color_print(data->error.to.stream, data_make->error.context, "%sThe number '", data_make->error.prefix); fl_color_print(data->error.to.stream, data_make->error.notable, "%c%s", arguments.array[i].string); - fl_color_print(data->error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]); + fl_color_print(data->error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol_s[0]); } else { fl_color_print(data->error.to.stream, data_make->error.context, "%sInvalid or unsupported number provided '", data_make->error.prefix); fl_color_print(data->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } } } @@ -3297,7 +3297,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[1].string); fprintf(data->output.stream, "' to '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[0].string); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -3342,7 +3342,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->error.to.stream, data->context.set.notable, "%#o", mode); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -3388,7 +3388,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->error.to.stream, data->context.set.notable, "%#o", mode); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -3516,7 +3516,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->error.to.stream, data->context.set.notable, "%d", id); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -3555,7 +3555,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.array[i].string); fprintf(data->output.stream, "' to "); fl_color_print(data->error.to.stream, data->context.set.notable, "%d", id); - fprintf(data->output.stream, ".%c", f_string_eol[0]); + fprintf(data->output.stream, ".%c", f_string_eol_s[0]); } } // for @@ -3586,7 +3586,7 @@ extern "C" { fl_color_print_code(data->output.stream, *data->context.set.notable.before); f_print_dynamic(data->output.stream, data_make->path_cache); fl_color_print_code(data->output.stream, *data->context.set.notable.after); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } return 0; @@ -3601,7 +3601,7 @@ extern "C" { } } // for - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); return 0; } @@ -3687,7 +3687,7 @@ extern "C" { fl_color_print_code(data->output.stream, *data->context.set.notable.before); f_print_dynamic(data->output.stream, data_make->path_cache); fl_color_print_code(data->output.stream, *data->context.set.notable.after); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } data_make->path.stack.used++; @@ -3706,7 +3706,7 @@ extern "C" { } if (data->error.verbosity == f_console_verbosity_verbose) { - fprintf(data->output.stream, "Changed to project path ''.%c", f_string_eol[0]); + fprintf(data->output.stream, "Changed to project path ''.%c", f_string_eol_s[0]); } // clear stack, except for the project root. @@ -3759,7 +3759,7 @@ extern "C" { fl_color_print_code(data->output.stream, *data->context.set.notable.before); f_print_dynamic(data->output.stream, arguments.array[i]); fl_color_print_code(data->output.stream, *data->context.set.notable.after); - fprintf(data->output.stream, "'.%c", f_string_eol[0]); + fprintf(data->output.stream, "'.%c", f_string_eol_s[0]); } } // for @@ -3803,7 +3803,7 @@ extern "C" { fprintf(data.output.stream, " %s", arguments.array[i].string); } // for - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); // flush to stdout before executing command. fflush(data.output.stream); @@ -3827,10 +3827,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data_make->error.context, "%sFailed to find program '", data_make->error.prefix); fl_color_print(data.error.to.stream, data_make->error.notable, "%s", program.string); - fl_color_print(data.error.to.stream, data_make->error.context, "' for executing.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data_make->error.context, "' for executing.%c", f_string_eol_s[0]); } } else if (F_status_set_fine(status) != F_failure) { @@ -3901,10 +3901,10 @@ extern "C" { } if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data_make->error.context, "%sFailed with return code '", data_make->error.prefix); fl_color_print(data.error.to.stream, data_make->error.notable, "%s", data_make->setting_make.parameter.array[0].value.array[0].string); - fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } if (data_make->setting_make.fail == fake_make_operation_fail_type_exit) { @@ -3969,8 +3969,8 @@ extern "C" { if (operation == fake_make_operation_type_index || operation == fake_make_operation_type_run || operation == fake_make_operation_type_shell) { if (!arguments.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -3979,10 +3979,10 @@ extern "C" { if (!data_make->setting_build.build_indexer.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sNo indexer has been specified, cannot perform '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, fake_make_operation_index); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -3995,8 +3995,8 @@ extern "C" { if (operation == fake_make_operation_type_break) { if (arguments.used > 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4006,10 +4006,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure, arguments.array[0], fake_make_operation_argument_failure_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported break type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4023,8 +4023,8 @@ extern "C" { if (operation == fake_make_operation_type_build) { if (arguments.used > 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4042,10 +4042,10 @@ extern "C" { if (status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", path_file); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(status_file); @@ -4056,10 +4056,10 @@ extern "C" { } else if (!status_file) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", path_file); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a regular file.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a regular file.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4067,8 +4067,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFilename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFilename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4081,8 +4081,8 @@ extern "C" { if (operation == fake_make_operation_type_clean || operation == fake_make_operation_type_pop || operation == fake_make_operation_type_top || operation == fake_make_operation_type_skeleton) { if (arguments.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4091,8 +4091,8 @@ extern "C" { if (data_make->path.stack.used == 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sMust not attempt to pop project root off of path stack.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sMust not attempt to pop project root off of path stack.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4121,10 +4121,10 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4138,10 +4138,10 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[arguments.used - 1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4161,10 +4161,10 @@ extern "C" { if (status_file == F_false) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4174,8 +4174,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4187,18 +4187,18 @@ extern "C" { if (operation == fake_make_operation_type_compile) { if (!arguments.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); } else if (data_make->setting_build.build_compiler.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sNo compiler has been specified, cannot perform '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, fake_make_operation_compile); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4226,10 +4226,10 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4243,10 +4243,10 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[arguments.used - 1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4266,10 +4266,10 @@ extern "C" { if (status_file == F_false) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4279,8 +4279,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4306,8 +4306,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4322,22 +4322,22 @@ extern "C" { if (*status == F_none) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sDefine name must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sDefine name must not be an empty string.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); } else if (*status == F_false) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sInvalid characters in the define setting name '", data_make->error.prefix); fl_color_print_code(data_make->error.to.stream, *data_make->error.notable.before); f_print_dynamic(data_make->error.to.stream, arguments.array[0]); fl_color_print_code(data_make->error.to.stream, *data_make->error.notable.after); - fl_color_print(data_make->error.to.stream, data_make->error.context, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4345,8 +4345,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4358,10 +4358,10 @@ extern "C" { if (operation == fake_make_operation_type_else) { if (*operation_if == fake_make_operation_if_type_else_true || *operation_if == fake_make_operation_if_type_else_false) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sMust not be used after another '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "else"); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4372,10 +4372,10 @@ extern "C" { if (*operation_if == fake_make_operation_if_type_true || *operation_if == fake_make_operation_if_type_false || *operation_if == fake_make_operation_if_type_false_always) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sMust not be used inside an ", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "if"); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4386,8 +4386,8 @@ extern "C" { if (*operation_if != fake_make_operation_if_type_else_true_next && *operation_if != fake_make_operation_if_type_else_false_next && *operation_if != fake_make_operation_if_type_else_false_next_always) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas no preceding if condition.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas no preceding if condition.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4398,8 +4398,8 @@ extern "C" { if (arguments.used) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4412,8 +4412,8 @@ extern "C" { if (operation == fake_make_operation_type_exit) { if (arguments.used > 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4423,10 +4423,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure, arguments.array[0], fake_make_operation_argument_failure_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported exit type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4444,10 +4444,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported fail type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4457,8 +4457,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4477,10 +4477,10 @@ extern "C" { if (status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(status_file); @@ -4498,8 +4498,8 @@ extern "C" { } if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4510,10 +4510,10 @@ extern "C" { if (operation == fake_make_operation_type_if) { if (*operation_if == fake_make_operation_if_type_true || *operation_if == fake_make_operation_if_type_false || *operation_if == fake_make_operation_if_type_false_always) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sMust not be used after another '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "if"); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4603,10 +4603,10 @@ extern "C" { if (i == 14) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported if type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4619,8 +4619,8 @@ extern "C" { if (*operation_if == fake_make_operation_if_type_if_success || *operation_if == fake_make_operation_if_type_if_failure) { if (arguments.used > if_type_minimum[i]) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4636,10 +4636,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_is, arguments.array[1], fake_make_operation_argument_is_length) == F_equal_to_not) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_has, arguments.array[1], fake_make_operation_argument_has_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported mode type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4711,10 +4711,10 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported file type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } type_file |= 0x80; @@ -4782,10 +4782,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment, arguments.array[1], fake_make_operation_argument_environment_length) == F_equal_to_not) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter, arguments.array[1], fake_make_operation_argument_parameter_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported define type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4798,8 +4798,8 @@ extern "C" { if (*operation_if == fake_make_operation_if_type_if_equal || *operation_if == fake_make_operation_if_type_if_equal_not) { if (arguments.used < 3) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4811,8 +4811,8 @@ extern "C" { if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) { if (arguments.used < 3) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4854,17 +4854,17 @@ extern "C" { *status = F_status_set_error(F_failure); if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); if (number > f_number_t_size_unsigned) { fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe number '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%c%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol_s[0]); } else { fl_color_print(data_make->error.to.stream, data_make->error.context, "%sInvalid or unsupported number provided '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } } } @@ -4876,8 +4876,8 @@ extern "C" { } if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4889,8 +4889,8 @@ extern "C" { if (operation == fake_make_operation_type_link) { if (arguments.used > 2) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4918,8 +4918,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4947,10 +4947,10 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[i].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4964,10 +4964,10 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[arguments.used - 1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -4987,10 +4987,10 @@ extern "C" { if (status_file == F_false) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe last file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[1].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5000,8 +5000,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5013,8 +5013,8 @@ extern "C" { if (operation == fake_make_operation_type_operate) { if (arguments.used > 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5030,23 +5030,23 @@ extern "C" { } // for if (id_section == data_make->fakefile.used) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sNo operation section named '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' was found.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' was found.%c", f_string_eol_s[0]); } else { for (f_array_length_t i = 0; i < section_stack->used; i++) { if (section_stack->array[i] == id_section) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe section operation '", data_make->error.prefix); fl_color_print_code(data_make->error.to.stream, *data_make->error.notable.before); f_print_dynamic_partial(data_make->error.to.stream, data_make->buffer, data_make->fakefile.array[id_section].name); fl_color_print_code(data_make->error.to.stream, *data_make->error.notable.after); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' is already in the operation stack, recursion is not allowed.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' is already in the operation stack, recursion is not allowed.%c", f_string_eol_s[0]); *status = F_status_set_error(F_failure); break; @@ -5056,8 +5056,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5068,8 +5068,8 @@ extern "C" { if (operation == fake_make_operation_type_to) { if (arguments.used > 1) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sHas too many arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5080,10 +5080,10 @@ extern "C" { if (status_file == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFailed to find file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(status_file); @@ -5097,10 +5097,10 @@ extern "C" { } else if (!status_file) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sThe file '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a directory file.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "' must be a directory file.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5108,15 +5108,15 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFilename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sFilename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol_s[0]); } } } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5131,10 +5131,10 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_directory, arguments.array[0], fake_make_operation_argument_directory_length) == F_equal_to_not) { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data_make->error.to.stream, data_make->error.context, "%sUnsupported file type '", data_make->error.prefix); fl_color_print(data_make->error.to.stream, data_make->error.notable, "%s", arguments.array[0].string); - fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "'.%c", f_string_eol_s[0]); } *status = F_status_set_error(F_failure); @@ -5156,8 +5156,8 @@ extern "C" { } else { if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) { - fprintf(data_make->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol[0]); + fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data_make->error.to.stream, data_make->error.context, "%sRequires more arguments.%c", data_make->error.prefix, f_string_eol_s[0]); } *status = F_status_set_error(F_failure); diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index e553ead..25f6433 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -14,7 +14,7 @@ extern "C" { if (status == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to find '", fll_error_print_error); if (f_file_exists(source) == F_true) { @@ -32,7 +32,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -40,7 +40,7 @@ extern "C" { if (status == F_parameter) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling ", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function); fl_color_print(data.error.to.stream, data.context.set.error, "() to %s '", operation); @@ -51,7 +51,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -59,7 +59,7 @@ extern "C" { if (status == F_name) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid name for '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -68,7 +68,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -76,7 +76,7 @@ extern "C" { if (status == F_memory_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory, while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -85,7 +85,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -94,7 +94,7 @@ extern "C" { if (status == F_number_overflow) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sOverflow while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -103,7 +103,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -111,7 +111,7 @@ extern "C" { if (status == F_directory) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid directory while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -120,7 +120,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -128,7 +128,7 @@ extern "C" { if (status == F_access_denied) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sAccess denied while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -137,7 +137,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -145,7 +145,7 @@ extern "C" { if (status == F_loop) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sLoop while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -154,7 +154,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -162,7 +162,7 @@ extern "C" { if (status == F_prohibited) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sProhibited by system while trying to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -171,7 +171,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; @@ -179,7 +179,7 @@ extern "C" { if (status == F_directory_found_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -188,7 +188,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' due to an invalid directory in the path.%c", f_string_eol_s[0]); } return F_false; @@ -196,7 +196,7 @@ extern "C" { if (status == F_failure) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to %s '", fll_error_print_error, operation); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source); @@ -205,14 +205,14 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_false; } if (fll_error_print(data.error, status, function, F_false) == F_known_not && fallback && data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "UNKNOWN %s(", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status); fl_color_print(data.error.to.stream, data.context.set.error, ") occurred while trying to %s '", operation); @@ -223,7 +223,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination); } - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } return F_true; @@ -235,12 +235,12 @@ extern "C" { if (status == F_file_found_not) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%serror occurred on invalid UTF-8 character at stop position (at ", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%d", range.start); fl_color_print(data.error.to.stream, data.context.set.error, " of setting file '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file); - fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol_s[0]); } return F_false; @@ -248,24 +248,24 @@ extern "C" { if (status == F_status_set_error(F_complete_not_utf_stop)) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%serror occurred on invalid UTF-8 character at end of string (at ", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%d", range.start); fl_color_print(data.error.to.stream, data.context.set.error, " of setting file '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file); - fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol_s[0]); } return F_false; } if (fll_error_print(data.error, status, function, F_false) == F_known_not && fallback && data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "UNKNOWN %s(", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status); fl_color_print(data.error.to.stream, data.context.set.error, ") in function "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function); - fl_color_print(data.error.to.stream, data.context.set.error, "().%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "().%c", f_string_eol_s[0]); } return F_true; @@ -276,12 +276,12 @@ extern "C" { void fake_print_error_parameter_missing_value(const fake_data_t data, const f_string_t parameter) { if (data.error.verbosity == f_console_verbosity_quiet) return; - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fake_print_error_parameter_missing_value_ @@ -289,12 +289,12 @@ extern "C" { void fake_print_error_parameter_too_many(const fake_data_t data, const f_string_t parameter) { if (data.error.verbosity == f_console_verbosity_quiet) return; - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' specified too many times.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' specified too many times.%c", f_string_eol_s[0]); } #endif // _di_fake_print_error_parameter_too_many_ @@ -306,7 +306,7 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, data.error.context, "%sThe section operation '", data.error.prefix); fl_color_print_code(error.to.stream, data.context.notable); @@ -321,7 +321,7 @@ extern "C" { fl_color_print(error.to.stream, data.error.context, "' on line "); fl_color_print(error.to.stream, data.context.set.notable, "%llu", line); - fl_color_print(error.to.stream, data.error.context, " failed.%c", f_string_eol[0]); + fl_color_print(error.to.stream, data.error.context, " failed.%c", f_string_eol_s[0]); } #endif // _di_fake_print_message_section_operation_failed_ @@ -330,10 +330,10 @@ extern "C" { if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; if (F_status_set_fine(status) == F_false) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, data.error.context, "%sThe path '", data.error.prefix); fl_color_print(error.to.stream, data.context.set.notable, "%s", path); - fl_color_print(error.to.stream, data.error.context, "' is outside the project root.%c", f_string_eol[0]); + fl_color_print(error.to.stream, data.error.context, "' is outside the project root.%c", f_string_eol_s[0]); } else { fll_error_file_print(data.error, F_status_set_fine(status), function, F_true, path, "determine real path of", fll_error_file_type_file); @@ -346,7 +346,7 @@ extern "C" { if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return; if (status == F_array_too_large) { - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, data.error.context, "%s: Maximum stack size reached while processing path '", data.error.prefix); fl_color_print(error.to.stream, data.context.set.notable, "%s", path); fl_color_print(error.to.stream, data.error.context, "'"); @@ -357,7 +357,7 @@ extern "C" { fl_color_print(error.to.stream, data.error.context, "()"); } - fl_color_print(error.to.stream, data.error.context, ".%c", f_string_eol[0]); + fl_color_print(error.to.stream, data.error.context, ".%c", f_string_eol_s[0]); } else { fll_error_file_print(error, status, function, F_true, path, "change path to", fll_error_file_type_directory); @@ -373,7 +373,7 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, data.error.context, "The section operation '", data.error.prefix); fl_color_print_code(error.to.stream, data.context.notable); @@ -390,7 +390,7 @@ extern "C" { fl_color_print(error.to.stream, data.context.set.notable, "%llu", line); fl_color_print(error.to.stream, data.error.context, " cannot be processed because the max stack depth of "); fl_color_print(error.to.stream, data.context.set.notable, "%llu", stack_max); - fl_color_print(error.to.stream, data.error.context, " has been reached.%c", f_string_eol[0]); + fl_color_print(error.to.stream, data.error.context, " has been reached.%c", f_string_eol_s[0]); } #endif // _di_fake_print_message_section_operation_stack_max_ @@ -402,7 +402,7 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); - fprintf(error.to.stream, "%c", f_string_eol[0]); + fprintf(error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(error.to.stream, data.error.context, "%sThe section operation '", data.error.prefix); fl_color_print_code(error.to.stream, data.context.notable); @@ -417,7 +417,7 @@ extern "C" { fl_color_print(error.to.stream, data.error.context, "' on line "); fl_color_print(error.to.stream, data.context.set.notable, "%llu", line); - fl_color_print(error.to.stream, data.error.context, " is not a known operation name.%c", f_string_eol[0]); + fl_color_print(error.to.stream, data.error.context, " is not a known operation name.%c", f_string_eol_s[0]); } #endif // _di_fake_print_message_section_operation_unknown_ @@ -425,7 +425,7 @@ extern "C" { void fake_print_warning_settings_content_empty(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) { if (data.error.verbosity == f_console_verbosity_quiet) return; - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(f_type_warning, data.context.set.warning, "%sthe fakefile '", fll_error_print_warning); fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file); @@ -437,7 +437,7 @@ extern "C" { f_print_dynamic_partial(f_type_warning, buffer, range_object); fl_color_print_code(f_type_warning, data.context.reset); - fl_color_print(f_type_warning, data.context.set.warning, "'.%c", f_string_eol[0]); + fl_color_print(f_type_warning, data.context.set.warning, "'.%c", f_string_eol_s[0]); } #endif // _di_fake_print_warning_settings_content_empty_ @@ -445,7 +445,7 @@ extern "C" { void fake_print_warning_settings_content_invalid(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) { if (data.error.verbosity == f_console_verbosity_quiet) return; - fprintf(data.output.stream, "%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); fl_color_print(data.output.stream, data.context.set.warning, "%sthe fakefile '", fll_error_print_warning); fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file); @@ -463,7 +463,7 @@ extern "C" { f_print_dynamic_partial(data.output.stream, buffer, range_object); fl_color_print_code(data.output.stream, data.context.reset); - fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]); + fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol_s[0]); } #endif // _di_fake_print_warning_settings_content_invalid_ @@ -471,14 +471,14 @@ extern "C" { void fake_print_warning_settings_content_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t name_object) { if (data.error.verbosity != f_console_verbosity_verbose) return; - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(f_type_warning, data.context.set.warning, "%sthe setting '", fll_error_print_warning); fl_color_print(f_type_warning, data.context.set.notable, "%s", name_object); fl_color_print(f_type_warning, data.context.set.warning, "' in the file '"); fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file); - fl_color_print(f_type_warning, data.context.set.warning, "' may only have a single property, only using the first.%c", f_string_eol[0]); + fl_color_print(f_type_warning, data.context.set.warning, "' may only have a single property, only using the first.%c", f_string_eol_s[0]); } #endif // _di_fake_print_warning_settings_content_multiple_ @@ -486,14 +486,14 @@ extern "C" { void fake_print_warning_settings_object_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t label, const f_string_t name_object) { if (data.error.verbosity != f_console_verbosity_verbose) return; - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(f_type_warning, data.context.set.warning, "%sthe %s object '", fll_error_print_warning, label); fl_color_print(f_type_warning, data.context.set.notable, "%s", name_object); fl_color_print(f_type_warning, data.context.set.warning, "' in the file '"); fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file); - fl_color_print(f_type_warning, data.context.set.warning, "' may only be specified once, only using the first.%c", f_string_eol[0]); + fl_color_print(f_type_warning, data.context.set.warning, "' may only be specified once, only using the first.%c", f_string_eol_s[0]); } #endif // _di_fake_print_warning_settings_object_multiple_ diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index 0cc08a1..53d6716 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -19,8 +19,8 @@ extern "C" { f_status_t status = F_none; if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.output.stream, "%c", f_string_eol[0]); - fl_color_print(data.output.stream, data.context.set.important, "Generating skeleton structure.%c", f_string_eol[0]); + fprintf(data.output.stream, "%c", f_string_eol_s[0]); + fl_color_print(data.output.stream, data.context.set.important, "Generating skeleton structure.%c", f_string_eol_s[0]); } { @@ -166,7 +166,7 @@ extern "C" { if (status == F_true) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Directory '%s' already exists.%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "Directory '%s' already exists.%c", path.string, f_string_eol_s[0]); } return F_none; @@ -174,10 +174,10 @@ extern "C" { if (status == F_false) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe path '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string); - fl_color_print(data.error.to.stream, data.context.set.error, "' exists but is not a directory.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' exists but is not a directory.%c", f_string_eol_s[0]); } return F_status_set_warning(F_failure); @@ -187,10 +187,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe path '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string); - fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol_s[0]); } else { fll_error_file_print(data.error, F_status_set_fine(status), "f_directory_create", F_true, path.string, "create", fll_error_file_type_directory); @@ -200,7 +200,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "Directory '%s' created.%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "Directory '%s' created.%c", path.string, f_string_eol_s[0]); } } else if (F_status_is_error(status)) { @@ -222,7 +222,7 @@ extern "C" { if (status == F_true) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "File '%s' already exists.%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "File '%s' already exists.%c", path.string, f_string_eol_s[0]); } return F_none; @@ -234,7 +234,7 @@ extern "C" { if (status == F_true) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "File '%s' already exists (as a symbolic link).%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "File '%s' already exists (as a symbolic link).%c", path.string, f_string_eol_s[0]); } return F_none; @@ -243,7 +243,7 @@ extern "C" { if (status == F_false) { if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "File '%s' already exists but is not a regular file (or symbolic link).%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "File '%s' already exists but is not a regular file (or symbolic link).%c", path.string, f_string_eol_s[0]); } return F_status_set_warning(F_none); @@ -259,10 +259,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe file '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string); - fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol_s[0]); } else { fll_error_file_print(data.error, F_status_set_fine(status), "f_file_create", F_true, path.string, "create", fll_error_file_type_file); @@ -272,7 +272,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "File '%s' created.%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "File '%s' created.%c", path.string, f_string_eol_s[0]); } if (content.used) { @@ -299,7 +299,7 @@ extern "C" { } if (data.error.verbosity == f_console_verbosity_verbose) { - fprintf(data.output.stream, "File '%s' pre-populated.%c", path.string, f_string_eol[0]); + fprintf(data.output.stream, "File '%s' pre-populated.%c", path.string, f_string_eol_s[0]); } f_file_stream_close(F_true, &file); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 844c7f0..d21f8e3 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -26,26 +26,26 @@ extern "C" { 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%c", f_string_eol[0], f_string_eol[0]); + fprintf(output.stream, "%c%c", f_string_eol_s[0], f_string_eol_s[0]); fl_color_print(output.stream, context.set.important, " Available Commands: "); - fprintf(output.stream, "%c ", f_string_eol[0]); + fprintf(output.stream, "%c ", f_string_eol_s[0]); fl_color_print(output.stream, context.set.standout, firewall_command_start); fprintf(output.stream, " Turn on the firewall"); - fprintf(output.stream, "%c ", f_string_eol[0]); + fprintf(output.stream, "%c ", f_string_eol_s[0]); fl_color_print(output.stream, context.set.standout, firewall_command_stop); fprintf(output.stream, " Turn off the firewall"); - fprintf(output.stream, "%c ", f_string_eol[0]); + fprintf(output.stream, "%c ", f_string_eol_s[0]); fl_color_print(output.stream, context.set.standout, firewall_command_restart); fprintf(output.stream, " Turn off and then turn on the firewall"); - fprintf(output.stream, "%c ", f_string_eol[0]); + fprintf(output.stream, "%c ", f_string_eol_s[0]); fl_color_print(output.stream, context.set.standout, firewall_command_lock); fprintf(output.stream, " Prevent all communication"); - fprintf(output.stream, "%c ", f_string_eol[0]); + fprintf(output.stream, "%c ", f_string_eol_s[0]); fl_color_print(output.stream, context.set.standout, firewall_command_show); fprintf(output.stream, " Show active firewall settings"); @@ -68,8 +68,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { firewall_delete_data(data); @@ -204,7 +219,7 @@ extern "C" { if (strncmp("nat", arguments.argv[data->remaining.array[counter]], 4) != 0) { if (strncmp("mangle", arguments.argv[data->remaining.array[counter]], 7) != 0) { if (strncmp("ports", arguments.argv[data->remaining.array[counter]], 6) != 0) { - fl_color_print(f_type_warning, data->context.set.warning, "%s'%s' is not a valid show option%c", fll_error_print_warning, arguments.argv[data->remaining.array[counter]], f_string_eol[0]); + fl_color_print(f_type_warning, data->context.set.warning, "%s'%s' is not a valid show option%c", fll_error_print_warning, arguments.argv[data->remaining.array[counter]], f_string_eol_s[0]); } else { show_ports = F_true; @@ -223,7 +238,7 @@ extern "C" { f_macro_string_dynamics_t_resize(status, parameters, 7); if (F_status_is_error(status)) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -232,7 +247,7 @@ extern "C" { if (show_nat) { 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]); + fl_color_print(data->output.stream, data->context.set.standout, " ============================%c", f_string_eol_s[0]); fflush(data->output.stream); parameters.used = 6; @@ -265,7 +280,7 @@ extern "C" { if (F_status_is_error_not(status) && show_mangle) { 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]); + fl_color_print(data->output.stream, data->context.set.standout, " ==========================%c", f_string_eol_s[0]); fflush(data->output.stream); parameters.used = 6; @@ -298,7 +313,7 @@ extern "C" { if (F_status_is_error_not(status) && show_ports) { 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]); + fl_color_print(data->output.stream, data->context.set.standout, " ==========================%c", f_string_eol_s[0]); fflush(data->output.stream); parameters.used = 4; @@ -328,10 +343,10 @@ extern "C" { status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_iptables, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_iptables, f_string_eol_s[0]); fprintf(f_type_error, " "); f_string_length_t i = 0; @@ -378,13 +393,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_data_not) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sCould not find any network devices%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sCould not find any network devices%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_failure) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to read the device directory '%s'%c", fll_error_print_error, network_devices, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to read the device directory '%s'%c", fll_error_print_error, network_devices, f_string_eol_s[0]); } firewall_delete_local_data(&local); @@ -467,7 +482,7 @@ extern "C" { return status; } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform lock request because the lock instructions are missing from: %s.%c", fll_error_print_error, network_path firewall_file_other, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform lock request because the lock instructions are missing from: %s.%c", fll_error_print_error, network_path firewall_file_other, f_string_eol_s[0]); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -507,7 +522,7 @@ extern "C" { } } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform stop request because the lock instructions are missing from: %s.", fll_error_print_error, network_path firewall_file_other, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform stop request because the lock instructions are missing from: %s.", fll_error_print_error, network_path firewall_file_other, f_string_eol_s[0]); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -585,7 +600,7 @@ extern "C" { f_macro_string_dynamic_t_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1); if (F_status_is_error(status)) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -699,7 +714,7 @@ extern "C" { firewall_delete_local_data(&local); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou did not pass a command%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou did not pass a command%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index 95e8438..7b309e0 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -310,7 +310,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con fprintf(f_type_warning, "\n"); } else { - fl_color_print(f_type_warning, data.context.set.warning, "%sAt line %i, the object has no content%c", fll_error_print_warning, i, f_string_eol[0]); + fl_color_print(f_type_warning, data.context.set.warning, "%sAt line %i, the object has no content%c", fll_error_print_warning, i, f_string_eol_s[0]); } continue; @@ -587,24 +587,24 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling f_file_open()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling f_file_open()%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_file_found_not) { // the file does not have to exist - fl_color_print(f_type_warning, data.context.set.warning, "%sCannot find the file '%.*s'%c", fll_error_print_warning, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(f_type_warning, data.context.set.warning, "%sCannot find the file '%.*s'%c", fll_error_print_warning, file_path.used, file_path.string, f_string_eol_s[0]); status = F_none; } else if (status == F_file_open) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to open the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to open the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_file_descriptor) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFile descriptor error while trying to open the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFile descriptor error while trying to open the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open()%c", fll_error_print_error, status, f_string_eol_s[0]); } if (status != F_file_found_not) { @@ -622,25 +622,25 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling f_file_read()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling f_file_read()%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_number_overflow) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInteger overflow while trying to buffer the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInteger overflow while trying to buffer the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_file_closed) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sThe file '%.*s' is no longer open%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sThe file '%.*s' is no longer open%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_file_seek) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sA seek error occurred while accessing the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sA seek error occurred while accessing the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_file_read) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sA read error occurred while accessing the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sA read error occurred while accessing the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_read()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_read()%c", fll_error_print_error, status, f_string_eol_s[0]); } status = F_status_set_error(status); @@ -658,16 +658,16 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_fss_basic_read() for the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_fss_basic_read() for the file '%.*s'%c", fll_error_print_error, file_path.used, file_path.string, f_string_eol_s[0]); } else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) { // empty files are to be silently ignored } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'%c", fll_error_print_error, status, file_path.used, file_path.string, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'%c", fll_error_print_error, status, file_path.used, file_path.string, f_string_eol_s[0]); } status = F_status_set_error(status); @@ -709,7 +709,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con } if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); fl_string_dynamic_delete(&ip_list_action); } @@ -730,7 +730,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con f_macro_string_dynamic_t_new(status, ip_argument, ip_length); if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); break; } @@ -760,7 +760,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con } if (status == F_failure) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, current_tool, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, current_tool, f_string_eol_s[0]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -780,7 +780,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con break; } else if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); // remove ip_argument from arguments string. fl_string_dynamic_delete(&arguments.array[arguments.used]); @@ -834,7 +834,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con } if (status == F_failure) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, current_tool, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, current_tool, f_string_eol_s[0]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -849,7 +849,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con break; } else if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); break; } } @@ -1104,10 +1104,10 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserv if (status == F_failure) { if (tool == firewall_program_iptables) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_iptables, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_iptables, f_string_eol_s[0]); } else if (tool == firewall_program_ip6tables) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_ip6tables, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, firewall_tool_ip6tables, f_string_eol_s[0]); } fprintf(f_type_error, " "); @@ -1128,10 +1128,10 @@ f_return_status firewall_create_custom_chains(firewall_reserved_chains_t *reserv fprintf(f_type_error, "\n"); } else if (status == F_parameter) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol_s[0]); } fl_string_dynamics_delete(&arguments); @@ -1190,7 +1190,7 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { status = F_status_set_fine(status); if (status == F_failure) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[i], f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[i], f_string_eol_s[0]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1204,10 +1204,10 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { fprintf(f_type_error, "\n"); } else if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol_s[0]); } return status; @@ -1250,7 +1250,7 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { status = F_status_set_fine(status); if (status == F_failure) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[i], f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[i], f_string_eol_s[0]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1264,10 +1264,10 @@ f_return_status firewall_delete_chains(const firewall_data_t data) { fprintf(f_type_error, "\n"); } else if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol_s[0]); } return status; @@ -1332,7 +1332,7 @@ f_return_status firewall_default_lock(const firewall_data_t data) { status = F_status_set_fine(status); if (status == F_failure) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[j], f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sFailed to perform requested %s operation:%c", fll_error_print_error, tools[j], f_string_eol_s[0]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1346,10 +1346,10 @@ f_return_status firewall_default_lock(const firewall_data_t data) { fprintf(f_type_error, "\n"); } else if (status == F_parameter) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_execute_program()%c", fll_error_print_error, status, f_string_eol_s[0]); } return status; @@ -1370,26 +1370,26 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti if (optional) { if (status == F_parameter) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_open().%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_open().%c", fll_error_print_error, f_string_eol_s[0]); } else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open().%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open().%c", fll_error_print_error, status, f_string_eol_s[0]); } } else { if (status == F_parameter) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_open().%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_open().%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_file_found_not) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to find the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to find the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_file_open) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to open the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to open the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_file_descriptor) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sFile descriptor error while trying to open the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sFile descriptor error while trying to open the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open().%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_open().%c", fll_error_print_error, status, f_string_eol_s[0]); } } @@ -1404,25 +1404,25 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_read().%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling f_file_read().%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_number_overflow) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInteger overflow while trying to buffer the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInteger overflow while trying to buffer the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_file_closed) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sThe file '%s' is no longer open.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sThe file '%s' is no longer open.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_file_seek) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sA seek error occurred while accessing the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sA seek error occurred while accessing the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_file_read) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sA read error occurred while accessing the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sA read error occurred while accessing the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_read().%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling f_file_read().%c", fll_error_print_error, status, f_string_eol_s[0]); } return status; @@ -1441,16 +1441,16 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sInvalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sNo relevant data was found within the file '%s'.%c", fll_error_print_error, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sNo relevant data was found within the file '%s'.%c", fll_error_print_error, filename, f_string_eol_s[0]); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", fll_error_print_error, status, filename, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", fll_error_print_error, status, filename, f_string_eol_s[0]); } } else { @@ -1489,13 +1489,13 @@ f_return_status firewall_process_rules(f_string_range_t *range, firewall_local_d status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status == F_failure) { // the error message has already been displayed. } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling firewall_perform_commands().%c", fll_error_print_error, status, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sAn unhandled error (%u) has occurred while calling firewall_perform_commands().%c", fll_error_print_error, status, f_string_eol_s[0]); } f_macro_fss_objects_t_delete_simple(local->rule_objects); diff --git a/level_3/firewall/c/private-firewall.h b/level_3/firewall/c/private-firewall.h index 67a4f20..c2beb45 100644 --- a/level_3/firewall/c/private-firewall.h +++ b/level_3/firewall/c/private-firewall.h @@ -85,7 +85,7 @@ typedef struct { (structure.array[index].stop - structure.array[index].start) + 1 // TODO: temporarily added, convert this to a function below. -// TODO: also report: fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]); +// TODO: also report: fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol_s[0]); #define firewall_macro_append_argument_to_arguments(status, arguments, argument) \ if (arguments.used == arguments.size) { \ f_macro_string_dynamics_t_resize(status, arguments, arguments.used + firewall_default_allocation_step); \ diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.c b/level_3/fss_basic_list_read/c/fss_basic_list_read.c index f6051e4..c693f11 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); fll_program_print_help_option(output, context, fss_basic_list_read_short_content, fss_basic_list_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default)."); @@ -39,54 +39,54 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0002 Basic List standard.%c", f_string_eol[0]); + fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0002 Basic List standard.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When using the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); + fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol_s[0]); - fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol[0]); + fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); - fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); + fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); + fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol[0]); - fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); + fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol_s[0]); + fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " Specify both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); fprintf(output.stream, " and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); - fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol[0]); + fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); @@ -96,63 +96,63 @@ extern "C" { fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); fprintf(output.stream, " parameter value will be treated as a position relative to the specified "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fprintf(output.stream, " parameter value.%c", f_string_eol[0]); + fprintf(output.stream, " parameter value.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " This program may support parameters, such as "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); fprintf(output.stream, " or "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol[0]); - fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol[0]); + fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol_s[0]); + fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); - fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); + fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When specifying both the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); fprintf(output.stream, " parameter and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_content); - fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol[0]); + fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_delimit); - fprintf(output.stream, " accepts the following:%c", f_string_eol[0]); + fprintf(output.stream, " accepts the following:%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_list_read_delimit_mode_name_none); - fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol[0]); + fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_list_read_delimit_mode_name_all); - fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol[0]); - fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol_s[0]); + fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_list_read_delimit_mode_name_greater); - fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_list_read_delimit_mode_name_lesser); - fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -171,8 +171,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_basic_list_read_delete_data(data); @@ -228,7 +243,7 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_at].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -236,7 +251,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_list_read_parameter_depth].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -244,7 +259,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -252,7 +267,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -260,7 +275,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -271,7 +286,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -281,7 +296,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -294,7 +309,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -319,7 +334,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_pipe); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -329,7 +344,7 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_delimit].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -340,7 +355,7 @@ extern "C" { if (length == 0) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -404,7 +419,7 @@ extern "C" { f_macro_fss_comments_t_delete_simple(comments); if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } fss_basic_list_read_delete_data(data); @@ -414,7 +429,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -469,7 +484,7 @@ extern "C" { // Skip past empty files. if (!data->quantity.total) { if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } f_file_stream_close(F_true, &file); @@ -511,7 +526,7 @@ extern "C" { f_macro_fss_comments_t_delete_simple(comments); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index d47adb9..573ae29 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -19,7 +19,7 @@ extern "C" { fss_basic_list_read_macro_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); return status; } @@ -103,12 +103,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status_code == f_string_length_t_size) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to process '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); - fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { f_string_t function = "fl_string_append"; @@ -121,7 +121,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code); fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function); - fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol_s[0]); } return status; @@ -130,7 +130,7 @@ extern "C" { if (!depths->array[i].value_name.used) { fl_color_print(data.error.to.stream, data.context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -147,7 +147,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -158,7 +158,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -199,7 +199,7 @@ extern "C" { fl_string_dynamic_delete(&data->buffer); if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -296,10 +296,10 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } } else if (depths.array[0].index_name > 0) { @@ -311,10 +311,10 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } else { - fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol_s[0]); } return F_none; @@ -382,7 +382,7 @@ extern "C" { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at >= data->objects.used) { if (names[depths.array[0].value_at] && data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } return F_none; @@ -398,7 +398,7 @@ extern "C" { if (at == depths.array[0].value_at) { if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { if (!data->contents.array[i].used) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } else { total = 1; @@ -406,12 +406,12 @@ extern "C" { for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { total++; } } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } return F_none; @@ -420,7 +420,7 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { if (!data->contents.array[i].used) { if (include_empty && !line) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_basic_list_read_print_set_end(*data); } } @@ -430,8 +430,8 @@ extern "C" { if (!line) { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[i] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -444,7 +444,7 @@ extern "C" { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { + if (data->buffer.string[i] == f_string_eol_s[0]) { line_current++; if (line_current == line) { @@ -453,8 +453,8 @@ extern "C" { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[i] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -479,7 +479,7 @@ extern "C" { fss_basic_list_read_print_set_end(*data); } else if (include_empty) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_basic_list_read_print_set_end(*data); } @@ -510,13 +510,13 @@ extern "C" { for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { total++; } } // for } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } @@ -527,7 +527,7 @@ extern "C" { if (!data->contents.array[i].used) { if (include_empty) { if (line_current == line) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_basic_list_read_print_set_end(*data); break; } @@ -543,7 +543,7 @@ extern "C" { if (line_current != line) { for (; j <= data->contents.array[i].array[0].stop; j++) { - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { line_current++; if (line_current == line) { @@ -560,8 +560,8 @@ extern "C" { for (; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[j] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -580,7 +580,7 @@ extern "C" { if (!data->contents.array[i].used) { if (include_empty) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_basic_list_read_print_set_end(*data); } 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 3857a7a..832348f 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 @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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."); @@ -38,19 +38,19 @@ extern "C" { 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, ") to designate the start of a Content.%c", f_string_eol_s[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, ") to designate the end of the last Content.%c", f_string_eol_s[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, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol_s[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"); @@ -60,26 +60,26 @@ extern "C" { 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, ").%c", f_string_eol_s[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, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "' do nothing.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "', which therefore does nothing.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -98,8 +98,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_basic_list_write_delete_data(data); @@ -161,10 +176,10 @@ extern "C" { if (data->parameters[fss_basic_list_write_parameter_file].result == f_console_result_additional) { if (data->parameters[fss_basic_list_write_parameter_file].values.used > 1) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -205,14 +220,14 @@ extern "C" { else if (data->parameters[fss_basic_list_write_parameter_content].locations.used && data->parameters[fss_basic_list_write_parameter_partial].locations.used) { if (data->parameters[fss_basic_list_write_parameter_content].result == f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_partial); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter only allows either the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter or the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -234,12 +249,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must be specified before a '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -262,12 +277,12 @@ extern "C" { } else if (!data->process_pipe) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThis requires either piped data or the use of the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -276,10 +291,10 @@ extern "C" { if (F_status_is_error_not(status) && data->process_pipe) { if (data->parameters[fss_basic_list_write_parameter_partial].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_partial); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -290,10 +305,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_basic_list_write_parameter_prepend].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -316,10 +331,10 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -329,10 +344,10 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -343,10 +358,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_basic_list_write_parameter_ignore].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -356,10 +371,10 @@ extern "C" { const f_array_length_t total_arguments = data->parameters[fss_basic_list_write_parameter_ignore].values.used; if (total_locations * 2 > total_arguments) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -393,10 +408,10 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input pipe"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } } @@ -445,15 +460,15 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input arguments"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } 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(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -478,7 +493,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c index d3f052c..bca4e59 100644 --- a/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/private-fss_basic_list_write.c @@ -12,14 +12,14 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sMust specify both the '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_object); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter and the '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_content); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter the same number of times when not specifying the "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_write_long_partial); - fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_list_write_error_parameter_same_times_print_ @@ -30,10 +30,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard does not support end of line character '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "\\n"); - fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_list_write_error_parameter_unsupported_eol_print_ @@ -44,10 +44,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", symbol, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_list_write_error_parameter_value_missing_print_ @@ -233,8 +233,8 @@ extern "C" { if (block.string[range.start] == fss_basic_list_write_pipe_content_start) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_supported_not); diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 96ea46d..cd1f514 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); fll_program_print_help_option(output, context, fss_basic_read_short_content, fss_basic_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default)."); @@ -39,54 +39,54 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0000 Basic standard.%c", f_string_eol[0]); + fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0000 Basic standard.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When using the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); + fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol_s[0]); - fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol[0]); + fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); - fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); + fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); + fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol[0]); - fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); + fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol_s[0]); + fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " Specify both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); fprintf(output.stream, " and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); - fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol[0]); + fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); @@ -96,63 +96,63 @@ extern "C" { fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); fprintf(output.stream, " parameter value will be treated as a position relative to the specified "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fprintf(output.stream, " parameter value.%c", f_string_eol[0]); + fprintf(output.stream, " parameter value.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " This program may support parameters, such as "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); fprintf(output.stream, " or "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol[0]); - fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol[0]); + fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol_s[0]); + fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); - fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); + fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When specifying both the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); fprintf(output.stream, " parameter and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_content); - fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content are separated by a space.%c", f_string_eol[0]); + fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content are separated by a space.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_delimit); - fprintf(output.stream, " accepts the following:%c", f_string_eol[0]); + fprintf(output.stream, " accepts the following:%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_read_delimit_mode_name_none); - fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol[0]); + fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_read_delimit_mode_name_all); - fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol[0]); - fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol_s[0]); + fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_read_delimit_mode_name_greater); - fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_basic_read_delimit_mode_name_lesser); - fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -171,8 +171,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_basic_read_delete_data(data); @@ -228,7 +243,7 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_at].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -236,7 +251,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_read_parameter_depth].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -244,7 +259,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_read_parameter_line].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -252,7 +267,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_read_parameter_name].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -260,7 +275,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -281,7 +296,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -294,7 +309,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -319,7 +334,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_pipe); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -329,7 +344,7 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_delimit].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -340,7 +355,7 @@ extern "C" { if (length == 0) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -402,7 +417,7 @@ extern "C" { f_macro_fss_delimits_t_delete_simple(delimits); if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } fss_basic_read_delete_data(data); @@ -412,7 +427,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol_s[0]); fss_basic_read_macro_depths_t_delete_simple(depths); status = F_status_set_error(F_parameter); @@ -468,7 +483,7 @@ extern "C" { // Skip past empty files. if (!data->quantity.total) { if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } f_file_stream_close(F_true, &file); @@ -509,7 +524,7 @@ extern "C" { f_macro_fss_delimits_t_delete_simple(delimits); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index e9bbb47..53192b2 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.c +++ b/level_3/fss_basic_read/c/private-fss_basic_read.c @@ -19,7 +19,7 @@ extern "C" { fss_basic_read_macro_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); return status; } @@ -103,12 +103,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status_code == f_string_length_t_size) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to process '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); - fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { f_string_t function = "fl_string_append"; @@ -121,7 +121,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code); fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function); - fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol_s[0]); } return status; @@ -130,7 +130,7 @@ extern "C" { if (!depths->array[i].value_name.used) { fl_color_print(data.error.to.stream, data.context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -147,7 +147,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -158,7 +158,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -198,7 +198,7 @@ extern "C" { fl_string_dynamic_delete(&data->buffer); if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -285,10 +285,10 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } } else if (depths.array[0].index_name > 0) { @@ -300,10 +300,10 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } else { - fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol_s[0]); } return F_none; @@ -363,7 +363,7 @@ extern "C" { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at >= data->objects.used) { if (names[depths.array[0].value_at] && data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } return F_none; @@ -383,10 +383,10 @@ extern "C" { if (at == depths.array[0].value_at) { if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { if (!data->contents.array[i].used) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } } else if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { @@ -431,7 +431,7 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index cf0fcd1..e0cfa7e 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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."); @@ -38,19 +38,19 @@ extern "C" { 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, ") to designate the start of a Content.%c", f_string_eol_s[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, ") to designate the end of the last Content.%c", f_string_eol_s[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, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol_s[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"); @@ -60,24 +60,24 @@ extern "C" { 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, ").%c", f_string_eol_s[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, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "' does nothing.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "', which therefore does nothing.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -96,8 +96,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_basic_write_delete_data(data); @@ -159,10 +174,10 @@ extern "C" { if (data->parameters[fss_basic_write_parameter_file].result == f_console_result_additional) { if (data->parameters[fss_basic_write_parameter_file].values.used > 1) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -203,14 +218,14 @@ extern "C" { else if (data->parameters[fss_basic_write_parameter_content].locations.used && data->parameters[fss_basic_write_parameter_partial].locations.used) { if (data->parameters[fss_basic_write_parameter_content].result == f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_partial); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter only allows either the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter or the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -232,12 +247,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must be specified before a '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -260,12 +275,12 @@ extern "C" { } else if (!data->process_pipe) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThis requires either piped data or the use of the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -274,10 +289,10 @@ extern "C" { if (F_status_is_error_not(status) && data->process_pipe) { if (data->parameters[fss_basic_write_parameter_partial].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_partial); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -288,10 +303,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_basic_write_parameter_prepend].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -312,10 +327,10 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -325,10 +340,10 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -339,10 +354,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_basic_write_parameter_ignore].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -352,10 +367,10 @@ extern "C" { const f_array_length_t total_arguments = data->parameters[fss_basic_write_parameter_ignore].values.used; if (total_locations * 2 > total_arguments) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -389,10 +404,10 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input pipe"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } } @@ -444,15 +459,15 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input arguments"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } 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(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -477,7 +492,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/fss_basic_write/c/private-fss_basic_write.c b/level_3/fss_basic_write/c/private-fss_basic_write.c index f418a33..3b3f38e 100644 --- a/level_3/fss_basic_write/c/private-fss_basic_write.c +++ b/level_3/fss_basic_write/c/private-fss_basic_write.c @@ -12,14 +12,14 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sMust specify both the '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_object); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter and the '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_content); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter the same number of times when not specifying the "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_write_long_partial); - fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_write_error_parameter_same_times_print_ @@ -30,10 +30,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", symbol, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_write_error_parameter_value_missing_print_ @@ -44,10 +44,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard does not support end of line character '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "\\n"); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } #endif // _di_fss_basic_write_error_parameter_unsupported_eol_print_ @@ -245,8 +245,8 @@ extern "C" { if (block.string[range.start] == fss_basic_write_pipe_content_start) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_supported_not); diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 35203fa..43ba6a4 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_embedded_list_read_short_at, fss_embedded_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); fll_program_print_help_option(output, context, fss_embedded_list_read_short_content, fss_embedded_list_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default)."); @@ -39,54 +39,54 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0002 Basic List standard.%c", f_string_eol[0]); + fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0002 Basic List standard.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When using the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); + fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol_s[0]); - fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol[0]); + fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_at); - fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); + fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_name); - fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); + fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol[0]); - fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); + fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol_s[0]); + fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " Specify both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_object); fprintf(output.stream, " and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_total); - fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol[0]); + fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_at); @@ -96,63 +96,63 @@ extern "C" { fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_at); fprintf(output.stream, " parameter value will be treated as a position relative to the specified "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_name); - fprintf(output.stream, " parameter value.%c", f_string_eol[0]); + fprintf(output.stream, " parameter value.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " This program may support parameters, such as "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); fprintf(output.stream, " or "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol[0]); - fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol[0]); + fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol_s[0]); + fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_trim); - fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); + fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When specifying both the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_object); fprintf(output.stream, " parameter and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_content); - fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol[0]); + fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_delimit); - fprintf(output.stream, " accepts the following:%c", f_string_eol[0]); + fprintf(output.stream, " accepts the following:%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_embedded_list_read_delimit_mode_name_none); - fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol[0]); + fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_embedded_list_read_delimit_mode_name_all); - fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol[0]); - fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol_s[0]); + fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_embedded_list_read_delimit_mode_name_greater); - fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_embedded_list_read_delimit_mode_name_lesser); - fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -171,8 +171,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_embedded_list_read_delete_data(data); @@ -228,7 +243,7 @@ extern "C" { if (data->parameters[fss_embedded_list_read_parameter_at].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -236,7 +251,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_embedded_list_read_parameter_depth].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -244,7 +259,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_embedded_list_read_parameter_line].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -252,7 +267,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_embedded_list_read_parameter_name].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -260,7 +275,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_embedded_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -271,7 +286,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -281,7 +296,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -294,7 +309,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_line); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -319,7 +334,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_pipe); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -329,7 +344,7 @@ extern "C" { if (data->parameters[fss_embedded_list_read_parameter_delimit].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -340,7 +355,7 @@ extern "C" { if (length == 0) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -401,7 +416,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_embedded_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -454,7 +469,7 @@ extern "C" { // Skip past empty files. if (!data->quantity.total) { if (data->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } f_file_stream_close(F_true, &file); @@ -495,7 +510,7 @@ extern "C" { f_macro_fss_comments_t_delete_simple(comments); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c index 0127c0a..cbb8978 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c @@ -187,24 +187,24 @@ extern "C" { for (j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe value '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_read_long_depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may not have the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -237,7 +237,7 @@ extern "C" { fl_string_dynamic_delete(&data->buffer); if (data->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -265,7 +265,7 @@ extern "C" { // Requested depths cannot be greater than contents depth. if (depths.used > data->nest.used) { if (data->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -478,7 +478,7 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } @@ -535,13 +535,13 @@ extern "C" { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { total++; } } // for } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } @@ -570,7 +570,7 @@ extern "C" { if (line_current != line) { for (; j <= items->array[i].content.array[0].stop; ++j) { - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { line_current++; if (line_current == line) { @@ -588,8 +588,8 @@ extern "C" { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[j] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index e6c5834..b425f4f 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_embedded_list_write_short_file, fss_embedded_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_embedded_list_write_short_content, fss_embedded_list_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The Content to output."); @@ -38,19 +38,19 @@ extern "C" { 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, ") to designate the start of a Content.%c", f_string_eol_s[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, ") to designate the end of the last Content.%c", f_string_eol_s[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, ") is used to ignore a content range (use this both before and after the range).%c", f_string_eol_s[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"); @@ -60,32 +60,32 @@ extern "C" { 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, ").%c", f_string_eol_s[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, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The FSS-0008 (Embedded 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_embedded_list_write_long_single); fprintf(output.stream, "' and '"); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_double); - fprintf(output.stream, "' do nothing.%c", f_string_eol[0]); + fprintf(output.stream, "' do nothing.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter '"); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_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, "' designates to not escape any valid nested Object or Content within some Content.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter is not used for ignoring anything from the input pipe.%c", f_string_eol_s[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_embedded_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_embedded_list_write_long_content); - fprintf(output.stream, "' parameter.%c", f_string_eol[0]); + fprintf(output.stream, "' parameter.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -104,8 +104,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_embedded_list_write_delete_data(data); @@ -167,10 +182,10 @@ extern "C" { if (data->parameters[fss_embedded_list_write_parameter_file].result == f_console_result_additional) { if (data->parameters[fss_embedded_list_write_parameter_file].values.used > 1) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -211,14 +226,14 @@ extern "C" { else if (data->parameters[fss_embedded_list_write_parameter_content].locations.used && data->parameters[fss_embedded_list_write_parameter_partial].locations.used) { if (data->parameters[fss_embedded_list_write_parameter_content].result == f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_partial); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter only allows either the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter or the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -240,12 +255,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must be specified before a '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -268,12 +283,12 @@ extern "C" { } else if (!data->process_pipe) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThis requires either piped data or the use of the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -282,10 +297,10 @@ extern "C" { if (F_status_is_error_not(status) && data->process_pipe) { if (data->parameters[fss_embedded_list_write_parameter_partial].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_partial); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -296,10 +311,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_embedded_list_write_parameter_prepend].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -322,10 +337,10 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -335,10 +350,10 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -349,10 +364,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_embedded_list_write_parameter_ignore].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -362,10 +377,10 @@ extern "C" { const f_array_length_t total_arguments = data->parameters[fss_embedded_list_write_parameter_ignore].values.used; if (total_locations * 2 > total_arguments) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -400,10 +415,10 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input pipe"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } @@ -460,16 +475,16 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input arguments"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } else if (data->error.verbosity != f_console_verbosity_quiet && data->parameters[fss_embedded_list_write_parameter_file].result == f_console_result_none) { // ensure there is always a newline at the end, unless in quiet mode. - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -495,7 +510,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c index fb76c53..704478a 100644 --- a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c @@ -12,14 +12,14 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sMust specify both the '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_object); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter and the '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_content); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter the same number of times when not specifying the "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_embedded_list_write_long_partial); - fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol_s[0]); } #endif // _di_fss_embedded_list_write_error_parameter_same_times_print_ @@ -30,10 +30,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard does not support end of line character '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "\\n"); - fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol_s[0]); } #endif // _di_fss_embedded_list_write_error_parameter_unsupported_eol_print_ @@ -44,10 +44,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", symbol, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fss_embedded_list_write_error_parameter_value_missing_print_ @@ -238,8 +238,8 @@ extern "C" { if (block.string[range.start] == fss_embedded_list_write_pipe_content_start) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_supported_not); diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index 7a7030c..34f32a6 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); fll_program_print_help_option(output, context, fss_extended_list_read_short_content, fss_extended_list_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default)."); @@ -39,54 +39,54 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0003 Extended List standard.%c", f_string_eol[0]); + fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0003 Extended List standard.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When using the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); + fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol_s[0]); - fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol[0]); + fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); - fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); + fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); + fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol[0]); - fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); + fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol_s[0]); + fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " Specify both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); fprintf(output.stream, " and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); - fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol[0]); + fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); @@ -96,63 +96,63 @@ extern "C" { fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); fprintf(output.stream, " parameter value will be treated as a position relative to the specified "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fprintf(output.stream, " parameter value.%c", f_string_eol[0]); + fprintf(output.stream, " parameter value.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " This program may support parameters, such as "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); fprintf(output.stream, " or "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol[0]); - fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol[0]); + fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol_s[0]); + fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); - fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); + fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When specifying both the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); fprintf(output.stream, " parameter and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_content); - fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol[0]); + fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content are separated by an EOL.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_delimit); - fprintf(output.stream, " accepts the following:%c", f_string_eol[0]); + fprintf(output.stream, " accepts the following:%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_list_read_delimit_mode_name_none); - fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol[0]); + fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_list_read_delimit_mode_name_all); - fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol[0]); - fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol_s[0]); + fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_list_read_delimit_mode_name_greater); - fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_list_read_delimit_mode_name_lesser); - fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -171,8 +171,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_extended_list_read_delete_data(data); @@ -228,7 +243,7 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_at].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -236,7 +251,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_list_read_parameter_depth].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -244,7 +259,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -252,7 +267,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_list_read_parameter_name].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -260,7 +275,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -271,7 +286,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -281,7 +296,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -294,7 +309,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -319,7 +334,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_pipe); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -329,7 +344,7 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_delimit].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -340,7 +355,7 @@ extern "C" { if (length == 0) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -404,7 +419,7 @@ extern "C" { f_macro_fss_comments_t_delete_simple(comments); if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } fss_extended_list_read_delete_data(data); @@ -414,7 +429,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -469,7 +484,7 @@ extern "C" { // Skip past empty files. if (!data->quantity.total) { if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } f_file_stream_close(F_true, &file); @@ -511,7 +526,7 @@ extern "C" { f_macro_fss_comments_t_delete_simple(comments); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 1f9e2b4..07f3407 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -19,7 +19,7 @@ extern "C" { fss_extended_list_read_macro_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); return status; } @@ -103,12 +103,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status_code == f_string_length_t_size) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to process '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); - fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { f_string_t function = "fl_string_append"; @@ -121,7 +121,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code); fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function); - fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol_s[0]); } return status; @@ -130,7 +130,7 @@ extern "C" { if (!depths->array[i].value_name.used) { fl_color_print(data.error.to.stream, data.context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -147,7 +147,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -158,7 +158,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -199,7 +199,7 @@ extern "C" { fl_string_dynamic_delete(&data->buffer); if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -296,10 +296,10 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } } else if (depths.array[0].index_name > 0) { @@ -311,10 +311,10 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } else { - fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol_s[0]); } return F_none; @@ -382,7 +382,7 @@ extern "C" { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at >= data->objects.used) { if (names[depths.array[0].value_at] && data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } return F_none; @@ -398,7 +398,7 @@ extern "C" { if (at == depths.array[0].value_at) { if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { if (!data->contents.array[i].used) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } else { total = 1; @@ -406,12 +406,12 @@ extern "C" { for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { total++; } } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } return F_none; @@ -420,7 +420,7 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { if (!data->contents.array[i].used) { if (include_empty && !line) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_extended_list_read_print_set_end(*data); } } @@ -430,8 +430,8 @@ extern "C" { if (!line) { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[i] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -444,7 +444,7 @@ extern "C" { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { + if (data->buffer.string[i] == f_string_eol_s[0]) { line_current++; if (line_current == line) { @@ -453,8 +453,8 @@ extern "C" { for (; i <= data->contents.array[i].array[0].stop; i++) { if (!data->buffer.string[i]) continue; - if (data->buffer.string[i] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[i] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -479,7 +479,7 @@ extern "C" { fss_extended_list_read_print_set_end(*data); } else if (include_empty) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_extended_list_read_print_set_end(*data); } @@ -510,13 +510,13 @@ extern "C" { for (j = data->contents.array[i].array[0].start; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { total++; } } // for } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } @@ -527,7 +527,7 @@ extern "C" { if (!data->contents.array[i].used) { if (include_empty) { if (line_current == line) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_extended_list_read_print_set_end(*data); break; } @@ -543,7 +543,7 @@ extern "C" { if (line_current != line) { for (; j <= data->contents.array[i].array[0].stop; j++) { - if (data->buffer.string[j] == f_string_eol[0]) { + if (data->buffer.string[j] == f_string_eol_s[0]) { line_current++; if (line_current == line) { @@ -560,8 +560,8 @@ extern "C" { for (; j <= data->contents.array[i].array[0].stop; j++) { if (!data->buffer.string[j]) continue; - if (data->buffer.string[j] == f_string_eol[0]) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + if (data->buffer.string[j] == f_string_eol_s[0]) { + fprintf(data->output.stream, "%c", f_string_eol_s[0]); break; } @@ -580,7 +580,7 @@ extern "C" { if (!data->contents.array[i].used) { if (include_empty) { - fprintf(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); fss_extended_list_read_print_set_end(*data); } 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 cf370f4..af99f72 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 @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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."); @@ -38,19 +38,19 @@ extern "C" { 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, ") to designate the start of a Content.%c", f_string_eol_s[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, ") to designate the end of the last Content.%c", f_string_eol_s[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, ") is used to ignore a content range (use this both before and after the range).%c", f_string_eol_s[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"); @@ -60,32 +60,32 @@ extern "C" { 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, ").%c", f_string_eol_s[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, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "' do nothing.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "' designates to not escape any valid nested Object or Content within some Content.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter is not used for ignoring anything from the input pipe.%c", f_string_eol_s[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, "' parameter.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -104,8 +104,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_extended_list_write_delete_data(data); @@ -167,10 +182,10 @@ extern "C" { if (data->parameters[fss_extended_list_write_parameter_file].result == f_console_result_additional) { if (data->parameters[fss_extended_list_write_parameter_file].values.used > 1) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -211,14 +226,14 @@ extern "C" { else if (data->parameters[fss_extended_list_write_parameter_content].locations.used && data->parameters[fss_extended_list_write_parameter_partial].locations.used) { if (data->parameters[fss_extended_list_write_parameter_content].result == f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_partial); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter only allows either the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter or the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -240,12 +255,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must be specified before a '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -268,12 +283,12 @@ extern "C" { } else if (!data->process_pipe) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThis requires either piped data or the use of the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -282,10 +297,10 @@ extern "C" { if (F_status_is_error_not(status) && data->process_pipe) { if (data->parameters[fss_extended_list_write_parameter_partial].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_partial); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -296,10 +311,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_extended_list_write_parameter_prepend].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -322,10 +337,10 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -335,10 +350,10 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -349,10 +364,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_extended_list_write_parameter_ignore].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -362,10 +377,10 @@ extern "C" { const f_array_length_t total_arguments = data->parameters[fss_extended_list_write_parameter_ignore].values.used; if (total_locations * 2 > total_arguments) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -400,10 +415,10 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input pipe"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } @@ -460,16 +475,16 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input arguments"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } 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(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -495,7 +510,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index 12b93c9..601af5e 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -12,14 +12,14 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sMust specify both the '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_object); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter and the '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_content); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter the same number of times when not specifying the "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_write_long_partial); - fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_list_write_error_parameter_same_times_print_ @@ -30,10 +30,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard does not support end of line character '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "\\n"); - fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' in objects.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_list_write_error_parameter_unsupported_eol_print_ @@ -44,10 +44,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", symbol, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_list_write_error_parameter_value_missing_print_ @@ -238,8 +238,8 @@ extern "C" { if (block.string[range.start] == fss_extended_list_write_pipe_content_start) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard only supports one content per object.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_supported_not); diff --git a/level_3/fss_extended_read/c/fss_extended_read.c b/level_3/fss_extended_read/c/fss_extended_read.c index b40869a..005946b 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fll_program_print_help_option(output, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index."); fll_program_print_help_option(output, context, fss_extended_read_short_content, fss_extended_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the content (default)."); @@ -39,54 +39,54 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0001 Extended standard.%c", f_string_eol[0]); + fprintf(output.stream, " This program will print the content associated with the given object and content data based on the FSS-0001 Extended standard.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When using the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); + fprintf(output.stream, " option, an order of operations is enforced on the parameters.%c", f_string_eol_s[0]); - fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol[0]); + fprintf(output.stream, " When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); - fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object index at the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); + fprintf(output.stream, ": A new depth within the specified depth, indexed from the root.%c", f_string_eol_s[0]); fprintf(output.stream, " "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": An object name at the specified depth.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol[0]); - fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); + fprintf(output.stream, " must be in numeric order, but values in between may be skipped.%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol_s[0]); + fprintf(output.stream, " ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol[0]); - fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); + fprintf(output.stream, " selects a content index at a given depth.%c", f_string_eol_s[0]); + fprintf(output.stream, " (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " Specify both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); fprintf(output.stream, " and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); - fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol[0]); + fprintf(output.stream, " parameters to get the total objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When both "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); @@ -96,63 +96,63 @@ extern "C" { fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); fprintf(output.stream, " parameter value will be treated as a position relative to the specified "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fprintf(output.stream, " parameter value.%c", f_string_eol[0]); + fprintf(output.stream, " parameter value.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " This program may support parameters, such as "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); fprintf(output.stream, " or "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol[0]); - fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol[0]); + fprintf(output.stream, ", even if not supported by the standard.%c", f_string_eol_s[0]); + fprintf(output.stream, " This is done to help ensure consistency for scripting.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol_s[0]); fprintf(output.stream, " For parameters like "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); + fprintf(output.stream, ", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); - fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); + fprintf(output.stream, " will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " When specifying both the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); fprintf(output.stream, " parameter and the "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_content); - fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol[0]); - fprintf(output.stream, " Both the object and content are separated by a space.%c", f_string_eol[0]); + fprintf(output.stream, " parameter, the entire object and content are printed, including the formatting.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content printed are already escaped.%c", f_string_eol_s[0]); + fprintf(output.stream, " Both the object and content are separated by a space.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The parameter "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_delimit); - fprintf(output.stream, " accepts the following:%c", f_string_eol[0]); + fprintf(output.stream, " accepts the following:%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_read_delimit_mode_name_none); - fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol[0]); + fprintf(output.stream, ": Do not apply delimits.%c", f_string_eol_s[0]); fprintf(output.stream, " - "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_read_delimit_mode_name_all); - fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol[0]); - fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol[0]); + fprintf(output.stream, ": (default) apply all delimits.%c", f_string_eol_s[0]); + fprintf(output.stream, " - a number, 0 or greater: apply delimits for the specified depth.%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_read_delimit_mode_name_greater); - fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1+') apply delimits for the specified depth and any greater depth (numerically).%c", f_string_eol_s[0]); fprintf(output.stream, " - a number, 0 or greater, followed by a "); fl_color_print(output.stream, context.set.notable, "%s", fss_extended_read_delimit_mode_name_lesser); - fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol[0]); + fprintf(output.stream, ": (such as '1-') apply delimits for the specified depth and any lesser depth (numerically).%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -171,8 +171,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_extended_read_delete_data(data); @@ -228,7 +243,7 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_at].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -236,7 +251,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_read_parameter_depth].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -244,7 +259,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_read_parameter_line].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -252,7 +267,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_read_parameter_name].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -260,7 +275,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -271,7 +286,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -281,7 +296,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -294,7 +309,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -307,7 +322,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -319,7 +334,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_pipe); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -329,7 +344,7 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_delimit].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a value.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -340,7 +355,7 @@ extern "C" { if (length == 0) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_delimit); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -404,7 +419,7 @@ extern "C" { f_macro_fss_delimits_t_delete_simple(contents_delimits); if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } fss_extended_read_delete_data(data); @@ -414,7 +429,7 @@ extern "C" { if (F_status_is_error_not(status) && data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -469,7 +484,7 @@ extern "C" { // Skip past empty files. if (!data->quantity.total) { if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } f_file_stream_close(F_true, &file); @@ -511,7 +526,7 @@ extern "C" { f_macro_fss_delimits_t_delete_simple(contents_delimits); } else { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); status = F_status_set_error(F_parameter); } diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index 602003b..2db1478 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.c +++ b/level_3/fss_extended_read/c/private-fss_extended_read.c @@ -46,7 +46,7 @@ extern "C" { fss_extended_read_macro_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); return status; } @@ -130,12 +130,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to allocate memory.%c", fll_error_print_error, f_string_eol_s[0]); } else if (status_code == f_string_length_t_size) { fl_color_print(data.error.to.stream, data.context.set.error, "%sUnable to process '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); - fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol_s[0]); } else { f_string_t function = "fl_string_append"; @@ -148,7 +148,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code); fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function); - fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol_s[0]); } return status; @@ -157,7 +157,7 @@ extern "C" { if (!depths->array[i].value_name.used) { fl_color_print(data.error.to.stream, data.context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -174,7 +174,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -185,7 +185,7 @@ extern "C" { fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth); fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); return F_status_set_error(F_parameter); } @@ -226,7 +226,7 @@ extern "C" { fl_string_dynamic_delete(&data->buffer); if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); return F_none; } @@ -309,10 +309,10 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } } else if (depths.array[0].index_name > 0) { @@ -324,10 +324,10 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); } else { - fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", data->objects.used, f_string_eol_s[0]); } return F_none; @@ -407,7 +407,7 @@ extern "C" { if (depths.array[0].index_at > 0) { if (depths.array[0].value_at >= data->objects.used) { if (names[depths.array[0].value_at] && data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } return F_none; @@ -421,10 +421,10 @@ extern "C" { if (at == depths.array[0].value_at) { if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { if (!data->contents.array[i].used) { - fprintf(data->output.stream, "0%c", f_string_eol[0]); + fprintf(data->output.stream, "0%c", f_string_eol_s[0]); } else { - fprintf(data->output.stream, "1%c", f_string_eol[0]); + fprintf(data->output.stream, "1%c", f_string_eol_s[0]); } return F_none; @@ -535,7 +535,7 @@ extern "C" { total++; } // for - fprintf(data->output.stream, "%llu%c", total, f_string_eol[0]); + fprintf(data->output.stream, "%llu%c", total, f_string_eol_s[0]); return F_none; } diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index f0fea6e..e748526 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[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."); @@ -38,19 +38,19 @@ extern "C" { 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, ") to designate the start of a Content.%c", f_string_eol_s[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, ") to designate the end of the last Content.%c", f_string_eol_s[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, ") is used to ignore a content range, which does nothing in this program.%c", f_string_eol_s[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"); @@ -60,24 +60,24 @@ extern "C" { 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, ").%c", f_string_eol_s[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, " The end of the pipe represents the end of any Object or Content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "' does nothing.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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, "', which therefore does nothing.%c", f_string_eol_s[0]); + fprintf(output.stream, " This parameter requires two values.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -96,8 +96,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_extended_write_delete_data(data); @@ -159,10 +174,10 @@ extern "C" { if (data->parameters[fss_extended_write_parameter_file].result == f_console_result_additional) { if (data->parameters[fss_extended_write_parameter_file].values.used > 1) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -203,14 +218,14 @@ extern "C" { else if (data->parameters[fss_extended_write_parameter_content].locations.used && data->parameters[fss_extended_write_parameter_partial].locations.used) { if (data->parameters[fss_extended_write_parameter_content].result == f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_partial); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter only allows either the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter or the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter, but not both.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -226,12 +241,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must be specified before a '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -244,12 +259,12 @@ extern "C" { if (location_object > location_content || location_object == location_content && location_sub_object > location_sub_content) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sEach ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter must have at least one '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -271,12 +286,12 @@ extern "C" { } else if (!data->process_pipe) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThis requires either piped data or the use of the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -285,10 +300,10 @@ extern "C" { if (F_status_is_error_not(status) && data->process_pipe) { if (data->parameters[fss_extended_write_parameter_partial].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_partial); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter cannot be used when processing a pipe.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -299,10 +314,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_extended_write_parameter_prepend].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -323,10 +338,10 @@ extern "C" { if (status == F_false) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must only contain whitespace.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -336,10 +351,10 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe value for the parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_prepend); - fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must not be an empty string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -350,10 +365,10 @@ extern "C" { if (F_status_is_error_not(status)) { if (data->parameters[fss_extended_write_parameter_ignore].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no values were given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -363,10 +378,10 @@ extern "C" { const f_array_length_t total_arguments = data->parameters[fss_extended_write_parameter_ignore].values.used; if (total_locations * 2 > total_arguments) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_ignore); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires two values.%c", f_string_eol_s[0]); status = F_status_set_error(F_parameter); } @@ -400,10 +415,10 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input pipe"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } } @@ -519,15 +534,15 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sWhile processing the ", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "input arguments"); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); } } 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(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -551,7 +566,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/fss_extended_write/c/private-fss_extended_write.c b/level_3/fss_extended_write/c/private-fss_extended_write.c index 67593f3..caabc58 100644 --- a/level_3/fss_extended_write/c/private-fss_extended_write.c +++ b/level_3/fss_extended_write/c/private-fss_extended_write.c @@ -12,14 +12,14 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sMust specify the '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_object); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter at least once and the '"); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_content); fl_color_print(data.error.to.stream, data.context.set.error, "' parameter one or more times when not specifying the "); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_write_long_partial); - fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' parameter.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_write_error_parameter_at_least_once_print_ @@ -30,10 +30,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", symbol, parameter); - fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_write_error_parameter_value_missing_print_ @@ -44,10 +44,10 @@ extern "C" { return; } - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThis standard does not support end of line character '", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "\\n"); - fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol_s[0]); } #endif // _di_fss_extended_write_error_parameter_unsupported_eol_print_ diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index cc09580..985b4aa 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); @@ -46,8 +46,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fss_status_code_delete_data(data); @@ -105,7 +120,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); fss_status_code_delete_data(data); return F_status_set_error(status); @@ -115,7 +130,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); fss_status_code_delete_data(data); return F_status_set_error(status); @@ -126,14 +141,14 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); fss_status_code_delete_data(data); return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify an error code.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify an error code.%c", fll_error_print_error, f_string_eol_s[0]); fss_status_code_delete_data(data); return F_status_set_error(F_parameter); 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 a98d4f1..2809692 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(data.output.stream, 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_s[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[0]); } return status; @@ -87,7 +87,7 @@ extern "C" { } if (status == F_data) { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[0]); } return status; diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 9044624..70f02a5 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -20,21 +20,21 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); @@ -42,11 +42,11 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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]); + 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_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); fprintf(output.stream, " The "); fl_color_print(output.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); @@ -63,26 +63,26 @@ extern "C" { 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]); + fprintf(output.stream, ".%c", f_string_eol_s[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]); + fprintf(output.stream, ": The name of the vocabulary whose content is to be substituted.%c", f_string_eol_s[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]); + fprintf(output.stream, ": The content matching this exact string will be substituted.%c", f_string_eol_s[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]); + fprintf(output.stream, ": The new string to use as the substitute.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " 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_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " 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_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -101,14 +101,29 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); if (data->error.verbosity == f_console_verbosity_verbose) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } iki_read_delete_data(data); @@ -165,10 +180,10 @@ extern "C" { if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[iki_read_parameter_at].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -191,7 +206,7 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); @@ -205,10 +220,10 @@ extern "C" { if (data->parameters[iki_read_parameter_line].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_line); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -232,10 +247,10 @@ extern "C" { if (data->parameters[iki_read_parameter_name].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_name); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -244,10 +259,10 @@ extern "C" { if (data->parameters[iki_read_parameter_substitute].result != f_console_result_none) { if (data->parameters[iki_read_parameter_substitute].result == f_console_result_found || data->parameters[iki_read_parameter_substitute].values.used % 3 != 0) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); - fl_color_print(data->error.to.stream, data->context.set.error, "' requires 3 strings.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' requires 3 strings.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -255,12 +270,12 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -270,12 +285,12 @@ extern "C" { if (data->parameters[iki_read_parameter_literal].result == f_console_result_found) { if (data->parameters[iki_read_parameter_object].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -283,12 +298,12 @@ extern "C" { if (data->parameters[iki_read_parameter_content].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -296,12 +311,12 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -312,12 +327,12 @@ extern "C" { else if (data->parameters[iki_read_parameter_object].result == f_console_result_found) { if (data->parameters[iki_read_parameter_content].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -325,12 +340,12 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -349,12 +364,12 @@ extern "C" { if (data->parameters[iki_read_parameter_whole].result == f_console_result_found) { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sCannot specify the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_whole); fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -363,7 +378,7 @@ extern "C" { if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } iki_read_delete_data(data); @@ -438,8 +453,8 @@ extern "C" { } else { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data->error.to.stream, data->context.set.error, "%syou failed to specify one or more files.%c", fll_error_print_error, f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%syou failed to specify one or more files.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -448,7 +463,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status) || !data->mode) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 6381e4e..be6b5aa 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -14,13 +14,13 @@ extern "C" { range->start = 0; if (data->line > 0) { for (; line < data->line && range->start < data->buffer.used; range->start++) { - if (data->buffer.string[range->start] == f_string_eol[0]) line++; + if (data->buffer.string[range->start] == f_string_eol_s[0]) line++; } // for } if (line == data->line) { for (range->stop = range->start; range->stop < data->buffer.used; range->stop++) { - if (data->buffer.string[range->stop] == f_string_eol[0]) break; + if (data->buffer.string[range->stop] == f_string_eol_s[0]) break; } // for return F_true; @@ -173,7 +173,7 @@ extern "C" { f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[j]); } - printf("%c", f_string_eol[0]); + printf("%c", f_string_eol_s[0]); } } // for } // for @@ -196,7 +196,7 @@ extern "C" { f_print_dynamic_partial(data->output.stream, data->buffer, ranges->array[i]); } - printf("%c", f_string_eol[0]); + printf("%c", f_string_eol_s[0]); } // for status = F_none; diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 636f65a..26eb8ec 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); @@ -32,20 +32,20 @@ extern "C" { fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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]); + fprintf(output.stream, ".%c", f_string_eol_s[0]); - fprintf(output.stream, " 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_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[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]); + 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_s[0]); + fprintf(output.stream, " Furthermore, each object must be followed by a content.%c", f_string_eol_s[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); return F_none; } @@ -64,13 +64,28 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } iki_write_delete_data(data); @@ -134,7 +149,7 @@ extern "C" { if (data->error.verbosity != f_console_verbosity_quiet) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -156,7 +171,7 @@ extern "C" { if (data->error.verbosity != f_console_verbosity_quiet) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -167,7 +182,7 @@ extern "C" { if (data->error.verbosity != f_console_verbosity_quiet) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -177,7 +192,7 @@ extern "C" { if (data->error.verbosity != f_console_verbosity_quiet) { fl_color_print(data->error.to.stream, data->context.set.error, "%sThe parameter '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -186,12 +201,12 @@ extern "C" { if (F_status_is_error_not(status) && !data->process_pipe) { if (data->parameters[iki_write_parameter_object].result != f_console_result_additional && data->parameters[iki_write_parameter_content].result != f_console_result_additional) { if (data->error.verbosity != f_console_verbosity_quiet) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data->error.to.stream, data->context.set.error, "%sNo data provided, either pipe the data or use the '", fll_error_print_error); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); fl_color_print(data->error.to.stream, data->context.set.error, "' and the '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); - fl_color_print(data->error.to.stream, data->context.set.error, "' parameters.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' parameters.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -205,7 +220,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); fl_color_print(data->error.to.stream, data->context.set.error, "' and '"); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); - fl_color_print(data->error.to.stream, data->context.set.error, "' must be specified the same number of times.%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "' must be specified the same number of times.%c", f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -261,7 +276,7 @@ extern "C" { if (!buffer.used) { if (data->error.verbosity != f_console_verbosity_quiet) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has no data.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has no data.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -288,7 +303,7 @@ extern "C" { if (object_ended && previous == range.start) { if (data->error.verbosity != f_console_verbosity_quiet) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has incorrectly placed newlines.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has incorrectly placed newlines.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -313,7 +328,7 @@ extern "C" { status = iki_write_process(*data, output, object, content, quote, &escaped); if (F_status_is_error(status)) break; - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); object_ended = F_false; } @@ -345,7 +360,7 @@ extern "C" { if (F_status_is_error_not(status) && object_ended) { if (data->error.verbosity != f_console_verbosity_quiet) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has an object without content.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sThe pipe has an object without content.%c", fll_error_print_error, f_string_eol_s[0]); } status = F_status_set_error(F_parameter); @@ -373,12 +388,12 @@ extern "C" { status = iki_write_process(*data, output, object, content, quote, &escaped); if (F_status_is_error(status)) break; - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); } // for // 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(data->output.stream, "%c", f_string_eol[0]); + fprintf(data->output.stream, "%c", f_string_eol_s[0]); } } @@ -394,7 +409,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/iki_write/c/private-iki_write.c b/level_3/iki_write/c/private-iki_write.c index bb533ef..5a06325 100644 --- a/level_3/iki_write/c/private-iki_write.c +++ b/level_3/iki_write/c/private-iki_write.c @@ -10,10 +10,10 @@ extern "C" { if (!object.used) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe object is missing, it must not have a length of ", fll_error_print_error); fl_color_print(data.error.to.stream, data.context.set.notable, "0"); - fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol_s[0]); } return F_status_set_error(F_failure); @@ -23,14 +23,14 @@ extern "C" { if (status == F_false) { if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "%sThe object '", fll_error_print_error); fl_color_print_code(data.error.to.stream, data.context.notable); f_print_dynamic(data.error.to.stream, object); fl_color_print_code(data.error.to.stream, data.context.reset); - fl_color_print(data.error.to.stream, data.context.set.error, "' is not a valid IKI object.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "' is not a valid IKI object.%c", f_string_eol_s[0]); } return F_status_set_error(F_failure); diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index 81f146a..8eb3a9a 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -19,10 +19,10 @@ extern "C" { fll_program_print_help_usage(output, context, init_name, f_string_empty_s); fl_color_print(output.stream, context.set.important, " Notes:"); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); - fprintf(output.stream, " This program is intended to be directly called by the kernel during boot.%c", f_string_eol[0]); - fprintf(output.stream, "%c", f_string_eol[0]); + fprintf(output.stream, " This program is intended to be directly called by the kernel during boot.%c", f_string_eol_s[0]); + fprintf(output.stream, "%c", f_string_eol_s[0]); // @todo: this should still print the kernel command options. @@ -43,13 +43,28 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { if (data->error.verbosity != f_console_verbosity_quiet) { fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true); - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } init_delete_data(data); @@ -79,7 +94,7 @@ extern "C" { // ensure a newline is always put at the end of the program execution, unless in quiet mode. if (data->error.verbosity != f_console_verbosity_quiet) { if (F_status_is_error(status)) { - fprintf(data->error.to.stream, "%c", f_string_eol[0]); + fprintf(data->error.to.stream, "%c", f_string_eol_s[0]); } } diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 4e0b1f6..fddc12e 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -360,9 +360,9 @@ Consider the "*.device" files such that they are also use IKI. case F_signal_termination: if (data.error.verbosity != f_console_verbosity_quiet) { - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting."); - fprintf(data.error.to.stream, "%c", f_string_eol[0]); + fprintf(data.error.to.stream, "%c", f_string_eol_s[0]); } return F_true; diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index 41760cf..a910bd4 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(data.output.stream, 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_s[0]); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[0]); } return status; } if (status == F_data) { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[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(data.output.stream, 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_s[0]); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print(data.output.stream, 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_s[0]); } else { - fl_color_print(data.output.stream, 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_s[0]); } return status; diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 1804eb9..73da0d7 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -20,7 +20,7 @@ extern "C" { 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]); + fprintf(output.stream, "%c", f_string_eol_s[0]); 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."); @@ -46,8 +46,23 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context); - data->error.context = data->context.set.error; - data->error.notable = data->context.set.notable; + if (data->context.set.error.before) { + data->error.context = data->context.set.error; + data->error.notable = data->context.set.notable; + } + else { + data->context.set.warning = f_color_set_empty_s; + data->context.set.error = f_color_set_empty_s; + data->context.set.title = f_color_set_empty_s; + data->context.set.notable = f_color_set_empty_s; + data->context.set.important = f_color_set_empty_s; + data->context.set.standout = f_color_set_empty_s; + data->context.set.normal = f_color_set_empty_s; + data->context.set.normal_reset = f_color_set_empty_s; + + data->error.context = f_color_set_empty_s; + data->error.notable = f_color_set_empty_s; + } if (F_status_is_error(status)) { status_code_delete_data(data); @@ -105,7 +120,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); status_code_delete_data(data); return F_status_set_error(status); @@ -115,7 +130,7 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); status_code_delete_data(data); return F_status_set_error(status); @@ -126,14 +141,14 @@ extern "C" { fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter "); fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); - fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol_s[0]); status_code_delete_data(data); return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { - fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify a status code.%c", fll_error_print_error, f_string_eol[0]); + fl_color_print(data->error.to.stream, data->context.set.error, "%sYou failed to specify a status code.%c", fll_error_print_error, f_string_eol_s[0]); status_code_delete_data(data); return F_status_set_error(F_parameter);